我想将我以前的 LaTeX 论文编译为 PDF。这篇论文写于 1999 年(我认为是 emTeX),当时的计算机和工具都有些不同——读一读吧,14 年后我又回到了 LaTeX;这段时间足以让我忘记一切 :) 当时 babel 还没有用于捷克语。
到目前为止,(经过多次尝试/失败,从我的记忆中挖掘信息,并进行了一些搜索)我已经将源转换为 UTF-8,并更改了
\documentclass[a4paper,11pt]{report}
\usepackage{czech}
到
\documentclass[a4paper,11pt]{report}
\usepackage[czech]{babel}
\usepackage[utf8]{inputenc}
pdflatex --version
在 Windows 7 上执行以下操作时
pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/W32TeX)
kpathsea version 6.1.1
Copyright 2013 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.5.16; using libpng 1.5.16
Compiled with zlib 1.2.7; using zlib 1.2.7
Compiled with xpdf version 3.03
(并对 my.aux 文件运行 bibtex,并重新运行几次pdflatex pri98dis.tex
,我仍然得到以下报告的问题:
) [141] (./pri98dis.aux (./dekuji.aux) (./abstrakt.aux)
! Missing \endcsname inserted.
<to be read again>
\unhbox
l.223 ...`\discretionary {-}{}{}step}{{3.1.5}{52}}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Improper alphabetic constant.
<to be read again>
\discretionary
l.223 ...`\discretionary {-}{}{}step}{{3.1.5}{52}}
A one-character control sequence belongs after a ` mark.
So I'm essentially inserting \0 here.
! Extra \endcsname.
\@newl@bel ... \bbl@tempa \csname #1@#2\endcsname
\def \bbl@tempb {#3}\@safe...
l.223 ...`\discretionary {-}{}{}step}{{3.1.5}{52}}
I'm ignoring this, since I wasn't doing a \csname.
)
LaTeX Warning: There were undefined references.
LaTeX Warning: There were multiply-defined labels.
这[141]
是文件的最后一页。(请注意! Missing \endcsname inserted.
和后面的! Extra \endcsname.
)
在pri98dis.aux
(属于主文档)中,第 222 行和第 223 行如下所示:
\@writefile{toc}{\contentsline {paragraph}{Krok modelov\IeC {\'e}ho \IeC {\v c}asu.}{52}}
\newlabel{time\unhbox \voidb@x \kern \z@ \char `\discretionary {-}{}{}step}{{3.1.5}{52}}
看起来它属于源的以下部分:
\paragraph{Krok modelového času.}
... text of one paragraph...
\begin{verbatim}
in('EvQue', 'head', ?head_time); { 1 }
in('EvQue', 'list', head_time, ?next_time); { 2 }
out('EvQue', 'head', next_time); { 3 }
\end{verbatim}
\label{time-step}
看来该问题在某种程度上是由 引起的\label{time-step}
。
我该如何解决这个问题?
(谢谢,并祝您新年快乐,万事如意。)
答案1
这很可能是由于一个包(babel 语言简写?)定义-
为活动包,然后尝试通过将其定义为“正常”来使其运行
\leavevmode\char`\-
我得到了几乎相同的错误(上下文略有不同,但相同
time\unhbox \voidb@x \char `\discretionary {-}{}{}step
从以下内容:
\documentclass{article}
\catcode`\-\active
\def-{\leavevmode\char`\-}
\begin{document}
aa \section{zzz\label{time-step}} aa
zzz\ref{time-step}
\end{document}
如果您不想更改宏,避免错误的简单方法是不要使用-
标签、参考和引用参数。