Here is my code -
\\begin{figure}
\begin{center}
\captionsetup{justification=centering}
\subfigure[] {\label{fig:i-page}}\includegraphics[width=70mm]{path/
i_page.png}
\subfigure[] {\label{fig:o-page}}\includegraphics[width=70mm]{path/
o_page.png}
\caption{Figure title.}
\label{fig:data-pages}
\end{center}
\end{figure}
I do not use subfigure captions, just the numbers (a) and (b), which
are left justified if I use the above code.
Thanks
ldr
Are you using the subfigure or subfig pacakge? And what about the
caption package to manipulate your caption material?
Werner
> I'm using the subfigure package and also the captions package.
subfigure has been declared obsolete by its author, who has released
its successor, subfig. This one cooperates well with caption.
Ciao
Enrico
First I'm not able to generate a proper subfig.sty file from the
version 1.2 downloaded from http://www.cs.cmu.edu/afs/cs/usr/sdc/www/latex/subfig.html.
Secondly, if I use the code provided in http://www.cs.cmu.edu/~sdc/latex/subfig.12/subfig.sty,
on compilation it returns several errors like-
-Missing $ inserted.
-Extra }, or forgotten $
My code to generate subfigures using the subfig package is -
\begin{figure}
\begin{center}
\subfloat[] {path/ i_page.png}
\subfloat[] {path/ o_page.png}
You should say
\subfloat[]{\includegraphics{path/i_page.png}}
A subfloat can contain anything, no \includegraphics is implied.
Also, change \begin{center} into \centering and delete \end{center}.
Ciao
Enrico
I replaced with \centering as well. Doesn't work.
Please help.
always get your packages from CTAN, the subfig I got in my TeX Live is
from 2005, the URL you gave is from 2003.
what do you mean \centering doesn't work? minimal example please
--
/daleif (remove RTFSIGNATURE from email address)
LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
> I corrected the subfloat command. However, it gives me several errors
> in the subfig.sty file.
In many cases replacing \usepackage{subfigure} with \usepackage{subfig} and
replacing \subfigure with \subfloat (or simply saying \let\subfigure
\subfloat after loading the subfig package) is sufficient.
So if you have a TeX document which compiles using the subfigure package,
it should not be so difficult to migrate this document to subfig.
> I use the one from
> http://www.cs.cmu.edu/~sdc/latex/subfig.12/subfig.sty.
It's outdated, version 1.3 on CTAN is the actual one.
And please visit http://www.minimalbeispiel.de/mini-en.html
HTH,
Axel
I get an error : No counter 'subfigure@save defined.
My code is --
\begin{figure}
\centering
\subfloat[] {\includegraphics[width=70mm]{path/ i_page.png}}
\subfloat[] {\includegraphics[width=70mm]{path/ o_page.png}}
\caption{Figure title.}
\label{fig:data-pages}
\end{figure}
Again, this is /not/ a minimal example. And there must be
/no/ space after the slash. Your code, with
\documentclass{article}
\usepackage{graphicx,subfig,caption}
\begin{document}
at the beginning and \end{document} at the end, compiles perfectly on
my computer (erasing the space, of course). Therefore, try
\documentclass{article}
\usepackage{graphicx,subfig,caption}
\listfiles
\begin{document}
\begin{figure}
\centering
\subfloat[] {\includegraphics[width=70mm]{i_page.png}}
\subfloat[] {\includegraphics[width=70mm]{o_page.png}}
\caption{Figure title.}
\label{fig:data-pages}
\end{figure}
\end{document}
It's best to avoid the complicated path, place a copy of the
pictures in the directory where you are working with this example.
I've added also a \listfiles command, which should inform you about
the version number of the various packages you are loading.
Ciao
Enrico
> I get an error : No counter 'subfigure@save defined.
You get this error when you try to use both, the subfigure *and* the subfig
package. This is not possible, please decide which one do you actually want
to use.
HTH,
Axel
> I tried using the subfig package too. It gives me several compilation
> errors.
>
> First I'm not able to generate a proper subfig.sty file from the
> version 1.2 downloaded from http://www.cs.cmu.edu/afs/cs/usr/sdc/www/latex/subfig.html.
> Secondly, if I use the code provided in http://www.cs.cmu.edu/~sdc/latex/subfig.12/subfig.sty,
> on compilation it returns several errors like-
> -Missing $ inserted.
> -Extra }, or forgotten $
>
> My code to generate subfigures using the subfig package is -
>
> \begin{figure}
> \begin{center}
You want \centering here instead (which does not insert extra vertical space).
> \subfloat[] {path/ i_page.png}
Well, yes, a _ in text mode will probably trigger math mode
complaints. The mandatory argument is not assumed to be a picture
filename, since you might want to have picture/pstricks/emp/tikz ...
environments there. Check if using \includegraphics{path/i_page.png} works.
HTH
Ulrich
--
"There was an argument on the Caml list over the merits of where,
a.k.a backwards let. I am now completely opposed to it after seeing
that. I think the code would be more readable in FORTH."
-- Jed Davis, on my implementation of dependency sorting