Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I added something like this to my tex document:

\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}

where I forgot to close the \caption line. I called pdflatex and it balked. So I added the closing brace and saved, but still got the same error. So I enclosed the above in \iffalse \fi and the error persisted. I removed it, saved, and still got the error! Lastly, I tried deleting all the *.aux *.bbl *.blg *.lof *.lot *.log *.toc files then calling pdflatex again. That worked. Turns out it is only necessary to remove the .lof file.

The problem is, I keep getting the error shown below and so every time I want to compile I have to delete all those log files etc. The real problem is that I need to get references to work so I have to call it several times in a row. But I got it to work by removing the list of figures (.lof) at the end of every pdflatex call. Here's the bash script:

#!/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

Any idea what's wrong here with the lof? I've posted the error message below and here are lines 12--14 of the lof.

\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}

Edit: I added a table to the file and now I'm having problems with the .lot file. I can delete it before pdflatex and things work fine but otherwise I get this error message:

[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}

Here's line 1 from mqmThesis.lot

\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}
share|improve this question
1  
Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format. You might like to use the back ticks ` and the {} button to mark-up your code :) –  cmhughes Jun 9 '13 at 20:33
    
Thanks for cleaning it up and pointing me to the guide. –  thehandoftheking Jun 9 '13 at 20:36
1  
Can you add the lines 12 to 14 in the .lof file? Try also \protect\sstext; I don't know what class or package provides it, but this seems a problem related to a fragile command in \caption. –  egreg Jun 9 '13 at 20:37
2  
In your line \caption{$\bar{e}_{\sstext{check}}$ using either high-cost or low-cost cameras seems for me to be an error: Should the string using either high-cost or low-cost cameras be part of the caption or is a comment sign here missing? If it should be part of the caption please move the closing } at the end of the string ... The $has to be inside the brackets! –  Kurt Jun 9 '13 at 23:53
    
Yes, @Kurt, that is what broke it in the first place. But even after I fixed it I had problems with the .lof. Now I added a table and I'm having the same problems with the .lot. I have to delete both of them before pdflatex will compile. –  thehandoftheking Jun 10 '13 at 0:49

1 Answer 1

The problem here comes down to the use of

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

inside a \caption, where \sstext is defined as

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

(information collected up from comments).

This happens because as defined \sstext is LaTeX 'fragile': not suitable for use in 'moving' arguments such as captions without precautions. There are at least three possible solutions. First, you can use \protect to make an individual use of \sstext 'safe':

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

Secondly, you could make \sstext a robust command using

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

rather than \newcommand, and then don't need to do anything in the caption. (This used to be 'expensive' in memory terms, so was used rarely, but nowadays can be used without too many worries.)

Finally, you could simply use \mathrm here rather than \text..., as the material at least appears to be mathematical rather than text:

\documentclass{article}
\begin{document}
\listoffigures
\begin{figure}
\caption{$\bar{e}_{\mathrm{check}}$}
\end{figure}
\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.