61

I have searched the stackexchange for a resolution of this problem, but I am still getting an error message when I put in the following (for now neglecting other things in my document, such as documentclass, begin{document}, etc.):

\begin{frame}
\frametitle{explanation}
\begin{columns}
\begin{column}{width=0.5\textwidth}
   some text here
\end{column}
\begin{column}
    \begin{center}
     \includegraphics[width=0.5\textwidth]{image1.jpg}      
     \end{center}
\end{column}
\end{columns}
\end{frame}

When compiled, I get the error: Missing number, treated as zero. I should appreciate any help.

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Feb 15 '15 at 16:02
  • 2
    You don't need to use width=, you just enter the width directly. – tparker Dec 4 '17 at 6:04
94

You forgot to give the mandatory width to the second column.

\documentclass[demo]{beamer}
\begin{document}
  \begin{frame}
\frametitle{explanation}
\begin{columns}
\begin{column}{0.5\textwidth}
   some text here some text here some text here some text here some text here
\end{column}
\begin{column}{0.5\textwidth}  %%<--- here
    \begin{center}
     \includegraphics[width=0.5\textwidth]{image1.jpg}
     \end{center}
\end{column}
\end{columns}
\end{frame}
\end{document}

enter image description here

2

Also note that the graphics need not be scaled down as much in the second column. The column becomes a minipage, so \textwidth is already adjusted to its width.

\documentclass[demo]{beamer}
\begin{document}
  \begin{frame}
\frametitle{explanation}
\begin{columns}
\begin{column}{0.5\textwidth}
   some text here some text here some text here some text here some text here
\end{column}
\begin{column}{0.5\textwidth}  
    \begin{center}
     %%%%% this is a minipage, so \textwidth is already adjusted to the size of the column
     \includegraphics[width=\textwidth]{image1.jpg}
     \end{center}
\end{column}
\end{columns}
\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.