First of all, \centering
needs a \par
(or an empty line) before the closing brace
{\centering
contents\par
}
Usually it's used inside some environment that provides the necessary \par
, such as minipage
or figure
. Try
abc{\centering def}ghi
to see the effect.
The main difference with center
is that \centering
doesn't leave vertical space before and after it: \begin{center}
is defined in terms of trivlist
.
\def\center{\trivlist \centering\item\relax}
\def\endcenter{\endtrivlist}
\def\centering{%
\let\\\@centercr
\rightskip\@flushglue\leftskip\@flushglue
\parindent\z@\parfillskip\z@skip}
Note that it's an error to use
\center
because this will last “forever” (up to the end of the current group, anyway). The command exists just as a side effect of the existence of the center
environment.