TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can I create a logical block (like HTML div element), so I can apply features like \centering locally, but not affect the outside environment?

share|improve this question
You can use them in a group \bgroup.....\egroup. Whatever is used is applied only within that group. – Harish Kumar Sep 15 '12 at 2:30
up vote 15 down vote accepted

Yes. The most basic of these blocks are braces { (for opening) and } (for closing). You can also use \begingroup and \endgroup or \bgroup and \egroup.

When defining your own environment <env>, using \begin{<env>} ... \end{<env>} necessarily forms a group, localizing most modifications.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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