Graphics, Figures & Tables ⇒ subfig package and amsart
Re: subfig package and amsart
Two questions:
1. Should I even be using \subfloat? Or, would it be better to use \begin{subfigure}...\end{subfigure}?
2. I have my subfigures labelled with lowercase roman letters wrapped in parentheses (e.g. (b)). However, when I use "Figure~\ref{MyFig}\subref{Fig051}" I get "Figure 1b" instead of "Figure 1(b)." This must be easy to fix and I had it working as expected using the subfig package.
Axel, thanks for all of your responses. I'll be chipping in a donation to the LaTeX Community site soon:)
Dana
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
subfig package and amsart
You can use the subfigure environment, or \subcaptionbox (which is the equivalent to \subfloat), or \subfloat, as you like. \subcaptionbox has more options than \subfig, and the subfigure environment will not do automatic horizontal alignment but is more flexable. Personally I use \subcaptionbox in most cases, and the subfigure environment only if I need fancy layouts, e.g. having the sub-captions on the right side of the sub-figures.dcernst wrote:1. Should I even be using \subfloat? Or, would it be better to use \begin{subfigure}...\end{subfigure}?
The handling of the labelformat and the reference is different to the subfig package but exactly the same as in caption package. The counter itself will be generated by using \theXXX, where XXX is the name of the counter. This is what is used by the label, the reference and the list of figures. The caption label will be generated by wrapping the counter with the given labelformat. The default will give you an alphanumeric counter and the labelformat will wrap it by parenthesis.2. I have my subfigures labelled with lowercase roman letters wrapped in parentheses (e.g. (b)). However, when I use "Figure~\ref{MyFig}\subref{Fig051}" I get "Figure 1b" instead of "Figure 1(b)." This must be easy to fix and I had it working as expected using the subfig package.
So if you want the parenthesis around the counter, you have to put them into the counter format and take them out of the labelformat.
This is because the AMS document classes put the caption label in \scshape. You can set your own font by using the labelfont option here.Another thing that is annoying me is how the subfigures are labelled using capitals, but when I reference them, they are in lower case.
A different thing: You don't have to write \ref{FigTest}\subref{Fig008} but can use \ref{Fig008} instead, it will give you the same output.
In total we have now:
Code: Select all
\documentclass{amsart}
\usepackage{graphicx}
\usepackage{caption}
\usepackage[labelformat=simple,labelfont={}]{subcaption}
\renewcommand\thesubfigure{(\alph{subfigure})}
\begin{document}
Another thing that is annoying me is how the subfigures are labelled using capitals, but
when I reference them, they are in lower case. For example,
Figure~\ref{Fig008}. I want the labels on the figures to be lowercase,
too, like they are using the \texttt{article} class.
\begin{figure}[ht]
\centering
\subfloat[test\label{Fig007}]{\includegraphics{Fig007}}
\hspace{.5cm}
\subfloat[test2\label{Fig008}]{\includegraphics{Fig008}}
\caption{}\label{FigTest}
\end{figure}
\end{document}
Axel
Re: subfig package and amsart
Dana
subfig package and amsart
Just a short note: Because of the incompatibility (and reported problems, and other reasons) I decided to drop \subfloat in the very next version of the subcaption package. Please use \subcaptionbox instead. I'm sorry for the inconvenience.sommerfee wrote:So unfortunately the \subfloat command of the subcaption package is not 100% compatible to the one of the subfig package, for that reason I decided not to document it.