I found that
\center
\begin{tabular}{...}
...
\end{tabular}
and
\centering
\begin{tabular}{...}
...
\end{tabular}
both make the following table centered.
My questions are:
- Are
\centerand\centeringthe same? What is the difference between them? - Are they both commands? What are the scopes that they apply to?
(note that in the examples, there are no
tableenvironment.)
Thanks!
\centeris what happens "under the hood" when you callbegin{center}(and on the other end,\end{center}shows up as\endcenter), while\centeringjust applies to the entire current scope. Thus, if I'm correct, you should either use\centeringor the environment, but never\center. (The reason I'm writing this as a comment and not an answer is that I'm too uncertain, so don't shoot me if I'm wrong :P...) – Tomas Aschan May 18 '12 at 00:22\centerand\begin{center}the same thing? – Tim May 18 '12 at 00:24\begin{center}...\end{center}is more-or-less equivalent to{\center...}, so\centerhas a global effect whereas\begin{center}...\end{center}has a local effect. – yo' May 18 '12 at 00:32\commandand\endcommandsyntax and by skipping lots of details it is the LaTeX version ofcenterenvironment. See egreg's answer for more details. But I didn't claim it so anyway. There are lots of well-answered similar questions on this site please have a search on this site too and open a new question if they don't address your concerns. – percusse May 18 '12 at 00:40