TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a paper using the IEEEtran template in LyX.

I have run into a problem: While the contents (in this case, a table) of the figure float are centered, the caption is aligned to the left (see screenshot below). How can I center the caption as well?

enter image description here

This is generated by the following LyX document:

enter image description here

What I've tried:

  1. Center the table (the table is centered)
  2. Center all the contents in the float (only the table is centered)
  3. Select the caption and center it (no effect)

Technical details:

  • LyX
  • Mac OS X 10.7.5 (Lion)
  • All centering was performed by Right Click>Paragraph Settings>Align: Center
share|improve this question

migrated from stackoverflow.com Mar 1 '13 at 14:36

This question came from our site for professional and enthusiast programmers.

The IEEEtran class aligns figure captions to the left. Since it's thought for submissions to IEEE journals or conferences, you shouldn't tamper with the positioning. – egreg Mar 1 '13 at 14:45
I think you have a level to use an other Editor than LyX. Please see this small discuss meta.tex.stackexchange.com/questions/1883/… and here is a small collection of editors: tex.stackexchange.com/questions/339/latex-editors-ides – Marco Daniel Mar 1 '13 at 14:57
@MarcoDaniel I don't think LyX is a LaTeX editor. I do think though that a good understanding of LaTeX should be achieved before using LyX, not as a reason to leave LyX. See also yihui.name/en/2012/10/lyx-vs-latex. There are many good reasons to not use LyX, but I don't think knowing a lot of LaTeX should be one of them. Of course this is a personal opinion, but since you gave yours I gave mine :) – scottkosty Mar 1 '13 at 15:39
@scottkosty: Indeed. I completely agree with you. – Marco Daniel Mar 1 '13 at 17:46
@inspectorG4dget: I've added an answer. We should clean up our comments... – Werner Mar 1 '13 at 22:01
up vote 8 down vote accepted


\usepackage{caption}% http://ctan.org/pkg/caption

to your document preamble (using the menus Document > Settings... > LaTeX Preamble) centres the captions by default. Although this also changes the default formatting, it would be possible to adapt it to match that of the default IEEEtran document class.

If this is for a journal submission, it is advised to stick to their formatting.

share|improve this answer

IEEEtran has a conference mode which automatically centers all the captions. Adding following to your LaTeX code would center all the captions.


Although, I would also agree with @Werner, that it's best to stick to the format specified by the journal you are submitting.

share|improve this answer

Just Put the following code after \documentclass[journal]{IEEEtran}

\footnotesize\begin{center}{\normalfont\footnotesize #1}\\
{\normalfont\footnotesize\scshape #2}\end{center}%
\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}%
\hbox to\hsize{\normalfont\footnotesize\hfil\box\@tempboxa\hfil}\fi\fi}

% will definitely work. 

This is the above code for JOURNAL class. Thanks to http://www.michaelshell.org/tex/ieeetran/

share|improve this answer
this is already the code inside IEEEtran no? – percusse Dec 24 '15 at 13:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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