TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The eTeX \scantokens command appears to work differently in LuaTeX than it does in eTeX, pdfTeX and XeTeX. Compiling the following test file with any engine other than LuaTeX performs \show+, which shows the character +, but LuaTeX skips this statement entirely.

\newlinechar=10 \catcode10=12
\endlinechar=13 \catcode13=5

This behaviour reminds me of how TeX does not look in a line after tokens of category code 5 (end-of-line), so at first I thought that the default category codes might be different in LuaTeX. This is why I added some redundant catcode assignments. Obviously, that didn't suffice.

share|improve this question
up vote 6 down vote accepted

This is a known bug in the LuaTeX implementation of \scantokens: http://tracker.luatex.org/view.php?id=733 (taking pdfTeX as a 'reference' behaviour and therefore correct by definition).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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