1

I have the following:

\documentclass[a0,portrait]{a0poster}
.....
\usepackage{graphics}
%\usepackage{graphicx}

....

\begin{figure}[H] 
\centerline{\hbox{
\includegraphics[width=0.6\linewidth]{fig_for_body/fig1_1.png}
\includegraphics[width=0.6\linewidth]{fig_for_body/fig1_2.png}
}} 
 \caption{(a) ...
 (b) ....
 }
\label{fig:....}
\end{figure}

And cursor shows the error says:

Argument of \Gin@iii has an extra }

Why I cannot add png or jpg? it is working with pdf. I tried graphicx but it does not work either!

4
  • 1
    The key value syntax is only supported by package graphicx, not graphics. Commented Jun 29, 2015 at 13:39
  • but i did try graphicx and it does not work as i said before
    – meva
    Commented Jun 29, 2015 at 13:40
  • Did you compile it with latex or pdflatex? The former does not support png and jpg.
    – crixstox
    Commented Jun 29, 2015 at 13:41
  • there is just latex option. How can i change it to pdflatex?
    – meva
    Commented Jun 29, 2015 at 13:44

1 Answer 1

4

The syntax with key value options:

\includegraphics[width=0.6\linewidth]{fig_for_body/fig1_1.png}

is added by package graphicx, therefore the package needs to be loaded:

\usepackage{graphicx}

Then it depends on the driver, which graphics types are supported. PNG is supporte by pdfTeX, thus it works with pdflatex.

In case of dvips, you can convert the PNG file to EPS, e.g. using ImageMagicks' convert.

Then it is convenient to omit the extension:

\includegraphics[width=0.6\linewidth]{fig_for_body/fig1_1}

Then pdflatex will find the .png file and latex/dvips will use the .eps file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .