GeneralFigures apear cut on the right ...

LaTeX specific issues not fitting into one of the other forums of this category.
MitsosOSougias
Posts: 10
Joined: Mon Jan 07, 2008 4:11 pm

Figures apear cut on the right ...

Post by MitsosOSougias »

Some (not all, which is weird) of my figures appear cut on the right.

this is what I use to include the figure:

\begin{figure}
\begin{center}
\includegraphics[height=7cm]{4_200_9_CLOSE_A.eps}
\caption{\textit{\label{F:4_200_9_CLOSE_A} TEXT}}
\end{center}
\end{figure}

This is what it looks like:

Image


and this is my preamble:

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx,amssymb,amsmath, fancybox, boxedminipage}
\usepackage{psfrag}
\usepackage{graphics}
\usepackage{subfigure}
\usepackage{pstricks}
\usepackage{placeins}
\usepackage{sidecap}
\usepackage[it,small]{caption}
\numberwithin{figure}{section}
\numberwithin{equation}{section}

Can anyone help me please?

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

Figures apear cut on the right ...

Post by localghost »

Could be a problem with the bounding box of the EPS file. As I can see you have a photo (possibly in original JPG format) and your resulting output format is PDF. If so, you should keep the original format of the image and compile directly to PDF with pdflatex. The issue then might not occur.


Best regards and welcome to the board
Thorsten¹
MitsosOSougias
Posts: 10
Joined: Mon Jan 07, 2008 4:11 pm

Re: Figures apear cut on the right ...

Post by MitsosOSougias »

Thank you for your reply. I actually use .eps and the problem has only ocured with just 2 out of 50 pictures, which I have converted using GIMP ...

I tries running pdflatex but all my figures are in .eps so it is not running ...
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Re: Figures apear cut on the right ...

Post by phi »

You can always convert EPS graphics to PDF graphics, which can be included in documents compiled by pdfTeX, using the programs a2ping or epstopdf. You can try to correct the bounding box using the command line option --bboxfrom==compute-gs when calling a2ping. For other possibilities, you can look here:
http://phaseportrait.blogspot.com/2007/ ... o-pdf.html
MitsosOSougias
Posts: 10
Joined: Mon Jan 07, 2008 4:11 pm

Re: Figures apear cut on the right ...

Post by MitsosOSougias »

I checked the b-boxes on file that are the same size/dimensions that appear ok and the ones that do not and they are the same!!! Weird very weird ... this is such a show stopper for me, as I really need these pictures intact!

By the way, the DVI file seems ok, it is the .PDF that has the problem ...
MitsosOSougias
Posts: 10
Joined: Mon Jan 07, 2008 4:11 pm

Re: Figures apear cut on the right ...

Post by MitsosOSougias »

Anyone got any ideas?
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: Figures apear cut on the right ...

Post by Juanjo »

Could you somehow provide the problematic eps file? Without having it to test solutions, it is difficult to propose one. Anyway, I would try to use the trim option of \includegraphics. It seems to me that the picture contains white space on the left which occupies most of the space you reserve. That space could be removed with trim.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
MitsosOSougias
Posts: 10
Joined: Mon Jan 07, 2008 4:11 pm

Re: Figures apear cut on the right ...

Post by MitsosOSougias »

This is one of the files in question ...

http://rapidshare.com/files/163410700/4 ... A.eps.html

Any help appreciated as my reviewers cannot read DVIs so not converting to PDF is a HUGE problem!

Thank you
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Figures apear cut on the right ...

Post by Juanjo »

I've downloaded the picture and compiled the following minimal example (with latex + dvips + ps2pdf):

Code: Select all

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx,amssymb,amsmath,fancybox,boxedminipage} 
\usepackage[font={it,small}]{caption}
\usepackage{subfig}
\usepackage{psfrag}
\usepackage{pstricks}
\usepackage{placeins}
\usepackage{sidecap}
\numberwithin{figure}{section}
\numberwithin{equation}{section}

\begin{document}

\begin{figure}
   \centering
   \fbox{\includegraphics[trim=300 0 10 0,clip,height=7cm]{4_200_9_CLOSE_A.eps}}
   \caption{TEXT}\label{F:4_200_9_CLOSE_A}
\end{figure}

\end{document}
As you can see, I've modified a bit the preamble (subfigure is obsolete, there was a superfluous loading of graphics, I've arranged the options of caption ). Likewise, I've also improved the code for inserting the picture. The box around it only serves to visualize its size and can be removed. Likewise, the trim option allows to avoid and small vertical line and blank space on the left. Here I show a screen capture:
pru.jpg
pru.jpg (54.41 KiB) Viewed 11923 times
Everything goes fine. I can't see any problem. Please, try the above minimal example and report the result you get. Perhaps it would be worthy if you attach the log file.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Figures apear cut on the right ...

Post by phi »

I have no problems with this file, neither with a2ping+pdflatex nor with latex+dvipdf. I didn't change a single bit of your code.
Anyway, localghost is right: It is not a vector graphic, and so you shouldn't use a vector graphic format for it. If it is a photo, JPEG is the best format, but a lossless pixel format (PNG) also works. Using EPS for that only leads to huge file sizes and compilation times. So, my suggestion is: Use JPEG or PNG for all raster graphics, and PDF for all vector graphics, and then use pdflatex to produce a PDF document.
Post Reply