pdflatex 退出编译 — 删除了有问题的代码,但仍然出现 .lof 错误

pdflatex 退出编译 — 删除了有问题的代码,但仍然出现 .lof 错误

我在我的 tex 文档中添加了类似这样的内容:

\begin{figure}%[!htbp]
\begin{center}
\iftoggle{isPrintingBigPictures} {
  \includegraphics[width=1\textwidth]{images/simResults/hiLo/hiLoDynamic.png}
} {
  \includegraphics[width=.25\textwidth]{images/placeholder.jpg}
}
\end{center}
\caption{$\bar{e}_{\sstext{check}}$ using either high-cost or low-cost cameras
\label{fig:hiLoDynamic}
\end{figure}

我忘了关闭\caption行。我打电话pdflatex,它却不响应。所以我添加了右括号并保存,但仍然出现相同的错误。所以我将上面的内容括起来\iffalse \fi,错误仍然存​​在。我删除了它,保存了,但仍然出现错误!最后,我尝试删除所有文件,*.aux *.bbl *.blg *.lof *.lot *.log *.toc然后pdflatex再次拨打电话。成功了。结果发现只需要删除文件即可.lof

问题是,我不断收到如下所示的错误,因此每次我想编译时,我都必须删除所有这些日志文件等。真正的问题是我需要让引用工作,所以我必须连续多次调用它。但我通过在.lof每次调用结束时删除数字列表 ( )来让它工作pdflatex。这是 bash 脚本:

#!/bin/sh -e
mkdir toBeDeleted

# get rid of list of figures (lof)
mv *.lof toBeDeleted

# initial latex and get rid of lof
pdflatex mqmThesis.tex
mv *.lof toBeDeleted

# make bibliography
bibtex mqmThesis.aux

# this is probably unnecessary?
mv *.lof toBeDeleted

# twice more
pdflatex mqmThesis.tex
mv *.lof toBeDeleted
pdflatex mqmThesis.tex
mv *.lof toBeDeleted

# clean up
rm -r toBeDeleted

知道 lof 出了什么问题吗?我已将错误消息发布在下面,以下是 lof 的第 12-14 行。

\contentsline {figure}{\numberline {12}{\ignorespaces Simulation image data of a static target acquired by the high-cost camera model (left) and the low-cost model (right) taken from the same position}}{82}
\contentsline {figure}{\numberline {13}{\ignorespaces $\mathaccentV {bar}016{e}_{\textnormal {\let \relax \fontsize {10.95}{13.6}\selectfont \abovedisplayskip 11\p@ plus3\p@ minus6\p@ \abovedisplayshortskip \z@ plus3\p@ \belowdisplayshortskip 6.5\p@ plus3.5\p@ minus3\p@ \belowdisplayskip \abovedisplayskip \let \leftmargin \leftmargini \parsep 4.5\p@ plus2\p@ minus\p@ \topsep 9\p@ plus3\p@ minus5\p@ \itemsep 4.5\p@ plus2\p@ minus\p@ \leftmargin \leftmargini \parsep 4.5\p@ plus2\p@ minus\p@ \topsep 9\p@ plus3\p@ minus5\p@ \itemsep 4.5\p@ plus2\p@ minus\p@ =\relax \fontsize {8}{9.5}\selectfont \relax \fontsize {8}{9.5}\selectfont {check}},25,112}$ using either high-cost or low-cost cameras and different control laws ($Q = 5I$ for DAKF)}}{84}



This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
(./mqmThesis.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech, slov
ak, danish, dutch, finnish, french, basque, ngerman, german, german-x-2009-06-1
9, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian, san
skrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal, nyn
orsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto, uppersorbian
, estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish, po
rtuguese, spanish, galician, catalan, swedish, ukenglish, pinyin, loaded.
(/usr/share/texmf/tex/latex/gatech-thesis/gatech-thesis.cls
Document Class: gatech-thesis 2010/07/02 1.8 (Mitchel T. Keller)
(/usr/share/texmf-texlive/tex/latex/tools/calc.sty)
(/usr/share/texmf-texlive/tex/latex/base/report.cls
Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size11.clo))
(/usr/share/texmf/tex/latex/gatech-thesis/gatech-thesis-patch.sty
gatech-thesis-patch loaded
)) (/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty
(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty
(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty)
(/etc/texmf/tex/latex/config/graphics.cfg)
(/usr/share/texmf-texlive/tex/latex/pdftex-def/pdftex.def)))
(/usr/share/texmf-texlive/tex/latex/graphics/color.sty
(/etc/texmf/tex/latex/config/color.cfg))
(/usr/share/texmf-texlive/tex/latex/tools/bm.sty)
(/usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texmf-texlive/tex/latex/amsmath/amstext.sty
(/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty))
(/usr/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texmf-texlive/tex/latex/amsmath/amsopn.sty))
(/usr/share/texmf-texlive/tex/latex/amscls/amsthm.sty)
(/usr/share/texmf-texlive/tex/latex/amsfonts/eufrak.sty)
(/usr/share/texmf-texlive/tex/latex/mh/mathtools.sty
(/usr/share/texmf-texlive/tex/latex/mh/mhsetup.sty))
(/usr/share/texmf-texlive/tex/latex/mh/empheq.sty)
(/usr/share/texmf/tex/latex/etoolbox/etoolbox.sty
(/usr/share/texmf-texlive/tex/latex/etex-pkg/etex.sty))
(/usr/share/texmf-texlive/tex/latex/algorithms/algorithm.sty
(/usr/share/texmf-texlive/tex/latex/float/float.sty)
(/usr/share/texmf-texlive/tex/latex/base/ifthen.sty))
(/usr/share/texmf-texlive/tex/latex/algorithmicx/algpseudocode.sty
(/usr/share/texmf-texlive/tex/latex/algorithmicx/algorithmicx.sty
Document Style algorithmicx 1.2 - a greatly improved `algorithmic' style
)
Document Style - pseudocode environments for use with the `algorithmicx' style
) (./mqmThesis.aux) (/usr/share/texmf-texlive/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
)
Underfull \hbox (badness 10000) has occurred while \output is active


Underfull \hbox (badness 10000) has occurred while \output is active

[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
SIGNATURES: 5
LEFTCNT: 3 HALF: 3
***************** Dedication ******************

Underfull \hbox (badness 10000) has occurred while \output is active


Underfull \hbox (badness 10000) has occurred while \output is active

[2] (./mqmDedication.tex)
***************** Acknowledgements ******************
[3] (./mqmAck.tex) [4] (./mqmThesis.toc [5] [6]
Overfull \hbox (2.64603pt too wide) detected at line 100
\OT1/cmr/bx/n/10.95 VIII 
) [7] (./mqmThesis.lot) [8] (./mqmThesis.lof
! Missing number, treated as zero.
<to be read again> 
                   \protect 
l.13 ...ent control laws ($Q = 5I$ for DAKF)}}{84}

编辑:我向文件添加了一个表格,但现在文件出现了问题.lot。我可以在 pdflatex 之前将其删除,一切正常,但除此之外,我收到以下错误消息:

[4] (./mqmThesis.toc [5] [6]
Overfull \hbox (2.64603pt too wide) detected at line 103
\OT1/cmr/bx/n/10.95 VIII 
) [7] (./mqmThesis.lot
! Missing number, treated as zero.
<to be read again> 
                   \protect 
l.1 ...a scenarios and different controllers}}{88}

