0

Hello I am getting this error with a table of images.

\begin{figure}[h]
\centering
 \begin{tabular}{c c c c c}
         (a\includegraphics[scale=0.3]{A.jpg} & (b\includegraphics[scale=0.3]{B.jpg}  & (c\includegraphics[scale=0.3]{C.jpg}  & (d\includegraphics[scale=0.3]{D.jpg} & (e\includegraphics[scale=0.3]{E.jpg} 

         & (f\includegraphics[scale=0.3]{F.jpg} & (g\includegraphics[scale=0.3]{G.jpg} & (h\includegraphics[scale=0.3]{H.jpg} & (i\includegraphics[scale=0.3]{I.jpg}   & (j\includegraphics[scale=0.3]{J.jpg} 

        & (k\includegraphics[scale=0.3]{K.jpg} & (l\includegraphics[scale=0.3]{L.jpg} & (m\includegraphics[scale=0.3]{M.jpg} & (n\includegraphics[scale=0.3]{N.jpg} & (o\includegraphics[scale=0.3]{O.jpg} 

        & (p\includegraphics[scale=0.3]{P.jpg} & (q\includegraphics[scale=0.3]{Q.jpg} & (r\includegraphics[scale=0.3]{R.jpg} & (s\includegraphics[scale=0.3]{S.jpg} & (t\includegraphics[scale=0.3]{T.jpg} 

        & (u\includegraphics[scale=0.3]{U.jpg} 

    \end{tabular}
    \end{figure}

Note that currently I haven't put \ after each 5 images as when the file is compiled they are no longer in the grid. If I do put in \ the errors are still shown. How can I fix this?

Thanks

  • 1
    You forgot to use `\\` after the last column (i.e. the 5th column here) – user31729 Mar 15 '16 at 13:21
  • Hi If I do that the images come out jumbled instead of in a grid and I still get the error message – WERT Mar 15 '16 at 13:28
1

Those images aren't 'jumbled', but the (a... stuff is a little bit weird.

Anyway, after the 5th column a \tabularnewline or \\ must be maded!

\documentclass{article}

\usepackage[demo]{graphicx}

\begin{document}
\begin{figure}[ht]
\centering
 \begin{tabular}{*{5}{c}}
   (a\includegraphics[scale=0.3]{A.jpg} & (b\includegraphics[scale=0.3]{B.jpg}  & (c\includegraphics[scale=0.3]{C.jpg}  & (d\includegraphics[scale=0.3]{D.jpg} & (e\includegraphics[scale=0.3]{E.jpg}  \tabularnewline
   (f\includegraphics[scale=0.3]{F.jpg} & (g\includegraphics[scale=0.3]{G.jpg} & (h\includegraphics[scale=0.3]{H.jpg} & (i\includegraphics[scale=0.3]{I.jpg}   & (j\includegraphics[scale=0.3]{J.jpg} \tabularnewline

   (k\includegraphics[scale=0.3]{K.jpg} & (l\includegraphics[scale=0.3]{L.jpg} & (m\includegraphics[scale=0.3]{M.jpg} & (n\includegraphics[scale=0.3]{N.jpg} & (o\includegraphics[scale=0.3]{O.jpg} \tabularnewline

   (p\includegraphics[scale=0.3]{P.jpg} & (q\includegraphics[scale=0.3]{Q.jpg} & (r\includegraphics[scale=0.3]{R.jpg} & (s\includegraphics[scale=0.3]{S.jpg} & (t\includegraphics[scale=0.3]{T.jpg} \tabularnewline

   (u\includegraphics[scale=0.3]{U.jpg} \tabularnewline
 \end{tabular}
\end{figure}
\end{document}

Update

With \centering working here:

\documentclass{article}

\usepackage[demo]{graphicx}

\begin{document}
\begin{figure}[ht]
  \centering

  \begin{tabular}{*{5}{c}}
   (a\includegraphics[width=2cm,height=2cm]{A.jpg} & (b\includegraphics[width=2cm,height=2cm]{B.jpg}  & (c\includegraphics[width=2cm,height=2cm]{C.jpg}  & (d\includegraphics[width=2cm,height=2cm]{D.jpg} & (e\includegraphics[width=2cm,height=2cm]{E.jpg}  \tabularnewline
   (f\includegraphics[width=2cm,height=2cm]{F.jpg} & (g\includegraphics[width=2cm,height=2cm]{G.jpg} & (h\includegraphics[width=2cm,height=2cm]{H.jpg} & (i\includegraphics[width=2cm,height=2cm]{I.jpg}   & (j\includegraphics[width=2cm,height=2cm]{J.jpg} \tabularnewline

   (k\includegraphics[width=2cm,height=2cm]{K.jpg} & (l\includegraphics[width=2cm,height=2cm]{L.jpg} & (m\includegraphics[width=2cm,height=2cm]{M.jpg} & (n\includegraphics[width=2cm,height=2cm]{N.jpg} & (o\includegraphics[width=2cm,height=2cm]{O.jpg} \tabularnewline

   (p\includegraphics[width=2cm,height=2cm]{P.jpg} & (q\includegraphics[width=2cm,height=2cm]{Q.jpg} & (r\includegraphics[width=2cm,height=2cm]{R.jpg} & (s\includegraphics[width=2cm,height=2cm]{S.jpg} & (t\includegraphics[width=2cm,height=2cm]{T.jpg} \tabularnewline

   (u\includegraphics[width=2cm,height=2cm]{U.jpg} \tabularnewline
 \end{tabular}

\end{figure}
\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.