[luatex] a problem with luatexUmathcode

jfbu jfbu at free.fr
Sat Oct 13 13:14:56 CEST 2012


Le 12 oct. 2012  22:01, jfbu <jfbu at free.fr> wrote :

> Hi,  [I just posted on c.t.tex, but figured here could be better]
> 
> the following code gives dissimilar results for XeTeX 
> and LuaLatex. 
> 
> \documentclass{article} 
> \usepackage{ifxetex} 
> \begin{document} 
> \ifxetex 
> 
> \the\mathcode`\-           % 8704="2200 
> \the\XeTeXmathcodenum`\-   % 37748736=2.2^{24} + 2.2^{21} + 0 
> 
> \else 
> 
> \the\mathcode`\-           % 8704 = "2200 
> 
> \the\luatexUmathcodenum`\- % 8704, if interpreted as Unicode 
>                           % mathcode 0.2^{24} + 0.2^{21} + 8704 
> \fi 
> \end{document} 
> 
> This is a bit strange. The problem with this behavior of LuaLaTeX 
> is that I need to know *in advance* if I have to interpret the 
> number resulting from \luatexUmathcodenum as a legacy mathcode 
> or as a Unicode mathcode ! ... 
> 
> best wishes, 
> Jean-Francois


Hi again

\documentclass{article} 
\usepackage{ifxetex} 
\begin{document} 
\ifxetex 
\the\XeTeXmathcodenum`\a   % 31457377 
\the\XeTeXmathcodenum`\1   % 14680113 
\the\XeTeXmathcodenum`\-   % 37748736 
\else 
\the\luatexUmathcodenum`\a   % 31457377 
\the\luatexUmathcodenum`\1   % 28721 
\the\luatexUmathcodenum`\-   % 8704 
\fi 
\end{document} 

Why the difference between querying the mathcode of a and 1?

This makes it impossible for me to use \luatexUmathcodenum to
query the family number for 1 or -, as I can not know in advance
if it will return a legacy mathcode (as here) or a Unicode mathcode
(if 1 or - have been assigned Unicode mathcode).

Jean-Francois


More information about the luatex mailing list