Captions in subfigures are justified by default, which does not always look pretty:
\documentclass[]{tGIS2e} % http://www.tandf.co.uk/journals/authors/tgislatex.zip
\begin{document}
\begin{figure}
\begin{center}
%\raggedright
\subfigure{
\includegraphics[draft,width=3cm,height=3cm]{dummy}%
\label{fig:myfig_a}%
}
~
\subfigure[capture for b, justified]{
\includegraphics[draft,width=3cm,height=3cm]{dummy}%
\label{fig:myfig_b}%
}
~
\subfigure[justification becomes ugly sometimes]{
\includegraphics[draft,width=3cm,height=3cm]{dummy}%
\label{fig:myfig_c}%
}
~
\subfigure[there should be a way of applying \textbackslash raggedright or a similar command ]{
\includegraphics[draft,width=3cm,height=3cm]{dummy}%
\label{fig:myfig_d}%
}
\caption{Figure example}%
\label{fig:myfig}
\end{center}
\end{figure}
\end{document}
How would it be possible to keep the overall alignment of the image and its caption, and make the subcaption aligned, let’s say left? Adding \raggedright
does not help — it shifts the whole image left, but keeps the alignment of the text.
It would be good if the solution exited for the markup given above, because the template I’m using does not support subfigure
as environment and also conflicts with subcaption
package.
Best Answer
Your documentclass is loading the (obsolete)
subfigure
package. This package has options such asraggedright
for the caption justification. These options can be turned on locally by issuing e.g.\subcapraggedrighttrue
:The list of possible commands includes
\subcapraggedrighttrue
\subcapcentertrue
\subcapcenterlasttrue
There are also
false
variants.Similarly there is
\subcaphangtrue
to make sure the label sticks out to the left of the caption block. For example, in the above examplegive
Also the
nooneline
option corresponds to\subcapnoonelinetrue
. See theDeclaration of Options
section of thesubfigure
documentation, where you will as be able to deduce how to place captions above, rather than below the figures, etc.