0

I noticed that latex and luatex for not declared math character uses different font. Latex uses text font and luatex math font. For example:

\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\loggingall
$
\showthe\textfont0 
\showthe\font      
Å
$
\end{document}

luatex output:

> \OT1/cmr/m/n/10 .                
l.7 \showthe\textfont\symoperators 
> \OML/cmm/m/it/10 .               
l.8 \showthe\textfont\symletters   
Missing character: There is no Å (U+00C5) in font cmmi10!

latex output:

> \OT1/cmr/m/n/10 .                
l.7 \showthe\textfont\symoperators 
> \OML/cmm/m/it/10 .               
l.8 \showthe\textfont\symletters   
LaTeX Warning: Command \r invalid in math mode on input line 9.
Missing character: There is no ┼ in font cmr10!

I see in the latex log that that this symbol is defined via \r A. The same I get with both engines using $\AA$. I understand that this is incorrect to use text symbol in math.
But the question is not about the valid typesetting. But about how luatex and latex differently picks up default font for non math declared character like luatex sets math font cmmi10 and latex sets text font cmr10. Can it be that latex uses default operators family and luatex letters? And is it possible to tell luatex behave in this case the same as latex?

For example document is typeset with latex and T1 encoding font (f.e. lmodern) and there will be outputted all the symbols from text font in the math (ignoring the warnings) and if latter this document will be compiled with luatex there will be bunch of missing chars. (I'm using TL2019 and DVI mode)

2

First of all, \AA is not a legal command in math mode, so the output is whatever TeX can do to get out of troubles.

What I get is

Missing character: There is no <C5> in font cmr10!

with pdflatex (what the terminal actually shows may depend on the OS) and it is not surprising, because the glyph Å sits at slot 0xC5 in the T1-encoded fonts. In standard LaTeX, Å is declared to yield \r A, which is invalid in math mode.

With lualatex there is no error, but no output either and I get

Missing character: There is no Å (U+00C5) in font cmmi10!

Why no error? Because LuaTeX directly interprets Unicode and the initialization files have assigned Å a math code (precisely, a \Umathcodenum), so if an OpenType/TrueType math font is being used, the output might make sense. This math code just points to the character in the math letter fonts.

So the answer is: don't use \AA in math mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.