GeneralLatex Graphics: Unable to place figure in Latex Doc

LaTeX specific issues not fitting into one of the other forums of this category.
pankaj
Posts: 11
Joined: Tue Sep 16, 2008 11:36 am

Latex Graphics: Unable to place figure in Latex Doc

Post by pankaj »

Hello All,

Can someone help me out regarding this:

i am using pdflatex to place a figure (in *.pdf, *.png, *.ps format) in my latex doc.
I included usepackage{graphicx} after documentclass.
To insert figure i used:
\begin{figure}
\begin{center}
\includepraphics{print}
\end{center}
\end{figure}

where "print" is the name of figure i want to place. I tried putting figure in *.pdf, *.png, *.ps but to no avail.
Error log is like:

! Undefined control sequence.
l.212 \includepraphics
{print}

i got no idea where m wrong.

Please help me in this regard.

Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

Latex Graphics: Unable to place figure in Latex Doc

Post by T3. »

pankaj wrote:! Undefined control sequence.
l.212 \includepraphics
{print}

i got no idea where m wrong.
You have a typo in the command name. It should be \includegraphics, not \includepraphics.

Cheers,

Tomek
pankaj
Posts: 11
Joined: Tue Sep 16, 2008 11:36 am

Re: Latex Graphics: Unable to place figure in Latex Doc

Post by pankaj »

Hi Tomek,

oops..lol

It is working!!

Thanks buddy....i spent around 2-3 hours on this!!

Now laughing on myself...

Thanks a lot anyways...
pankaj
Posts: 11
Joined: Tue Sep 16, 2008 11:36 am

Re: Latex Graphics: Unable to place figure in Latex Doc

Post by pankaj »

Hi All,

well i got another problem regarding same issue.

Only if my figure is in *.pdf format my latex doc gets compiled else it issues an error like "file not found"

I tried inserting figures in *.eps,*.png,*.jpeg but everytime it says File does not exist.
While if i save same figure as *.pdf file, latex doc gets compiled.

I included usepackage{graphicx} after documentclass.

To insert figure i used:

\begin{figure}
\begin{center}
\includegraphics{print}
\end{center}
\end{figure}

where "print" is the name of figure i want to place.

Thanks in advance.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Latex Graphics: Unable to place figure in Latex Doc

Post by Stefan Kottwitz »

Hi pankaj,

pdflatex supports inclusion of the formats pdf, png, jpg. It doesn't support eps, that's the only format supported by latex.
If inclusion of pdf works for you, png and jpg should work too. Just take care that you use the exact filename. Use jpg instead of jpeg.

Stefan
LaTeX.org admin
pankaj
Posts: 11
Joined: Tue Sep 16, 2008 11:36 am

Re: Latex Graphics: Unable to place figure in Latex Doc

Post by pankaj »

Hi Stefan,
Well here is that code m using:

\documentclass[a4paper, 11pt]{article}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{fullpage}
\usepackage{graphicx}
\textheight = 24cm
\date{}
\begin{document}

Some text n equations in between....

\begin{figure}
\begin{centering}
\includegraphics{figure}
\end{centering}
\end{figure}

Following error i get after compiling this:
! LaTeX Error: File `figure' not found.

file figure is in *.png format. When i put extension figure.png (which i think should not be done) following eror comes:

LaTeX Warning: File `figure.png' not found on input line 218.

Error: pdflatex (file figure.png): cannot find image file
==> Fatal error occurred, the output PDF file is not finished!

While same file when i print n save as *.pdf ...the document get compiled!!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Latex Graphics: Unable to place figure in Latex Doc

Post by Stefan Kottwitz »

Strange. Could you please post your logfile and the png file as attachment here?

Stefan
LaTeX.org admin
pankaj
Posts: 11
Joined: Tue Sep 16, 2008 11:36 am

Re: Latex Graphics: Unable to place figure in Latex Doc

Post by pankaj »

Hi Stefan,

well i have attached the log file but m not able to attach that PNG file....error tht this page gives on attaching png (and jpeg file of same stuff) file is "the extension is not allowed"

so the figure am attaching by converting *.png file to *.pdf file.

But when i compile my latex doc with this *.pdf file it works fine.

Thanks
Pankaj
Attachments
si.pdf
(24.31 KiB) Downloaded 333 times
transition.log
(8.68 KiB) Downloaded 426 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Latex Graphics: Unable to place figure in Latex Doc

Post by Stefan Kottwitz »

The png extension should be allowed. Be careful: you have written PNG in capital letters above, not with small letters. I's an important difference for the compiler. That's what I meant by "use the exact filename".
Perhaps zip the png file to attach it here if still necessary.

Stefan
LaTeX.org admin
pankaj
Posts: 11
Joined: Tue Sep 16, 2008 11:36 am

Re: Latex Graphics: Unable to place figure in Latex Doc

Post by pankaj »

Hi Stefan,

Well yeah i have attached the gzipped figure.
n yup i rechecked m using correct file name.

Thanks
Pankaj
Attachments
si.gz
(14.69 KiB) Downloaded 348 times
Post Reply