Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Missing character" error message of LuaTeX is not detected #2943

Closed
user202729 opened this issue Apr 28, 2024 · 5 comments
Closed

"Missing character" error message of LuaTeX is not detected #2943

user202729 opened this issue Apr 28, 2024 · 5 comments

Comments

@user202729
Copy link

%! TEX program = lualatex
\documentclass{article}
\begin{document}
\tracinglostchars=3
\symbol{1}
\end{document}

Results in "Compilation failed!" without any error message.

Must compile with LuaLaTeX. For PDFLaTeX the character at position 1 does exist (you can replace 1 with 255, but then for PDFLaTeX then the error is detected)

@lervag
Copy link
Owner

lervag commented Apr 28, 2024

I think it's fixed now; please update and test. Notice, I was not able to parse the line number of the error.

@lervag lervag closed this as completed Apr 28, 2024
@user202729
Copy link
Author

user202729 commented Apr 28, 2024

Yes that works 😄 but there's a little quirk: if it's only set to be a warning instead of an error, the parser will gobble the next line.

Quickfix window:

c.tex|| There is no ^^A (U+0001) in font [lmroman10-regular]:+tlig;! {/home/user202729/.texlive/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (/tmp/.tex-fast-recompile-tmp/301923-01rf2jzi/c.aux)

Source:

%! TEX program = lualatex
\documentclass{article}
\begin{document}
\symbol{1}
\end{document}

Log file partial:

c.tex

(./c.tex [1


Missing character: There is no ^^A (U+0001) in font [lmroman10-regular]:+tlig;!
{/home/user202729/.texlive/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (/tmp/.tex-fast-recompile-tmp/301923-01rf2jzi/c.aux)
 ***********
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-02-20>
 ***********

@lervag
Copy link
Owner

lervag commented Apr 28, 2024

Huh, so \tracinglostchars=3 specifies that this is an error? I'm not sure if I want to support that feature. Thus, if the default behaviour is to mark it is a warning, then that's what we should do.

So, I propose we "demote" the "Missing character" to a warning, and then I'll also fix the gobble-problem. Does that sound fine by you?

@user202729
Copy link
Author

user202729 commented Apr 28, 2024

I didn't know vimtex handles a warning and an error differently. I don't see any problem either way as long as it's visible to the user.

Note that the default mode of vimtex is in \scrollmode (we forcefully continue through errors) anyway.

lervag added a commit that referenced this issue Apr 28, 2024
@lervag
Copy link
Owner

lervag commented Apr 28, 2024

I didn't know vimtex handles a warning and an error differently.

Ah, well, that's not precisely what I meant. What we do, more precisely is to parse the latex log file line for line with the errorformat spec, see e.g.:

setlocal errorformat+=%-G{/%m
setlocal errorformat+=%+C{%m
setlocal errorformat+=%C!\ %m
" More info for undefined control sequences
setlocal errorformat+=%Z<argument>\ %m
" More info for some errors
setlocal errorformat+=%Cl.%l\ %m
"
" Define general warnings
"
setlocal errorformat+=%+WLaTeX\ Font\ Warning:\ %.%#line\ %l%.%#
setlocal errorformat+=%-CLaTeX\ Font\ Warning:\ %m
setlocal errorformat+=%-C(Font)%m
setlocal errorformat+=%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#
setlocal errorformat+=%+WLaTeX\ %.%#Warning:\ %m
setlocal errorformat+=%+WOverfull\ %\\%\\hbox%.%#\ at\ lines\ %l--%*\\d
setlocal errorformat+=%+WOverfull\ %\\%\\hbox%.%#\ at\ line\ %l
setlocal errorformat+=%+WOverfull\ %\\%\\vbox%.%#\ at\ line\ %l
setlocal errorformat+=%+WUnderfull\ %\\%\\hbox%.%#\ at\ lines\ %l--%*\\d
setlocal errorformat+=%+WUnderfull\ %\\%\\vbox%.%#\ at\ line\ %l
setlocal errorformat+=%+WMissing\ character:\ %m

This is definitely an esoteric DSL that takes some getting used to!

So, in this sense, we handle warnings and errors the same. But we do match them slightly differently. The problem with your last example is that this line in the log:

{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./test.aux)

was matched as a multi-line continuation in line 40 of latexlog.vim. So, I had to add a more specific matcher to ignore it (i.e. line 39).

Note that the default mode of vimtex is in \scrollmode (we forcefully continue through errors) anyway.

Yes, but I don't think that is relevant here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants