# Should I use center or centering for figures and tables?

What is the correct way to center figures and tables (figure, table)?

\begin{center}
...
\end{center}


or

\begin{centering}
...
\end{centering}

-
Definitely never put the center environment around the figure environment! See Tables and sections get misplaced. (Not that I say Yiannis did this) –  Martin Scharrer Apr 11 '11 at 16:27
@MartinScharrer Definitely relevant that question but the answer only says don't do [X]. As such it's not as useful as lockstep's answer, which provides an explanation. –  Marc van Dongen Jun 22 '13 at 6:26

The correct way is

\begin{figure}
\centering
... (Code for pictures, captions) ...
\end{figure}


\begin{center} ... \end{center} inside a figure environment will result in (generally unwanted) additional vertical space.

Note that while \centering produces proper spacing, manually adding this command to every figure environment (and to every table and custom-made float) is tedious and goes against the idea of separating the content of a document from the format. Even better ways are to add the following to your document preamble (thanks to egreg for the tip):

\makeatletter

or to load the floatrow package which allows to control the justification of float contents from the preamble (with objectset=centering as default).
Also note that \centering is a declaration, not an environment. That \begin{centering} works is an unfortunate consequence of the way environments work internally in LaTeX: The environment foo essentially consist of two macros \foo and \endfoo which are called by \begin{foo} and \end{foo}, respectively (along with some error checking, such as proper nesting). But since \endfoo is called via \csname endfoo\endcsname, that macro doesn't actually have to exist. This means that even stuff such as $\begin{alpha}\end{alpha}$ works (but should of course not be used). –  Villemoes Dec 1 '10 at 10:56
There's also the more esoteric \g@addto@macro\@floatboxreset\centering which, of course, should be preceded by \makeatletter and followed by \makeatother. –  egreg Apr 10 '11 at 14:25
Thanks for mentioning the floatrow package which looks very, very powerful (I should have found that before, now changing all figure/table definitions in my thesis will be quite some work). However, the documentation is so long and there are so many possibilities of configuration, that it will be very hard to figure out the best setup.. is there a tuturial with a "recommended" setup for a twopage thesis? :-( –  Martin Apr 11 '11 at 1:12