I was working with the elsarticle class and subfig package for my article and I used the subfloat environment to include two pictures. However, the scaling of the pictures is completely wrong and the figures simply appear huge.
Observations:
- No matter what value I use in the \scalebox{} argument, the figures are always blown out of proportion. In fact, changing the parameter of \scalebox{} seems to have no effect on the size of the image.
- Simply changing the class to article from elsarticle ensures that the figures are properly scaled.
- This problem with the image sizes occurs only if I use pdfLaTex, compiling with XeLaTex totally eliminates this problem, but I cannot use XeLaTex as the document is to be submitted to ArXiv.
So, is there some definite way to resize figures in the subfloat environment in the elsarticle.cls class? My minimal working example is provided below (although this produces the scaling error discussed above).
\documentclass[preprint, 3p, number]{elsarticle}
\usepackage[dvips]{color}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage[font=footnotesize,labelfont=bf]{caption}
\begin{document}
\begin{frontmatter}
\end{frontmatter}
\section{Section 1}
\begin{figure} [H]
\begin{raggedleft}
\qquad \quad
\subfloat[]{\scalebox{0.29}{\includegraphics{Rectangle.pdf}}}
\qquad\qquad
\subfloat[]{\scalebox{0.29}{\includegraphics{Circle.pdf}}}
\end{raggedleft}
\caption{The figures to be shown }
\label{A1E}
\end{figure}
\begin{thebibliography}{99}
\end{thebibliography}
\end{document}
I am really very confused about this and any help in this regard would be greatly appreciated. Thank you so much.
Best Answer
As far as I can tell from your write-up, you don't require any of the capabilities of the
subfig
package; you simply have onefigure
that shows two images, right? If that's the case, just leave off the\subfig
wrappers and state the widths of the graphs as fractions of the overall text width, rather than as a fraction of the original design size. Separately, unless you're compiling to a.dvi
file, do replace\usepackage[dvips]{color}
with\usepackage[pdftex]{color}
.Addendum: If you do need separate
subfigure
s within the overallfigure
, I would suggest you use thesubcaption
package (and itssubfigure
environment) as you're already loading thecaption
package.