## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ subfigure | Format of wrapped Captions Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
daviddoria
Posts: 60
Joined: Tue Sep 30, 2008 9:24 pm

### subfigure | Format of wrapped Captions

Is there a way to change the wrapping in a subfigure caption? E.g. in this figure: http://daviddoria.com/Uploads/BlackWhiteSequence.png I don't like how the word "filled" in subfigure a) is not aligned with the word "Image".

Here is another example:

\documentclass[10pt]{article}\usepackage{subfigure}\usepackage{graphicx}\usepackage{float} % to use [H] placement \begin{document}\section{Test Graphics} In Figure \ref{fig:subfigureExample} we show three things. In \subref{fig:subfig1} we show the first thing, in \subref{fig:subfig2} we show the second thing, and in \subref{fig:subfig3} we show the third thing. In \ref{fig:subfig1} we do something.%multiple figures\begin{figure}[ht!]\centering\subfigure[Caption of subfigure 1]{\fbox{\rule{0pt}{2in} \rule{0.2\linewidth}{0pt}}%box%\includegraphics[width=0.4\linewidth]{Soldier}%actual image\label{fig:subfig1}}\subfigure[Caption of subfigure 2]{\fbox{\rule{0pt}{2in} \rule{0.2\linewidth}{0pt}}\label{fig:subfig2}}\subfigure[Caption of subfigure 3]{\fbox{\rule{0pt}{2in} \rule{0.2\linewidth}{0pt}}\label{fig:subfig3}}\caption[Optional caption for list of figures]{Caption of subfigures \subref{fig:subfig1}, \subref{fig:subfig2} and \subref{fig:subfig3}}\label{fig:subfigureExample}\end{figure}  \end{document}

Any thoughts on how to make this look better?

David
Last edited by daviddoria on Wed Nov 16, 2011 9:25 pm, edited 1 time in total.

sommerfee
Posts: 495
Joined: Mon Apr 09, 2007 4:20 pm
Contact:
daviddoria wrote:I don't like how the word "filled" in subfigure a) is not aligned with the word "Image".

Take a peek at the subfigure documentation, I'm quite sure there is a package option like "hang" or similar.

daviddoria
Posts: 60
Joined: Tue Sep 30, 2008 9:24 pm
Ah, hanging indent, that is the word I was looking for. None of my searches found 'hang' haha.

\usepackage[hang]{subfigure}

does the trick, thanks.

David

localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany
Don't use the obsolete subfigure package [1]. Replace it with the subfig package from the same author (or other alternatives).
\documentclass[10pt]{article}\usepackage[T1]{fontenc}\usepackage[format=hang]{subfig} \begin{document}   \section{Test Graphics}     In Figure \ref{fig:subfigureExample} we show three things. In \subref{fig:subfig1} we show the first thing, in \subref{fig:subfig2} we show the second thing, and in \subref{fig:subfig3} we show the third thing. In \ref{fig:subfig1} we do something.    \begin{figure}[!ht]     \centering     \subfloat[Caption of subfigure 1\label{fig:subfig1}]{%       \rule{0.2\linewidth}{2in}     }     \subfloat[Caption of subfigure 2\label{fig:subfig2}]{%       \rule{0.2\linewidth}{2in}     }     \subfloat[Caption of subfigure 3\label{fig:subfig3}]{%       \rule{0.2\linewidth}{2in}     }     \caption[Optional caption for list of figures]{Caption of subfigures \subref{fig:subfig1}, \subref{fig:subfig2} and \subref{fig:subfig3}}\label{fig:subfigureExample}   \end{figure}\end{document}

[1] View topic: Obsolete Packages and Document Classes — Avoid Usage!

Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

jane
Posts: 1
Joined: Tue Nov 27, 2012 6:19 pm
This is exactly what I was looking for! Thank you so much!