Articles, Essays, and Journal TemplatesCan´t add figures to the document

IEEE, Elsevier, ACM, ACE, Science, AGU, PNAS, PLOS, RSoC, Springer, Stylish articles and Essays
Post Reply
gape01
Posts: 4
Joined: Fri Jun 09, 2017 2:02 am

Can´t add figures to the document

Post by gape01 »

Hi, I´m trying to add figures using the following code:

Code: Select all

\begin{figure*}
 	\begin{center}
 	  \caption{this is a caption}  \label{exemple_01}
 	  \includegraphics[scale=0.3]{exemple_01.png}
 	\end{center}
 \end{figure*}
but it does not work. Can anyone help me?
The error message is:

Code: Select all

! Undefined control sequence.
l.325  	  \includegraphics
                          [scale=0.3]{exemplo_01.png}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Can´t add figures to the document

Post by Johannes_B »

You have to load package graphicx.

Also avoid the center environment and use \centering instead.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Can´t add figures to the document

Post by Stefan Kottwitz »

Welcome to the forum!

To concretize what Johannes said, add \usepackage{graphicx} to the preamble of your document.

And regarding \centering, the correct way is

Code: Select all

\begin{figure*}
\centering
\caption{this is a caption} \label{exemple_01}
\includegraphics[scale=0.3]{exemple_01.png}
\end{figure*}
The effect of \centering is limited by the figure environment, so centering stops with \end{figure*}.

Stefan
LaTeX.org admin
gape01
Posts: 4
Joined: Fri Jun 09, 2017 2:02 am

Can´t add figures to the document

Post by gape01 »

Thank you very much. It worked perfectly
Post Reply