5

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}[caption={Exemplo de uso da função CorelDB.},label={list1}]
fileName = 'CorelGCH.arff';
features = CorelDB(@NormalizedGCH);
dlmwrite(fileName, features, ',');
\end{lstlisting}
\end{document}

I think the problem is with the IEEEtran...

4

To center the caption in the class IEEEtran you have two possibilities:

  1. Load the class with the option conference. This was discussed at LaTeX Community: Cannot align caption to the center,

  2. Load the package caption with the option justification=centering:

    \usepackage[justification=centering]{caption}
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.