I am writing a thesis in a large .tex file in Vim. I have an .eps image, whose caption is too separated from the image.
I have extensively read similar posts, tried almost everything, but the problem still persists, because it only occurs with this particular image:
imagefilename.eps
I would appreciate very much if you could help me.
I have a very simple preamble.
The rest of the captions (from the rest of the .eps images) have the exact space that I need, except for this particular image. This way, I would not prefer to write commands in the preamble, due to this will modify all captions of the rest of the images. I would only like to reduce the space image-caption of this particular image.
I don’t know why the space caption-image for this particular image is bigger than the rest.
Here is the code that introduces the image:
\begin{center}
\begin{figure}
\begin{center}
\includegraphics[scale=0.150,angle=0]{imagefilename.eps}
\caption{\small\sf This text is the image caption for the image showed. Note that this text is too separated from the image above.}
\label{image}
\end{center}
\end{figure}
\end{center}
Here is the link to direct download of the image, in order to check previously if a possible solution works:
https://www.mediafire.com/?xtub719odxrvbsx
I also show a direct link of another .eps image:
https://www.mediafire.com/?225azt8wkhyblzh
Just try to maintain the last code, and replace the
imagefilename.eps
with
a.eps
And you will see that the caption for a.eps is closer to the figure (!!!)
My preamble is this:
\documentclass[12pt,a4paper,twoside,openany]{report}
\usepackage[left=2.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm]{geometry}
\parindent 1 true cm
\usepackage[dvips]{graphicx}
\usepackage{eufrak}
\usepackage[spanish]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage{amsmath}
\usepackage{graphicx,epsfig}
\usepackage{multirow}
\usepackage{float}
\usepackage{color}
\usepackage[longnamesfirst,super]{natbib}
\setcitestyle{square}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter .\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection .\ #1}{}}
\lhead{\nouppercase}
\rhead{\nouppercase}
\fancyhead[LE]{{\sf \leftmark}}
\fancyhead[RE]{}
\fancyhead[RO]{{\sf \rightmark}}
\fancyhead[LO]{}
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[CE,CO]{}
\renewcommand{\headrulewidth}{0.0pt}
\renewcommand{\baselinestretch}{1.25}
\usepackage{adjustbox}
\usepackage{enumerate}
\usepackage{courier}
\begin{document}
I would appreciate very much if someone could help me, making tests with the images provided above, using my preamble, and the code that introduces the image. (I am writing the thesis .tex file in Vim).
Best Answer
Your preamble has several sins; but that's not the problem. If you type
TeX will add a frame and you'll realize that the figure has wide blank space around the main part:
How can you do? Add the
trim
option; I triedand the result is
(still with
\fbox
to show better the image, remove it when you're satisfied). The four parameters are the length (in PostScript points) to trim from the four sides in the order “left bottom right top”.Here's a polished version of your document with some comments.
The packages
times
andepsfig
are obsolete; the second one should never be used, to substitute the first one loadmathptmx
or, betterThe option
dvips
should never be passed tographicx
.For changing the font of captions, use the
caption
package. Don't putfigure
inside acenter
environment and don't usecenter
inside, but the simple declaration\centering
.