Alright, so obviously if I want to center a certain text I use the enviroment function as followed:

\begin{center} text to be influenced \end{center}

But why can't I instead use the group function to center a certain text like this:

\bgroup \centering text to be influenced \egroup

or

{\centering text to be influenced}

both of the group examples just produce regular, non centered text for some reason. If I leave the \bgroup \egroup // the {} and just do as followed \centering text to be influenced

obviously all the text that follows after \centering gets centered up until I use a different arrangment command. I just don't understand why it's doing nothing if I put the \centering in a group.

Any Help?

PS I'm an absolute noob as you might see.

  • 3
    add a \par before the closing brace/\egroup. – jfbu Sep 20 at 18:36

The paragraph is processed when a \par (or a blank line) is found.

So in your second and third example, the \centering command has no effect when you exit the group, and the paragraph (when finished) will be processed with whatever configuration you had before.

So you should use {\centering text to be centered \par} or

\bgroup 
\centering
Text to be centered

\egroup 

(notice the blank line).

The center environment add a \par before the end (and additional space, too, normally).

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.