Graphics, Figures & Tablescannot center long caption in subfig pkg in IEEETrans.cls

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
skhimsara
Posts: 1
Joined: Mon Feb 22, 2010 6:36 am

cannot center long caption in subfig pkg in IEEETrans.cls

Post by skhimsara »

Hi
I am using the subfig package and i am unable to center the caption even though the floating figures are centered. Here is a snippet of my code.
I am using the IEETrans.cls file from IEEE website to write my journal paper. Please find it attached to this post.

The output of this latex code always shows a caption which is justified to the left.

I googled a lot trying to find if there are any settings to the subfig package which can take care of centering the caption, but i haven't had much luck. It would be great if someone could help.

Code: Select all

\begin{figure*}[!t]
%\captionsetup[figure*]{justification=centering}
\centering
\subfloat[]{\includegraphics[width=2.2in]{Figures/graph_Speed.PNG}
\label{fig:Speed1}}
\hfil
\subfloat[]{\includegraphics[width=2.2in]{Figures/graph_Speed2.PNG}
\label{fig:Speed2}}
\hfil
\subfloat[]{\includegraphics[width=2.2in]{Figures/graph_vSpeed3.PNG}
\label{fig:Speed3}}
\caption{(a)Speed 1: Blah Blah Blah Blah Blah Blah (b)Speed 2: Blah Blah Blah Blah Blah Blah (c)Speed3: Blah Blah Blah Blah Blah Blah}
\label{speedgraphs}
\end{figure*}

Thanks
Sid
Attachments
IEEEtran.cls
IEEETrans.cls
(196.63 KiB) Downloaded 196 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

magicmoose
Posts: 90
Joined: Fri Nov 06, 2009 7:29 am

cannot center long caption in subfig pkg in IEEETrans.cls

Post by magicmoose »

Please post a complete compilable MWE that shows the error.
Also, as shown here it is not recommended to use the subfig package, but to use subcaption (from the caption package)
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

cannot center long caption in subfig pkg in IEEETrans.cls

Post by sommerfee »

magicmoose wrote:Also, as shown here it is not recommended to use the subfig package, but to use subcaption (from the caption package)
Please note that the subcaption package needs the caption package which is not compatible with all document classes. (Don't know about the IEEEtran document class, will try that out as soon as a MWE is available here.) So in some cases the subfig package should/must be used and it should be loaded with the option "caption=false" to make sure the caption package is not loaded in such cases.

Axel
Post Reply