Graphics, Figures & TablesGraphics Inclusion fails

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
User avatar
jafarHH
Posts: 17
Joined: Tue Jun 28, 2011 2:46 pm

Graphics Inclusion fails

Post by jafarHH »

Hi,

im getting some problems when try to include graphics to my document, im using LED and the image i want to include is a jpg
i'm pretty new so any help would be appreciated here is my code and the errors i get:

Code: Select all

\documentclass[draft]{article}

\usepackage{graphicx}

\begin{document}
\section{social}

some text... 

\subsection{statistics}

more text...

\begin{figure}

\includegraphics[scale=0.5]{statistics.jpg}

\end{figure}

\end{document}
and here is the error message

cannot determine size of graphics statistic.jpg.

here is the figure i'm trying to put in the doc.

Thanks in advance.
Attachments
statistics.jpg
statistics.jpg (25.77 KiB) Viewed 2708 times
Last edited by jafarHH on Tue Jul 26, 2011 6:20 pm, edited 1 time in total.

Recommended reading 2024:

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

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

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Graphics Inclusion fails

Post by frabjous »

Firstly, if you want graphics to show up, you need to remove the "draft" option to the document class.

Next, how are you compiling? With regular latex, or pdflatex? You'll need to use pdflatex to include jpg's directly.

If I remove "draft", it works just fine for me with pdflatex.
User avatar
jafarHH
Posts: 17
Joined: Tue Jun 28, 2011 2:46 pm

Re: Graphics Inclusion fails

Post by jafarHH »

Thx that helped but the picture shows up at the top of the page over the text section...
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Graphics Inclusion fails

Post by frabjous »

That's because you put it inside a floating figure environment. Try using the placement option for the figure, e.g.:

Code: Select all

\begin{figure}[!h]
adjust as needed (details here).
User avatar
jafarHH
Posts: 17
Joined: Tue Jun 28, 2011 2:46 pm

Re: Graphics Inclusion fails

Post by jafarHH »

Thank you very much that sorted things out :)
Post Reply