I would like to know how to center the listings gerenated caption in LaTeX. It always go to the left of the code. The rest of the captions (tables) are OK.
\documentclass[11pt,a4paper,oneside, onecolumn]{IEEEtran}
\usepackage{listings}
\begin{document}
\begin{lstlisting}
fileName = 'CorelGCH.arff';
features = CorelDB(@NormalizedGCH);
dlmwrite(fileName, features, ',');
\end{lstlisting}
\end{document}
I think the problem is with the IEEEtran…
Best Answer
To center the caption in the class
IEEEtran
you have two possibilities:Load the class with the option
conference
. This was discussed at LaTeX Community: Cannot align caption to the center,Load the package
caption
with the optionjustification=centering
: