この \discretionary エラーの原因は何ですか?

この \discretionary エラーの原因は何ですか?

古い LaTeX 論文を PDF にコンパイルしたいと思います。テキストは 1999 年に作成されました (emTeX だったと思います)。当時はコンピューターとツールが少し違っていました。読んでみてください。14 年ぶりに LaTeX に戻ってきました。すべてを忘れるには十分な時間です :) 当時はチェコ語にバベルは使用されていませんでした。

これまで、(何度か試行錯誤し、記憶から情報を掘り起こし、少し検索した後)ソースをUTF-8に変換し、

\documentclass[a4paper,11pt]{report}
\usepackage{czech}

\documentclass[a4paper,11pt]{report}
\usepackage[czech]{babel}
\usepackage[utf8]{inputenc}

pdflatex --versionWindows 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 引数を使用しないことです。

関連情報