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 have an image I'd like horizontally centered on the page. Currently, I'm using the following code (which does work) under pdflatex:



\caption{Some kind of sane Caption}

The references I've found on the ineternet are pretty much split 50-50 on whether the \leavevmode is required there or not. But, I can't find anything that says point blank what it's for.

So, my two-part question: what exactly does \leavevmode do, and do I need it?

share|improve this question
up vote 13 down vote accepted

\leavevmode is defined this way:


source2e.pdf comments:

\leavevmode begins a paragraph, if necessary.

I would say, this is not necessary, so you don't need \leavevmode. You could further consider to use \centering instead of \begin{center} ... \end{center} because the latter produces additional vertical space, because it's actually a list environment.

Another source mentioning that it obviously had been used as workaround resp. bugfix: Centering of too wide figure.

In comparing references it may help to look at the dates and the context. I know such reports concerning inclusion of EPS files, which doesn't apply to pdfTeX.

share|improve this answer
I'd be a bit more definite: really not needed. (I'm working on the paragraph model for LaTeX3 at the moment, and inserting random \leavevmode items will cause all sorts of trouble there!) – Joseph Wright Dec 13 '10 at 20:58
Perfect, that was just what I wanted to know, thanks. – Electrons_Ahoy Dec 13 '10 at 21:26
And, for the record, after replacing the center environment with \centering and removing \leavevmode, I swear the document renders faster. – Electrons_Ahoy Dec 13 '10 at 21:27
@Electrons: It might compile slightly faster, but render? That seems unlikely. – TH. Dec 14 '10 at 10:16

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.