我读了很多帖子,但一无所获。
我有一个遗留项目,以前在旧的 ubuntu 14 及其 tex 包中运行。现在,我想用现代 texlive 套件 (archlinux) 重建旧项目。问题是代码量太大,不可能放一小段代码给你看。
这是使用我的“遗留库”的最小示例。
\documentclass[twoside,a4paper,12pt]{article}
\input{/mnt/repositories/latex/latex-my/imports/latex-doc/headers_begin.tex}
\setlang{en}
\renewcommand{\docOwner}{owner}
\renewcommand{\docDate}{TODAY}
\renewcommand{\docVersion}{version}
\renewcommand{\docEmail}{email}
\renewcommand{\docTitle}{title}
\newcommand{\docAuthors}{authors}
\renewcommand{\docCopyright}{2016-2017}
\renewcommand{\docListingFont}{dejavu}
\renewcommand{\structnextlength}{\shortnext}
\renewcommand{\tocWithContents}{book}
\renewcommand{\tocWithTables}{simple}
\renewcommand{\tocWithFigures}{simple}
\renewcommand{\tocWithListings}{book}
\renewcommand{\tocWithInject}{book}
\renewcommand{\tocWithInjectAck}{book}
\renewcommand{\tocWithInjectSummary}{book}
\renewcommand{\tocWithTitle}{blank}
\renewcommand{\tocWithSpace}{book}
\renewcommand{\headersLayout}{normal}
\renewcommand{\docHeader}{header}
\renewcommand{\snippets}{styled}
\input{/mnt/repositories/latex/latex-my/imports/latex-doc/headers_end.tex}
\begin{document}
\setlang{en}
\begin{primary}[Introduction]{Introduction}
\label{sec-4}
\phantomsection
The introduction.
\end{primary}\clearpage
\end{document}
这取决于我是否设置了 \setLang{en} 或 \setLang{es},我会收到两个不同的错误:
使用 \setLang{en}
❯ pdflatex semi.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Arch Linux) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./semi.tex
LaTeX2e <2016/03/31> patch level 3
... I need to cut some lines because of stackexchange limits...
(/usr/share/texmf-dist/tex/latex/eso-pic/eso-pic.sty)
(/usr/share/texmf-dist/tex/latex/pdfpages/pppdftex.def)))
Package csquotes Warning: Load 'inputenc' before 'csquotes' on input line 26.
(./semi.aux) (/usr/share/texmf-dist/tex/latex/pxfonts/omlpxmi.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/omspxsy.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/omxpxex.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/upxexa.fd)
(/usr/share/texmf-dist/tex/latex/base/ts1cmr.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/t1pxr.fd)
(/usr/share/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texmf-dist/tex/latex/oberdiek/grfext.sty)
(/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(/usr/share/texmf-dist/tex/latex/ucs/ucsencs.def)
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
ABD: EveryShipout initializing macros
(/usr/share/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))
(/usr/share/texmf-dist/tex/generic/oberdiek/se-pdfdoc.def)
(/usr/share/texmf-dist/tex/generic/oberdiek/se-utf8.def)
(/usr/share/texmf-dist/tex/latex/fmtcount/fc-spanish.def)
! Undefined control sequence.
\fc@orddef@ult #1->\fc@textsuperscript
{#1}
l.26 \begin{document}
? q
OK, entering \batchmode%
使用 \setLang{es}
❯ pdflatex semi.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Arch Linux) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./semi.tex
LaTeX2e <2016/03/31> patch level 3
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size12.clo))
(/mnt/repositories/latex/latex-my/imports/latex-doc/headers_begin.tex
(/usr/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
... I need to cut some lines because of stackexchange limits...
) (/usr/share/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texmf-dist/tex/latex/oberdiek/grfext.sty)
(/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(/usr/share/texmf-dist/tex/latex/ucs/ucsencs.def)
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
ABD: EveryShipout initializing macros
(/usr/share/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))
(/usr/share/texmf-dist/tex/generic/oberdiek/se-pdfdoc.def)
(/usr/share/texmf-dist/tex/generic/oberdiek/se-utf8.def)
(/usr/share/texmf-dist/tex/latex/pxfonts/ot1pxr.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/upxmia.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/upxsya.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/upxsyb.fd)
(/usr/share/texmf-dist/tex/latex/pxfonts/upxsyc.fd)
! Missing \endcsname inserted.
<to be read again>
\<let>-command
l.26 \begin{document}
有什么线索可以调试此处的错误吗?从输出/日志/错误消息中可以猜到吗?我对这种类型的调试信息完全一头雾水。
我尝试对遗留库中的某些“\input”进行注释,但有些部分与其他部分相关,“删除部分”非常困难。
是否有任何类型的回溯机制来查找我的库中在开头产生此错误的原始行?或者至少是包(amsmath 等)。
更新 07/04/2017
更多信息请参见\tracingall
(最后几行):
\@empty ->
{\noexpand}
\@gobble #1->
#1<-\getrefbykeydefault {##1}{}{??}
\def #1#2{->\<def>-command \expandafter \noexpand \csname \expandafter \@gobble
\string #1\@empty \endcsname \@gobble {
#1<-\pageref
#2<-##1
{\expandafter}
{\csname}
{\expandafter}
{\string}
\@gobble #1->
#1<-\
\@empty ->
{\noexpand}
\@gobble #1->
#1<-\getrefbykeydefault {##1}{page}{0}
\NROrg@ifthenelse #1#2#3->\let \bbl@temp@pref \pageref \let \pageref \org@pager
ef \let \bbl@temp@ref \ref \let \ref \org@ref \@safe@activestrue \org@ifthenels
e {#1}{\let \pageref \bbl@temp@pref \let \ref \bbl@temp@ref \@safe@activesfalse
#2}{\let \pageref \bbl@temp@pref \let \ref \bbl@temp@ref \@safe@activesfalse #
3}
#1<-\equal {\docSubtitle }{}
#2<- \large {\ }\\
#3<- \large {\docSubtitle }\\
\let #1->\expandafter \expandafter \expandafter \HyPsd@@LetCommand \expandafter
\expandafter \expandafter {\expandafter \@gobble \string #1\@empty }
#1<-\bbl@temp@pref
{\expandafter}
{\expandafter}
{\expandafter}
{\expandafter}
{\expandafter}
{\string}
{\expandafter}
{\expandafter}
\@gobble #1->
#1<-\
\HyPsd@@LetCommand #1->\expandafter \ifx \csname #1\expandafter \endcsname \csn
ame iftrue\endcsname \pdfstringdefWarn \let \expandafter \@gobble \else \expand
after \ifx \csname #1\expandafter \endcsname \csname iffalse\endcsname \pdfstri
ngdefWarn \let \expandafter \expandafter \expandafter \@gobble \else \<let>-com
mand \expandafter \noexpand \csname #1\expandafter \expandafter \expandafter \e
ndcsname \fi \fi
#1<-bbl@temp@pref\@empty
{\expandafter}
{\csname}
\@empty ->
{\expandafter}
{\csname}
{changing \bbl@temp@pref=undefined}
{into \bbl@temp@pref=\relax}
{\ifx: (level 5) entered on line 27}
{false}
{\else: \ifx (level 5) entered on line 27}
{\expandafter}
{\csname}
\@empty ->
{\expandafter}
{\csname}
{\ifx: (level 6) entered on line 27}
{false}
{\else: \ifx (level 6) entered on line 27}
{\expandafter}
{\csname}
\@empty ->
{\expandafter}
{\expandafter}
{\fi: \ifx (level 6) entered on line 27}
{\expandafter}
{\fi: \ifx (level 5) entered on line 27}
{\noexpand}
\pageref #1->\HyPsd@@pageref #1*\END
#1<-\let
\HyPsd@@pageref #1*#2\END ->\ifx \\#2\\\HyPsd@@@pageref {#1}\else \expandafter
\HyPsd@@@pageref \fi
#1<-\let
#2<-
{\ifx: (level 5) entered on line 27}
{true}
\HyPsd@@@pageref #1->\expandafter \ifx \csname r@#1\endcsname \relax ??\else \e
xpandafter \expandafter \expandafter \expandafter \expandafter \expandafter \ex
pandafter \@car \expandafter \expandafter \expandafter \@gobble \csname r@#1\en
dcsname {}\@nil \fi
#1<-\let
{\expandafter}
{\csname}
\let #1->\expandafter \expandafter \expandafter \HyPsd@@LetCommand \expandafter
\expandafter \expandafter {\expandafter \@gobble \string #1\@empty }
#1<-\endcsname
{\expandafter}
{\expandafter}
{\expandafter}
{\expandafter}
{\expandafter}
{\string}
{\expandafter}
{\expandafter}
\@gobble #1->
#1<-\
\HyPsd@@LetCommand #1->\expandafter \ifx \csname #1\expandafter \endcsname \csn
ame iftrue\endcsname \pdfstringdefWarn \let \expandafter \@gobble \else \expand
after \ifx \csname #1\expandafter \endcsname \csname iffalse\endcsname \pdfstri
ngdefWarn \let \expandafter \expandafter \expandafter \@gobble \else \<let>-com
mand \expandafter \noexpand \csname #1\expandafter \expandafter \expandafter \e
ndcsname \fi \fi
#1<-endcsname\@empty
{\expandafter}
{\csname}
\@empty ->
{\expandafter}
{\csname}
{\ifx: (level 6) entered on line 27}
{false}
{\else: \ifx (level 6) entered on line 27}
{\expandafter}
{\csname}
\@empty ->
{\expandafter}
{\csname}
{\ifx: (level 7) entered on line 27}
{false}
{\else: \ifx (level 7) entered on line 27}
! Missing \endcsname inserted.
<to be read again>
\<let>-command
\HyPsd@@LetCommand ...gobble \else \<let>-command
\expandafter \noexpand \cs...
\HyPsd@@@pageref ...r \ifx \csname r@#1\endcsname
\relax ??\else \expandafte...
\HyPsd@@pageref ...ifx \\#2\\\HyPsd@@@pageref {#1}
\else \expandafter \HyPsd@...
\NROrg@ifthenelse ...\bbl@temp@pref \pageref \let
\pageref \org@pageref \let...
\@title ...ge {\ }\\ }{ \large {\docSubtitle }\\ }
\vspace {0.1in} \ifthenel...
\pdfstringdef ... \HyPsd@LetCommand \Hy@temp #1{#2
}\endgroup \ifx #1\@empty ...
\KVS@ProcessorDefault ...e KV@#1@#2\endcsname {#3}
\fi \fi
\KVS@Parse ...#1}{}{\KVS@Process #1=\KVS@Nil {#3}}
\KVS@MaybeBreak \KVS@IfEmp...
<argument> ...se \hypersetup {pdftitle={\@title }}
\fi \fi \ifx \@pdfauthor \...
\@firstoftwo #1#2->#1
\@begindocumenthook ... be\MessageBreak disabled}}
\ifx \ttl@Hy@steplink \@un...
\document ...ent \@firstofone \@begindocumenthook
\ifdim \topskip <1sp\globa...
l.27 \begin{document}
我上传了旧版 + 最小文件 ( pdflatex testit.tex
)。我需要删除很多东西,重命名图像......花了将近一个半小时,但我希望它能有所帮助。只需将两者替换\setLang{es}
为\setLang{en}
即可查看其他错误。上传到这里:盒子测试.zip。
答案1
我发布这个部分答案是因为评论中的讨论相当长。
首先,我要指出的是,要简化 OP 提供的示例非常困难。这是文档模板复杂造成的问题。现在,我安装 TeXLive2015 时,文档可以正常工作,但 2016 不行。这两个版本都安装在 Mac 上(这可能无关紧要),版本如下:
3.14159265-2.6-1.40.17 (TeX Live 2016)
和
3.14159265-2.6-1.40.16 (TeX Live 2015)
使用en
作为参数\setLang
(并使用 TeXLive2016),我收到错误
! Undefined control sequence.
\fc@orddef@ult #1->\fc@textsuperscript
我认为这与fcprefix
我认为这与fmtcount 包。但是,2015 和 2016 发行版中的相关文件似乎相同。在接近结尾处fmtcount.sty
,我发现了以下内容:
\AtBeginDocument{%
\ifcsundef{FBsupR}{\let\fc@textsuperscript\textsuperscript}{\let\fc@textsuperscript\fup}%
}
鉴于错误,我尝试添加
\makeatletter
\let\fc@textsuperscript\textsuperscript
\makeatother
OP 的序言。这产生了一个不同的错误:
! Missing \endcsname inserted.
<to be read again>
\<let>-command
l.32 \begin{document}
我会离线几天,回来后会再看一遍。与此同时,如果有人能对此有所启发,请随时编辑上述内容。
编辑
可能值得注意的是,我机器上的 TeXLive2015 安装可能是在其发布时设置的,因此在其生命周期内对发行版的更改将意味着新下载将包含一些更新的文件。原帖者无法让文档与 TL2015 兼容,因此可能值得尝试 TL2014。