2

I'm writing my thesis in latex, and I've included some figures and some labels with character _ in the name. Now that i'm adding \listoffigures, i find some errors with missing $ inserted.

How can I solve this problem and add my list of figures, without changing every underscore character?

EDIT

Problem is soved without this figure:

\begin{figure}[t]
    \centering
    \subfigure[$\mathrm{RMSE}$]
   {
   \label{fig:cfrcovar1}
    \includegraphics[width=0.46\textwidth]{Immagini/Confronto_metodi_covar.png}   
   }
    \subfigure[Stime $\hat{\beta}$]
   {
   \label{fig:cfrcovar2}
    \includegraphics[width=0.46\textwidth]{Immagini/Confronto_metodi_beta.png}
   }
    \caption{Confronto tra i metodi, caso con covariate}
    \label{fig:cfrcovar}
\end{figure}

something wrong about it?

9
  • 2
    Figure captions with _ are not okay. Figure file names with _ are okay. Labels with _ are also okay.
    – Werner
    Commented Mar 18, 2015 at 17:07
  • My underscore characters are all in file/folder names and labels, not in captions. So what is the problem? Maybe some other characters?
    – Darko
    Commented Mar 18, 2015 at 17:14
  • 1
    @Darko: You should show us a small example which fails, everything else would be doing wild guessing around
    – user31729
    Commented Mar 18, 2015 at 17:22
  • Maybe. It's all just guess-work. Before moving on, delete all .aux, .toc, .lof and .lot files and recompile a couple of times. If the problem persists, please post a minimal working example (MWE) so we can replicate the problem.
    – Werner
    Commented Mar 18, 2015 at 17:22
  • i've edited the figure with the error
    – Darko
    Commented Mar 18, 2015 at 17:24

1 Answer 1

3

The problem is due to the line

\caption{Per alcuni istanti di tempo, funzione test $f(\underline p,t)$ reale, dati 
simulati, stime ottenute rispettivamente con GAMM con soap film smoothing, GAMM con thin 
plate splines e stima con STR-PDE nel caso con covariata.}

First of all, you should write \underline{p} and not \underline p since \underline takes an argument.

Moreover, since you are using it in a \caption it needs to be \protected, otherwise its meaning is expanded in the .lof file.

In other words, you have to write

$f(\protect\underline{p},t)$

instead of

$f(\underline p,t)$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .