2

I get this coompilation error:

No file texto-10.nav.
<Valoresparametros.jpg, id=13, 683.55376pt x 356.83313pt>
(c:/texlive/2015/texmf-dist/tex/latex/lm/t1lmtt.fd)

! You can't use `\unskip' in vertical mode.

\reset@color ...mer@zeropt \else \ifvmode \unskip 

                                                  \fi \ifhmode \unskip \fi \...
l.32   \caption{Valores Sugeridos}

? 

This is the code I'm using.

Where is the error?

\documentclass[draft]{beamer}



\usepackage{beamerthemeshadow}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath,amssymb}
\usepackage{comment}
\usepackage[figurename=Fig]{caption}
\usepackage{amsfonts}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\usepackage{float}
\usepackage{array}

\usepackage{mathpazo}
\usepackage{verbatim}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{xcolor}


\usepackage[T1]{fontenc}
\usepackage{lmodern}


\begin{document}


\begin{figure}[t]
\includegraphics[height=1in,width=4.1in]{Valoresparametros}
  \caption{Valores Sugeridos}
  \label{valpar}
\end{figure}

\end{document}

1 Answer 1

3

I can't find a reference for the figurename option in the manual of caption.

\documentclass{beamer}
\usepackage{beamerthemeshadow}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}


\usepackage{comment}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}

\usepackage{array}
\usepackage{verbatim}
\usepackage{listings}

% loading both the following packages doesn't make sense
%\usepackage{mathpazo}
\usepackage{lmodern}

\addto\captionsspanish{\renewcommand{\figurename}{Fig}}

\begin{document}

\begin{frame}
\frametitle{A figure}

\begin{figure}
\includegraphics[height=1in,width=4.1in]{example-image}
\caption{Valores Sugeridos}\label{valpar}
\end{figure}

\end{frame}

\end{document}

I removed packages that are useless either because they're already loaded by beamer or they do nothing interesting (float). Using \addto\captionsspanish is the correct way for changing the label.

Note that it makes no sense to load mathpazo along with lmodern: you'd get math in Palatino and text in Computer Modern Sans.


On the other hand, I'm not sure (understatement for I'm certain) that floats make sense in beamer. First, as you can clearly see, figure captions are not numbered, so you can only reference them by the slide number, which will distract the audience: “As we saw in the figure four slides before…” is nothing I would like to hear during a talk. Nobody will remember the figure number anyway, so it makes little sense to number captions.

Just place the picture and add the explanation as text.

5
  • Hi @egreg It still dont work for me, the error appear once again, I have already add in the code "\addto\captionsspanish{\renewcommand{\figurename}{Fig}}" but the error is appearing again. The command \mathpazo was for using the \pm command
    – JuanMuñoz
    Commented Oct 6, 2016 at 22:17
  • @JuanMuñoz \pm is defined by the LaTeX kernel and doesn't require any additional package. I get no error from my code. Did you remove figurename=Fig?
    – egreg
    Commented Oct 6, 2016 at 22:30
  • @egreg figurename=Fig was outsourced to the newfloat package but can still be used with caption for backward-compatibility reasons. (The caption package loads the newfloat package automatically when using this option and passes it on to newfloat.)
    – user2574
    Commented Oct 7, 2016 at 6:01
  • @AxelSommerfeldt Nice to know, but its usage with babel seems dubious nonetheless
    – egreg
    Commented Oct 7, 2016 at 8:08
  • @egreg If babel is loaded the newfloat package will use it. (But I agree, for this task neither caption not newfloat is needed.)
    – user2574
    Commented Oct 7, 2016 at 11:39

You must log in to answer this question.

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