我想將我的舊 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}
如果您不想更改宏,避免錯誤的簡單方法是不在-
label、ref 和 cite 參數中使用。