LaTeX forum ⇒ Articles, Essays, and Journal TemplatesCan´t add figures to the document Topic is solved

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

Can´t add figures to the document

Postby gape01 » Fri Jun 09, 2017 2:11 am

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

  1. \begin{figure*}
  2. \begin{center}
  3. \caption{this is a caption} \label{exemple_01}
  4. \includegraphics[scale=0.3]{exemple_01.png}
  5. \end{center}
  6. \end{figure*}


but it does not work. Can anyone help me?
The error message is:

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

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3803
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Jun 09, 2017 7:03 am

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: 8979
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Fri Jun 09, 2017 11:40 am

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

  1. \begin{figure*}
  2. \centering
  3. \caption{this is a caption} \label{exemple_01}
  4. \includegraphics[scale=0.3]{exemple_01.png}
  5. \end{figure*}


The effect of \centering is limited by the figure environment, so centering stops with \end{figure*}.

Stefan
Site admin

gape01
Posts: 4
Joined: Fri Jun 09, 2017 2:02 am

Postby gape01 » Wed Jun 14, 2017 5:47 pm

Thank you very much. It worked perfectly


Return to “Articles, Essays, and Journal Templates”

Who is online

Users browsing this forum: No registered users and 1 guest