Couple days ago, I spent so many hours figuring out how to make my figure captions centered in LaTex. I use WindEdt 6 Editor and IEEE journal template for that. The problem was, the IEEE journal template will automatically make the figure captions left justified. Several minutes later, I found a great page written by Michael Shell to solve this problem. Here’s the link : http://www.michaelshell.org/tex/ieeetran/
According to the above link, basically what I need to do is to add an additional code in my tex file as follows:
\makeatletter
\long\def\@makecaption#1#2{\ifx\@captype\@IEEEtablestring%
\footnotesize\begin{center}{\normalfont\footnotesize #1}\\
{\normalfont\footnotesize\scshape #2}\end{center}%
\@IEEEtablecaptionsepspace
\else
\@IEEEfigurecaptionsepspace
\setbox\@tempboxa\hbox{\normalfont\footnotesize {#1.}~~ #2}%
\ifdim \wd\@tempboxa >\hsize%
\setbox\@tempboxa\hbox{\normalfont\footnotesize {#1.}~~ }%
\parbox[t]{\hsize}{\normalfont\footnotesize \noindent\unhbox\@tempboxa#2}%
\else
\hbox to\hsize{\normalfont\footnotesize\hfil\box\@tempboxa\hfil}\fi\fi}
\makeatotherI have added the above code after my document class initialization in my tex file and it has worked perfectly for me. I really need to thank Michael Shell for his useful information regarding this matter
. Hope this information will also help those who face the same problem.