Tell me more ×
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.

Figure captions seem to wrap at the page width. How could I make them wrap at the figure width instead? Currently, they can easily be mistaken for normal text.

\begin{figure}[!htb]
    \begin{center
    \begin{tikzpicture} ... \end{tikzpicture}
    \caption{Caption goes here.}
    \end{center}
\end{figure}

pdf example

share|improve this question
1  
possible duplicate of Caption fontsize and margin on individual figures? – lockstep Sep 20 '11 at 17:45

2 Answers

up vote 11 down vote accepted

The caption package provides many enhancements: for example

\usepackage[margin=1cm]{caption}

Reducing the caption to the figure width seems not a good idea in general, particularly if a couple of figures are on the same page or on facing pages. On the other hand reducing the width and maybe the font size can be a good typographical device to isolate them better from the context.

share|improve this answer
3  
The OP seems to want to adapt caption widths to the widths of individual figures, not to reduce the caption width by a fixed amount. – lockstep Sep 20 '11 at 17:49
Yes, you're right. I'll edit the answer. – egreg Sep 20 '11 at 17:51
2  
@egreg: You convinced me that decreasing the caption width with a constant amount would be better. Thanks! – Tim N Sep 20 '11 at 18:00

in caption package guide:

Only fixed widths are supported here; if you are looking for a way to limit the width of the caption to the width of the figure or table, please take a look at the floatrow[8] or threeparttable[22] package.

\documentclass{article}
\usepackage{floatrow}
\begin{document}

\begin{figure}
\ffigbox[\FBwidth]
{\caption{caption text caption text caption text caption text 
caption text caption text caption text caption text 
caption text caption text caption text caption text }\label{...}}
{\rule{50mm}{20mm}}
\end{figure}

\end{document}
share|improve this answer

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.