Graphics, Figures & Tables ⇒ Can't justify caption with subfig package
Can't justify caption with subfig package
I'm using miktex.
When I use subfig package the captions do not full justify. According to documentation captions should full justify by default, but instead they are centered.
When I use the command \captionsetup{justification=justified} captions are centered. However If I change the to raggedright, raggedleft or any other options they work. Only justified doesn't work.
Can someone help?
When I use subfig package the captions do not full justify. According to documentation captions should full justify by default, but instead they are centered.
When I use the command \captionsetup{justification=justified} captions are centered. However If I change the to raggedright, raggedleft or any other options they work. Only justified doesn't work.
Can someone help?
NEW: TikZ book now 40% off at Amazon.com for a short time.
Can't justify caption with subfig package
That's not completely true, they only get justified when they are longer than one single line. Otherwise they got centered by default.monkey wrote:When I use subfig package the captions do not full justify. According to documentation captions should full justify by default, but instead they are centered.
If you want to switch the extra handling of "short" captions off, you could do so with
Code: Select all
\captionsetup{singlelinecheck=off}
Code: Select all
\captionsetup[subfloat]{singlelinecheck=off}
HTH,
Axel
Re: Can't justify caption with subfig package
Unfortunately even for captions that span multi-lines, the justification is still centered. I can't seem to get them to full justify at all.
Re: Can't justify caption with subfig package
I'm out of ideas, so I need more information for being able to help.
Would it be possible to post a small but complete LaTeX document which shows the problem?
Axel
Would it be possible to post a small but complete LaTeX document which shows the problem?
Axel
Can't justify caption with subfig package
Here is an example:
Code: Select all
\documentclass[]{revtex4-1}
\usepackage{graphicx}% Include Fig. files
\usepackage{subfig}
\begin{document}
\begin{figure}
\includegraphics[trim = 0 0 0 0, clip, width=\linewidth]{fig.eps}
\caption[]{This is aaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa long caption ......... .......... ............ ............ ............. ............. ....... ........... ........... ........... ........... .......... ........ .......... ............}
\label{fig:label}
\end{figure}
\end{document}
Can't justify caption with subfig package
The caption package is incompatible to the revtex document class (and therefore the caption of your example code looks broken):
So I recommend not using the caption package (i.e. load the subfig package with the option "caption=false", see subfig documentation for details), but use the stuff offered by the revtex document class only:
Code: Select all
Package caption Warning: Unsupported document class (or package) detected,
(caption) usage of the caption package is not recommended.
See the caption package documentation for explanation.
Code: Select all
\documentclass[]{revtex4-1}
\usepackage[demo]{graphicx}% Include Fig. files
\usepackage[caption=false]{subfig} % <=== "caption=false" added
\begin{document}
\begin{figure}
\includegraphics[trim = 0 0 0 0, clip, width=\linewidth]{fig.eps}
\caption[]{This is aaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa long caption ......... .......... ............ ............ ............. ............. ....... ........... ........... ........... ........... .......... ........ .......... ............}
\label{fig:label}
\end{figure}
\end{document}
Re: Can't justify caption with subfig package
Thanks, It worked.
sumesh
sumesh