What is the correct way to center figures and tables (figure
, table
)?
\begin{center}
...
\end{center}
or
\begin{centering}
...
\end{centering}
floatshorizontal alignment
What is the correct way to center figures and tables (figure
, table
)?
\begin{center}
...
\end{center}
or
\begin{centering}
...
\end{centering}
Best Answer
The correct way is
\begin{center}
...\end{center}
inside afigure
environment will result in (generally unwanted) additional vertical space.Note that while
\centering
produces proper spacing, manually adding this command to everyfigure
environment (and to everytable
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):or to load the
floatrow
package which allows to control the justification of float contents from the preamble (withobjectset=centering
as default).