0

I am trying to generate a sequence of frames conatining an image each. Overleaf gives the following error, which I cannot interpret. The command works properly in other slides where I also inserted text

Missing number, treated as zero.

<to be read again> 
                   ]
l.145 \end{frame}

A number should have been here; I inserted `0'. 

And here is my code, which should be testable

\documentclass[10pt,xcolor={table,dvipsnames},t]{beamer}
\usetheme{UCBerkeley}
\newtheorem{myth}{Theorem}[section]
\newtheorem{myprop}{Proposition}[section]
\usepackage{graphicx}
\usepackage{wrapfig}

\begin{document}

\begin{frame}
\begin{figure}
    \includegraphics{sperner_graph_1.PNG}[width=0.33\linewidth]
\end{figure}
\end{frame}

\begin{frame}
\begin{figure}
    \includegraphics{sperner_graph_2.PNG}[width=0.33\linewidth]
\end{figure}
\end{frame}
\begin{document}

\begin{frame}
\begin{figure}
    \includegraphics{sperner_graph_3.PNG}[width=0.33\linewidth]
\end{figure}
\end{frame}

\begin{frame}
\begin{figure}
    \includegraphics{sperner_graph_4.PNG}[width=0.33\linewidth]
\end{figure}
\end{frame}

\end{document}
  • The optional argument is in the wrong place. It should be directly after includegraphics. – Ulrike Fischer Jul 14 at 8:35
  • @UlrikeFischer This is also true for \newtheorem. – user121799 Jul 14 at 8:37
1

You systematically misplace the optional argument, both in \newtheorem and in \includegraphics, i.e. the argument in square brackets. That is,

\newtheorem{myth}{Theorem}[section]

needs to become

\newtheorem{myth}[section]{Theorem}

and

 \includegraphics{sperner_graph_1.PNG}[width=0.33\linewidth]

has to be

  \includegraphics[width=0.33\linewidth]{sperner_graph_1.PNG}

Unfortunately I do not have the Berkeley theme, and not your graphics but the following works:

\documentclass[10pt,xcolor={table,dvipsnames},t]{beamer}
%\usetheme{UCBerkeley}
\newtheorem{myth}[section]{Theorem}
\newtheorem{myprop}[section]{Proposition}

\begin{document}

\begin{frame}
\begin{figure}
    \includegraphics[width=0.33\linewidth]{example-image-a}
\end{figure}
\end{frame}

\begin{frame}
\begin{figure}
    \includegraphics[width=0.33\linewidth]{example-image-b}
\end{figure}
\end{frame}

\begin{frame}
\begin{figure}
    \includegraphics[width=0.33\linewidth]{example-image-c}
\end{figure}
\end{frame}

\begin{frame}
\begin{figure}
    \includegraphics[width=0.33\linewidth]{example-image-duck}
\end{figure}
\end{frame}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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