tags:

views:

50

answers:

1

I have the following line between my \maketitle and my \begin{abstract}:

\center{ \textsc{Some text here} } 

This seems to cause the ENTIRE DOCUMENT to be formatted as centered. Why is this and how should I get around it?

+2  A: 

Try

\begin{center}
    \textsc{Some text here} }  
 \end{center}

instead. center is an environment, meaning it needs to be used with \begin and \end.

Furthermore there is the \centering command which turns on centered alignment for the rest of the block. I assume \center is a similar command from plain TeX.

Joey
`\begin{center}` expands to `\center`; `\end{center}` expands to `\endcenter`, so you’re not actually leaving latex with `\center`.
Debilski
@deb: Ah, thanks for the clarification. Still, I believe, “environments” are meant to be used with `\begin` and `\end`, though so far I didn't know exactly what that translates to. The joy of layers upon layers upon laters of templates/macros. Wikipedia looks the same ;-)
Joey
Yeah, you should use them with `\begin{}` and `\end{}`, because that way, a new `\begingroup` will be started. But that’s just a minor detail, I guess…
Debilski
It's pretty complicated (as is everything in LaTeX's internals) but the gist of it is that `\begin{center}` translates to `\begingroup\center` and `\end{center}` translates to `\endcenter\endgroup` in a "safe" way, i.e. it doesn't generate an error if `\endcenter` isn't defined (although if `\center` isn't defined then it will complain). `\begingroup` and `endgroup` are scope operators, similar to `{` and `}` but without the ability to group arguments or box contents. I.e. `\def\foo{bar}\begingroup\def\foo{baz}\endgroup\foo` will result in `bar`.
Steve
Ok ok, I think it was wise for me to stick to Word ;-)
Joey