I included a figure using the figure
environment with a rather long caption. The width of the caption is the same as the page width, which doesn't look so nice. Is there any way to reduce the width of the caption frame?
[Tex/LaTex] Too wide figure caption
captionsformatting
Best Answer
Her's one possibility using the
caption
package; using thewidth
key you can assign a predefined width (0.8\textwidth
in my example):You can also make this a global setting using
\captionsetup
in the preamble.Another option is to use the floatrow package; here's a little example using \FBwidth to make the caption width equal to the figure width:
The
demo
option forgraphicx
simply replaces actual figures with black rectangles; do not use that option in your actual document.