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 following ecm compiles fine with LaTeX and XeLaTeX, but doesn't work with LuaLaTeX :


And here is the error :

Invalid \endlinechar.
<recently read> \@M 

l.4 \typein{test}

share|improve this question
\endlinechar seems to get set to \@M which is 10000, a value normally used as maximum for penalties. The TeXBook states that for values <0 and >255 no endline character is appended to the line. Maybe in LuaTeX the value for \endlinechar is limited to some value below 10000 and therefore this causes an error? – Martin Scharrer Mar 1 '11 at 21:34
The manual of luatex says in the section about modifications: "The upper limit to \endlinechar and \newlinechar is 127.". So it won't work. – Ulrike Fischer Mar 2 '11 at 8:47
\endlinechar=-1 should work for the intended purpose. Note that even if luatex were to accept \endlinechar=10000, this would mean something completely different: in unicode, char 10000 is actually "UPPER RIGHT PENCIL" – Taco Hoekwater Mar 2 '11 at 11:30
@Taco, could you post an answer with the exact code (where should I write \endlinechar=-1 ?), please ? – Matsaya Mar 2 '11 at 16:20
I assume you will have to redefine \typein, but I assume this should be a job for the lualatex format itself. In any case, you will have to ask a latex expert, which I am definitely not... – Taco Hoekwater Mar 2 '11 at 18:25

You probably have to patch the kernel (untested):

  \read\@inputcheck to#1%

This should be done at format generation time; you might report it at the LaTeX mailing list (LATEX-L@LISTSERV.UNI-HEIDELBERG.DE).

share|improve this answer
this works. I also reported the bug. – Matsaya Mar 3 '11 at 22:10
up vote 3 down vote accepted

I've submitted the bug to LaTeX bugs database and this is now fixed in TeXLive.

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.