6

When pdflatex encounters a character it cannot encode into a font, it dies and produces a non-zero exit code. By contrast, lualatex happily produces an exit code of 0 and simply prints a warning:

Missing character: There is no ȳ (U+0233) in font [lmmono10-regular]:!

I regard this as a fatal error, since it failed to typeset the document. I cannot find any way to make lualatex produce a non-zero exit code in this case, so I have to parse the log file looking for these.

This seems like a gross oversight of lualatex - are there any other cases where it fails to typeset the document but still produces an exit code of 0?

2
  • set \tracinglostchars=3 Dec 9, 2022 at 17:19
  • 3
    That's not true: also pdflatex, by default, would have exit code 0 if a character doesn't exist in a font.
    – egreg
    Dec 9, 2022 at 17:26

1 Answer 1

9

The behavior of pdftex and luatex is exactly the same as regards to this kind of problem.

If I try, from a terminal,

pdftex '\char233 \bye' && echo $?

the console would print

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdftex)
 restricted \write18 enabled.
entering extended mode
Missing character: There is no � in font cmr10!
[1{/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]</usr/
local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on texput.pdf (1 page, 8175 bytes).
Transcript written on texput.log.
0

With

luatex '\char233 \bye' && echo $?

it is similar, but the console doesn't show the Missing character warning.

The difference is that \tracinglostchars is initialized to 2 for pdftex, but to 1 for luatex. It is initialized to 2 for lualatex, though.

You can, in both cases, set

\tracinglostchars=3

at the beginning of your file and instead of a warning you'll get an error and the exit code will be 1.

1
  • I guess I was misled by this error message from pdflatex: ! LaTeX Error: Command \DJ unavailable in encoding OT1.
    – mccurley
    Dec 9, 2022 at 17:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .