Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In the subfig packge, the command \captionsetup[subfigure]{width=<length>} can set the width of all subcaptions within a figure.

How can the width of just a single subcaption in a figure be set?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Using grouping should do it:

\begin{figure}
\begingroup
\captionsetup[subfigure]{width=<length>}
\subfloat[<caption>}{ .... }
\endgroup
%
\subfloat[<caption>}{ .... }
\end{figure}
share|improve this answer
    
Is this grouping something that can be done in all of LaTeX or does it come with subfig? –  Tyson Williams Jul 21 '11 at 14:02
    
It can be done with everything in (La)TeX. Note that \begin{..} and \end{..} already add group, so any LaTeX environment would do as well. Also some settings like counters are done global so grouping won't effect them. –  Martin Scharrer Jul 21 '11 at 14:04
    
And what if I want the subfloat to be centered above the caption? –  Tyson Williams Jul 21 '11 at 14:06
    
Try justification=centering,singlelinecheck=false,position=top as options. –  Martin Scharrer Jul 21 '11 at 14:12
    
This justifies the text but does nothing to the subfloat. –  Tyson Williams Jul 21 '11 at 14:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.