Graphics, Figures & TablesPDF figure not showing

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
joac
Posts: 5
Joined: Mon Aug 10, 2009 11:51 am

PDF figure not showing

Post by joac »

Hi all,

after a quick search trhough the forum i found some similar posts but solution to my pb in none. apologies if its been answered already:
Im trying to include figures already in pdf format, using pdflatex. Using:

Code: Select all

\documentclass[12pt,oneside]{article}
\usepackage[english]{babel}
\usepackage[ansinew]{inputenc}
\usepackage[dvips]{graphicx}
\usepackage{vmargin}
\usepackage[dvips]{color}
\usepackage{latexsym}
\usepackage[colorlinks=true]{hyperref}
\geometry{ hmargin=3.5cm, vmargin=3.5cm }
\hypersetup{
    urlcolor=blue,
    linkcolor=gris20,
    colorlinks=true
    }
\definecolor{gris20}{gray}{0.50}

\begin{document}

\section{part one}

\begin{figure}[h]
\begin{center}
\includegraphics[0,0][9cm,8cm]{soph_by_shiptype.pdf}
\end{center}
\caption{whatevr}
\end{figure}

text here

\end{document} 
There is no error but the figure is not showing, only a blank space. Ive tried with both Texniccenter and Miktex, and with packages graphics/graphicx.

Thank you in advance for any help.

joachim
Last edited by joac on Sat Mar 13, 2010 12:57 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.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

PDF figure not showing

Post by localghost »

Omit the dvips driver option wherever you use it. It is unnecessary because the concerned packages detect on their own which compiler engine is running. The same advice has already been given to you in your other request [1]. This thread still awaits your feedback.

Moreover you are using the \includegraphics command in a completely wrong way.

Code: Select all

\begin{figure}[!ht]
  \centering
  \includegraphics[width=9cm,height=8cm]{soph_by_shiptype}
  \caption{whatever}\label{fig:whatever}
\end{figure}
Furthermore you should avoid special characters like blank spaces and underscores in the path and the name of the file.

[1] View topic: Problem to include EPS graphics


Best regards
Thorsten
joac
Posts: 5
Joined: Mon Aug 10, 2009 11:51 am

Re: PDF figure not showing

Post by joac »

Thank you for your answer. I had tried the [width= ,height= ] but was getting a "no bounding box" error. Omitting the [dvips] options, its now working fine - thanks.

Ill answer the other topic, which i had forgotten about, i admit.

Best,

j.
joac
Posts: 5
Joined: Mon Aug 10, 2009 11:51 am

Re: PDF figure not showing

Post by joac »

ps: does it mean that there is no way to use \includegraphics this way :

\includegraphics[x1,y1][x2,y2]{figure.pdf} ,

where x1,y1,x2,y2 are coordinates of the bottom left and top right corners of the figure?
I was hoping to use this as way to select the part of the figure i want to include (whereas the [width= ,heigth= ] takes the whole figure and rescales it). Would have been useful since ive currently no tool such as acrobat pro to do the cutting there..
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

PDF figure not showing

Post by gmedina »

Hi,
joac wrote:ps: does it mean that there is no way to use \includegraphics this way :

\includegraphics[x1,y1][x2,y2]{figure.pdf} ,

where x1,y1,x2,y2 are coordinates of the bottom left and top right corners of the figure?...
Yes; it means exactly that. You cannot use two optional arguments for the \includegraphics command.
joac wrote:...I was hoping to use this as way to select the part of the figure i want to include (whereas the [width= ,heigth= ] takes the whole figure and rescales it). Would have been useful since ive currently no tool such as acrobat pro to do the cutting there...
For that purpose you can use, for example, the trim and clip options; something like the following:

Code: Select all

\includegraphics[trim=100 10 0 20,clip]{name}
the four dimensions of the trim option correspond to the space that will be cut off at the left-hand side, bottom, right-hand side, and top of the included image.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
joac
Posts: 5
Joined: Mon Aug 10, 2009 11:51 am

Re: PDF figure not showing

Post by joac »

Great, thank you for this.
But then, it means I have to choose between trimming and rescaling?..

Alternatively, would you know how to do rescaling when including the figure in .eps format (no trimming needed then) - as in :

\usepackage{graphicx}
\usepackage{epstopdf}
..
\includegraphics{test.eps}

([width=5cm,heigth=4cm] otpion not working in this case)

Best,

j.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

PDF figure not showing

Post by gmedina »

To scale your images you can use something like

Code: Select all

\includegraphics[scale=<factor>]{cat.eps}
where <factor> is the scaling factor to be used; for example, scale=0.5 will reduce the image size by half and scale=3 will result in an image three times bigger than the original.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
joac
Posts: 5
Joined: Mon Aug 10, 2009 11:51 am

Re: PDF figure not showing

Post by joac »

ok. thanks a lot,

best

j.
Post Reply