I'm using
\documentclass[journal,transmag]{IEEEtran}
\usepackage[pdftex]{graphicx}
\begin{document}
%
\setlength{\textfloatsep}{0pt}
\begin{figure*}[!t]
\centering
\scalebox{.9}{\includegraphics[width=\linewidth]{fig}}
\caption{result}
\end{figure*}
%
\end{document}
and I'm inserting a ".pdf" figure. The problem is that I have a big white space after the figure and before the caption. In generating the ".pdf" file I've tried to minimize the white space as much as I could but when uploading in Latex there appears to be a bis white empty space. Can I trim this in Latex?
Thank you.
Best Answer
Trimming of PDF images
The program
pdfcrop
calls ghostscript to calculate the visible area of the image and writes a PDF file with the new bounding box without the white space margins:This writes
fig-crop.pdf
. Also a different output file name can be specified, see pdfcrop's options.Then the cropped image is inserted in LaTeX:
Alternatively options
trim
orviewport
of\includegraphics
can be used to reduce the margins. But the margins have to be measured for specifying the right arguments fortrim
orviewport
, see LaTeX's graphics guide.Change of default spacing above figure captions
The class
IEEEtran
has hooks: for setting the space between the figure and its caption and a table caption and its tableThey can be redefined to reduce the space:
Or
But beware, the journal might want to have the original space.