Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with luatexUmathcode

8 views
Skip to first unread message

jfbu

unread,
Oct 12, 2012, 3:52:33 PM10/12/12
to
Hi,

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

jfbu

unread,
Oct 13, 2012, 7:15:53 AM10/13/12
to
Le 12/10/12 21:52, jfbu a �crit :
[also posted on the luatex mailing list]

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

jfbu

unread,
Oct 13, 2012, 7:30:19 AM10/13/12
to
Le 13/10/12 13:15, jfbu wrote :
How do I know that a package did not do something
like \mathcode`\a="161\relax?

If this happens \the\luatexUmathcodenum`\a will be
a legacy mathcode 353 and not a Unicode mathcode
like 31457377. The family number is not on the same
bits, and my code will be broken.

Is there some primitive (not some Lua code that I don't
want to have to learn) from Lualatex which gives me
a safe way to extract the family number of a math character?

regards

Jean-Francois
0 new messages