LaTeX forum ⇒ Graphics, Figures & Tablessubfigure | 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

Postby daviddoria » Wed Nov 16, 2011 9:01 pm

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:

  1. \documentclass[10pt]{article}
  2. \usepackage{subfigure}
  3. \usepackage{graphicx}
  4. \usepackage{float} % to use [H] placement
  5.  
  6. \begin{document}
  7. \section{Test Graphics}
  8.  
  9. 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.
  10. %multiple figures
  11. \begin{figure}[ht!]
  12. \centering
  13. \subfigure[Caption of subfigure 1]{
  14. \fbox{\rule{0pt}{2in} \rule{0.2\linewidth}{0pt}}%box
  15. %\includegraphics[width=0.4\linewidth]{Soldier}%actual image
  16. \label{fig:subfig1}
  17. }
  18. \subfigure[Caption of subfigure 2]{
  19. \fbox{\rule{0pt}{2in} \rule{0.2\linewidth}{0pt}}
  20. \label{fig:subfig2}
  21. }
  22. \subfigure[Caption of subfigure 3]{
  23. \fbox{\rule{0pt}{2in} \rule{0.2\linewidth}{0pt}}
  24. \label{fig:subfig3}
  25. }
  26. \caption[Optional caption for list of figures]{Caption of subfigures \subref{fig:subfig1}, \subref{fig:subfig2} and \subref{fig:subfig3}}
  27. \label{fig:subfigureExample}
  28. \end{figure}
  29.  
  30.  
  31. \end{document}
  32.  


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.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
sommerfee
Posts: 495
Joined: Mon Apr 09, 2007 4:20 pm
Contact:

Postby sommerfee » Wed Nov 16, 2011 9:08 pm

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.

Link:
BBcode: Topic is solved[/url]" title="Click to select post's link in BBcode format" onclick="this.focus();this.select();" />
HTML: Topic is solved</a>" title="Click to select post's link in HTML format" onclick="this.focus();this.select();" />
Hide post links
Show post links

daviddoria
Posts: 60
Joined: Tue Sep 30, 2008 9:24 pm

Postby daviddoria » Wed Nov 16, 2011 9:13 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

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Wed Nov 16, 2011 9:17 pm

Don't use the obsolete subfigure package [1]. Replace it with the subfig package from the same author (or other alternatives).
  1. \documentclass[10pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[format=hang]{subfig}
  4.  
  5. \begin{document}
  6. \section{Test Graphics}
  7. 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.
  8.  
  9. \begin{figure}[!ht]
  10. \centering
  11. \subfloat[Caption of subfigure 1\label{fig:subfig1}]{%
  12. \rule{0.2\linewidth}{2in}
  13. }
  14. \subfloat[Caption of subfigure 2\label{fig:subfig2}]{%
  15. \rule{0.2\linewidth}{2in}
  16. }
  17. \subfloat[Caption of subfigure 3\label{fig:subfig3}]{%
  18. \rule{0.2\linewidth}{2in}
  19. }
  20. \caption[Optional caption for list of figures]{Caption of subfigures \subref{fig:subfig1}, \subref{fig:subfig2} and \subref{fig:subfig3}}\label{fig:subfigureExample}
  21. \end{figure}
  22. \end{document}


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


Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

jane
Posts: 1
Joined: Tue Nov 27, 2012 6:19 pm

Postby jane » Tue Nov 27, 2012 6:21 pm

This is exactly what I was looking for! Thank you so much!

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 7 guests