这是 mqmThesis.lot 中的第 1 行

\contentsline {table}{\numberline {1}{\ignorespaces $\mathaccentV {bar}016{e}_{\textnormal {\let \relax \fontsize {10.95}{13.6}\selectfont \abovedisplayskip 11\p@ plus3\p@ minus6\p@ \abovedisplayshortskip \z@ plus3\p@ \belowdisplayshortskip 6.5\p@ plus3.5\p@ minus3\p@ \belowdisplayskip \abovedisplayskip \let \leftmargin \leftmargini \parsep 4.5\p@ plus2\p@ minus\p@ \topsep 9\p@ plus3\p@ minus5\p@ \itemsep 4.5\p@ plus2\p@ minus\p@ \leftmargin \leftmargini \parsep 4.5\p@ plus2\p@ minus\p@ \topsep 9\p@ plus3\p@ minus5\p@ \itemsep 4.5\p@ plus2\p@ minus\p@ =\relax \fontsize {8}{9.5}\selectfont \relax \fontsize {8}{9.5}\selectfont {check}},T,112}$ for different camera scenarios and different controllers}}{88}

答案1

这里的问题归结为使用

$\bar{e}_{\sstext{check}}$

在 a 内\caption,其中\sstext定义为

\newcommand{\sstext}[1]{\textnormal{\scriptsize{#1}}}

(信息从评论中收集)。

发生这种情况的原因是,正如所定义的那样,\sstextLaTeX 是“脆弱的”:不适合在没有预防措施的情况下用于“移动”参数(例如标题)。至少有三种可能的解决方案。首先,您可以使用\protect来单独使用\sstext“安全”:

\caption{$\bar{e}_{\protect\sstext{check}}$}

其次,你可以\sstext使用以下命令来创建一个强大的命令

\DeclareRobustCommand{\sstext}[1]{\textnormal{\scriptsize{#1}}}

而不是\newcommand,然后就不需要在标题中执行任何操作了。(这在内存方面曾经是“昂贵的”,因此很少使用,但现在可以放心使用。)

最后,您可以简单地\mathrm在这里使用而不是\text...,因为材料至少看起来是数学的而不是文本:

\documentclass{article}
\begin{document}
\listoffigures
\begin{figure}
\caption{$\bar{e}_{\mathrm{check}}$}
\end{figure}
\end{document}

相关内容