[luatex] incompatible change to mathcode

David Carlisle davidc at nag.co.uk
Tue May 8 21:11:45 CEST 2012


Luatex has changed mathcode to allow a larger numeric range however 
changing TeX primitives without giving them new names seems suspect and 
in this particular case, since \mathcode has changed but \mathchardef 
has not the essential link between these two commands has been broken.

This has come to light (again) due to a latex bug report that the core 
tools latex package bm is broken in lualatex

http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=tools/4188

Searching with google suggests that several other packages notably 
amsmath are similarly broken but workarounds have been provided on an ad 
hoc basis.

Can this change be reversed and TeX primitives _not_ be changed in 
incompatible ways.

\documentclass{article}

\mathchardef\matha\mathcode`a
\showthe\matha
\stop

produces

 > 29025.
l.4 \showthe\matha


on systems compatible with TeX

on lulatex it produces:

$ lualatex bm99
This is LuaTeX, Version beta-0.70.1-2012042619 (rev 4277)
  restricted \write18 enabled.
(./bm99.tex
LaTeX2e <2011/06/27>
LuaTeX adaptation of babel <v3.8l-luatex-1.4> and hyphenation patterns 
for engl
ish, dumylang, nohyphenation, loaded.
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size10.clo))
! Invalid math code.
l.3 \mathchardef\matha\mathcode`a



David


More information about the luatex mailing list