使用 lualatex 文件“ltluatex.tex”进行编译时出错

使用 lualatex 文件“ltluatex.tex”进行编译时出错

在很多情况下,当lualatex我使用编译时,会出现这个错误

(c:/texlive/2015/texmf-dist/tex/latex/base/ltluatex.tex 文件:ltluatex.tex 2015/10/03 v1.0f LuaTeX 支持纯 TeX(核心)

! 缺失数字,视为零。\relax l.140 \newcatcodetable\catcodetable@initex

例如编译这个回答或者@Mico回答给我这个错误,注意我有texlive 2015LuaTeX, Version beta-0.80

我该如何解决这个问题,谢谢。

更新1不起作用的示例

\documentclass[border=5mm]{standalone}
\usepackage{fontspec}
\setmainfont{Helvetica}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
beginfig(1);

path ground, wall, ramp, ball;

w = 21; h = 3w; r = 200; a = angle(r+-+h,-h);

ground = (left -- right) scaled 140;
wall   = unitsquare xscaled w yscaled h shifted 110 left;
ramp   = unitsquare xscaled (r+w) yscaled 5
                    shifted point 3 of wall
                    rotatedabout(point 2 of wall, a);
ball   = fullcircle scaled 2 shifted up rotated a 
                    scaled 10 shifted point 2.7 of ramp;

draw ground;
fill wall withcolor .7[red+1/2green,white]; draw wall;
fill ramp withcolor .7[red,white];          draw ramp;
fill ball withcolor .7[blue,white];         draw ball;

path mark[];
mark1 = (point 1 of wall -- point 1 of ramp) shifted 7 down;
drawdblarrow mark1; 
draw (down--up) scaled 2 shifted point 0 of mark1;
draw (down--up) scaled 2 shifted point 1 of mark1;
label.bot("Displacement", point 0.5 of mark1);

endfig;
\end{mplibcode}
\end{document}

更新2 日志档案

This is LuaTeX, Version beta-0.80.0 (TeX Live 2015/W32TeX) (rev 5238)  (format=lualatex 2015.12.21)  4 FEB 2016 21:16
 restricted \write18 enabled.
**test3.tex
(./test3.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 38 languages loaded.
(c:/texlive/2015/texmf-dist/tex/latex/standalone/standalone.cls
Document Class: standalone 2015/07/15 v1.2 Class to compile TeX sub-files standa
lone
(c:/texlive/2015/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX detected.
)
(c:/texlive/2015/texmf-dist/tex/generic/oberdiek/ifpdf.sty
Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in PDF mode is detected.
)
(c:/texlive/2015/texmf-dist/tex/generic/ifxetex/ifxetex.sty
Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
)
(c:/texlive/2015/texmf-dist/tex/latex/xkeyval/xkeyval.sty
Package: xkeyval 2014/12/03 v2.7a package option processing (HA)

(c:/texlive/2015/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(c:/texlive/2015/texmf-dist/tex/generic/xkeyval/xkvutils.tex
\XKV@toks=\toks14
\XKV@tempa@toks=\toks15

(c:/texlive/2015/texmf-dist/tex/generic/xkeyval/keyval.tex))
\XKV@depth=\count79
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
\sa@internal=\count80
\c@sapage=\count81

(c:/texlive/2015/texmf-dist/tex/latex/standalone/standalone.cfg
File: standalone.cfg 2015/07/15 v1.2 Default configuration file for 'standalone'
 class
)
(c:/texlive/2015/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(c:/texlive/2015/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count82
\c@section=\count83
\c@subsection=\count84
\c@subsubsection=\count85
\c@paragraph=\count86
\c@subparagraph=\count87
\c@figure=\count88
\c@table=\count89
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
\sa@box=\box26
)
(c:/texlive/2015/texmf-dist/tex/latex/fontspec/fontspec.sty
Package: fontspec 2015/09/24 v2.4e Font selection for XeLaTeX and LuaLaTeX

(c:/texlive/2015/texmf-dist/tex/latex/l3kernel/expl3.sty
Package: expl3 2016/01/19 v6377 L3 programming layer (loader) 

(c:/texlive/2015/texmf-dist/tex/latex/l3kernel/expl3-code.tex
Package: expl3 2016/01/19 v6377 L3 programming layer (code)
L3 Module: l3bootstrap 2016/01/01 v6339 L3 Bootstrap code

(c:/texlive/2015/texmf-dist/tex/latex/base/ltluatex.tex
File: ltluatex.tex 2015/12/18 v1.0l LuaTeX support for plain TeX (core) 

! Missing number, treated as zero.
<to be read again> 
\relax 
l.140 \newcatcodetable\catcodetable@initex

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! No room for a new 8.
\e@ch@ck ...lse \errmessage {No room for a new #4}
                                                  \fi \fi 
l.140 \newcatcodetable\catcodetable@initex

This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.


! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.140 \newcatcodetable\catcodetable@initex

You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

! Invalid \catcode table.
<recently read> \allocationnumber 

l.140 \newcatcodetable\catcodetable@initex

You can only switch to a \catcode table that is initialized
using \savecatcodetable or \initcatcodetable, or to table 0

! Missing number, treated as zero.
<to be read again> 
\relax 
l.140 \newcatcodetable\catcodetable@initex

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

\catcodetable@initex=\catcodetable26
! Missing number, treated as zero.
<to be read again> 
\relax 
l.141 \newcatcodetable\catcodetable@string

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! No room for a new 8.
\e@ch@ck ...lse \errmessage {No room for a new #4}
                                                  \fi \fi 
l.141 \newcatcodetable\catcodetable@string

(That was another \errmessage.)

! Missing number, treated as zero.
<to be read again> 
\relax 
l.141 \newcatcodetable\catcodetable@string

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

\catcodetable@string=\catcodetable26
! Invalid \catcode table.
\newcatcodetable ...atcodetable \allocationnumber 

l.141 \newcatcodetable\catcodetable@string

You cannot overwrite the current \catcode table

)
Runaway definition?
#1#2#3{\ifnum #1>#2 \expandafter \@gobble \else \expandafter \@firsto\ETC.
! File ended while scanning definition of \setrangecatcode.
<inserted text> 
}
l.275       \input{ltluatex}
                          %
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Missing { inserted.
<inserted text> }

l.275       \input{ltluatex}
                          %
Where was the left brace? You said something like `\def\a}',
which I'm going to interpret as `\def\a{}'.

! Missing number, treated as zero.
<to be read again> 
\relax 
l.277     \newcatcodetable\ucharcat
                                 @table
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! No room for a new 8.
\e@ch@ck ...lse \errmessage {No room for a new #4}
                                                  \fi \fi 
l.277     \newcatcodetable\ucharcat
                                 @table
(That was another \errmessage.)

! Missing number, treated as zero.
<to be read again> 
\relax 
l.277     \newcatcodetable\ucharcat
                                 @table
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

\ucharcat=\catcodetable26
! Invalid \catcode table.
\newcatcodetable ...atcodetable \allocationnumber 

l.277     \newcatcodetable\ucharcat
                                 @table
You cannot overwrite the current \catcode table

! Missing number, treated as zero.
<to be read again> 
{
l.278     \directlua{

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Missing { inserted.
<to be read again> 
{
l.278     \directlua{

A left brace was mandatory here, so I've put one in.
You might want to delete and/or insert some corrections
so that I will find a matching right brace soon.
If you're confused by all this, try typing `I}' now.

! Missing number, treated as zero.
<to be read again> 
{
l.283     \directlua{
                   require("expl3")}%
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Missing { inserted.
<to be read again> 
{
l.283     \directlua{
                   require("expl3")}%
A left brace was mandatory here, so I've put one in.
You might want to delete and/or insert some corrections
so that I will find a matching right brace soon.
If you're confused by all this, try typing `I}' now.

! Missing number, treated as zero.
<to be read again> 
{
l.285       \directlua{

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Missing { inserted.
<to be read again> 
{
l.285       \directlua{

A left brace was mandatory here, so I've put one in.
You might want to delete and/or insert some corrections
so that I will find a matching right brace soon.
If you're confused by all this, try typing `I}' now.

! Missing { inserted.
<to be read again> 
{
l.292         \csname\detokenize{
                               lua_now_x:n}\endcsname{require("expl3")}%
A left brace was mandatory here, so I've put one in.
You might want to delete and/or insert some corrections
so that I will find a matching right brace soon.
If you're confused by all this, try typing `I}' now.

)
Runaway text?
{lua_now_x:n}\endcsname {require("expl3")}}\fi \fi \fi \begingroup \def \ETC.
! File ended while scanning text of \detokenize.
<inserted text> 
}
l.97 \input{expl3-code.tex}

I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Missing \endcsname inserted.
<to be read again> 
\begingroup 
l.98 \begingroup
              \expandafter\expandafter\expandafter\endgroup
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.

)
Runaway text?
{ if status.ini_version then tex.write("1") end }>0 \everyjob {\begingroup \ETC.
! File ended while scanning text of \csname\endcsname.
<inserted text> 
}
l.20 \RequirePackage{expl3}[2015/06/26]

I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! LuaTeX error [\directlua]:1: unexpected symbol near '{'.
<inserted text> }

l.20 \RequirePackage{expl3}[2015/06/26]

The lua interpreter ran into a problem, so the
remainder of this lua chunk will be ignored.

! Missing = inserted for \ifnum.
<to be read again> 
\let 
l.20 \RequirePackage{expl3}[2015/06/26]

I was expecting to see `<', `=', or `>'. Didn't.

! Missing number, treated as zero.
<to be read again> 
\let 
l.20 \RequirePackage{expl3}[2015/06/26]

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Undefined control sequence.
<argument> \@nil 

l.20 \RequirePackage{expl3}[2015/06/26]

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

)
Runaway argument?
~ e.g.,~ "xelatex"~ or~ "lualatex"\\ instead~ of~ plain~ "latex"~ or~\ETC.
! File ended while scanning use of \@iforloop.
<inserted text> 
\par 
l.3 \setmainfont
              {Helvetica}
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Undefined control sequence.
<argument> \@nil 

l.3 \setmainfont
              {Helvetica}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

)
Runaway argument?
 wall, ramp, ball; \par w = 21; h = 3w; r = 200; a = angle(r+-+h,-h);\ETC.
! File ended while scanning use of \@iforloop.
<inserted text> 
\par 
<*> test3.tex

I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Emergency stop.
<*> test3.tex

*** (job aborted, no legal \end found)



Here is how much of LuaTeX's memory you used:
 1153 strings out of 494752
 100000,1373583 words of node,token memory allocated 368 words of node memory still in use:
   2 hlist, 1 rule, 1 glue, 15 glyph, 38 glue_spec, 1 temp, 11 if_stack, 1 write
, 1 local_par, 1 dir nodes
   avail lists: 2:7,3:1,4:1,9:2
 4806 multiletter control sequences out of 65536+600000
 15 fonts using 431615 bytes
 34i,0n,56p,197b,36s stack positions out of 5000i,500n,10000p,200000b,100000s
!  ==> Fatal error occurred, no output PDF file produced!

@DavideCarlisle 如果我运行fmtutil --all我会得到错误

fmtutil [错误]:调用'luatex -ini -jobname=lualatex -progname=lualatex lualatex.ini'返回错误代码 1

fmtutil [错误]: `luatex -ini -jobname=lualatex -progname=lualatex lualatex.ini' 失败

fmtutil [错误]: 调用 'luatex -ini -jobname=dvilualatex -progname=dvilualatex dvilualatex.ini' 返回错误代码 1

fmtutil [错误]:'luatex -ini -jobname=dvilualatex -progname=dvilualatex dvilualatex.ini' 失败

fmtutil [错误]: 调用“xetex -ini -jobname=xelatex -progname=xelatex -etex xelatex.ini”返回错误代码 1

fmtutil [错误]: ‘xetex -ini -jobname=xelatex -progname=xelatex -etex xelatex.ini’ 失败

答案1

您的文档在更新的 latex 上运行时没有错误。您没有显示日志的开头,日志会显示 latex 版本,但看起来您的安装与 ltluatex.lua 不一致,ltluatex.lua 来自 2015 年 10 月的 latex 版本,但格式来自 2015/01/01 版本。很可能您有更新的文件,但格式没有重建。

你可以使用

fmtutil-sys --all

根据您安装的文件重建格式,或者更好的是使用

tlmgr update --all

它将获得 2016/02/01 版本并使用最新的来源重新制作格式。

相关内容