6

The following example is completely counter-intuitive, but I need this in a bigger definition I'm not including here.

\newcommand{\openbrace}{{}

I need this to start a nested scope.

Is this possible in LaTeX? I'm getting an error because the TeX engine is viewing this as unbalanced number of braces.

  • 1
    It would help to know what you need it for. If you just want the symbol, then you could use \newcommand{\openbrace}{\{}. If you want to start a group you could use \newcommand{\openbrace}{\begingroup} – Scott H. Jun 18 '13 at 19:02
  • I edited the question. I need to begin a new scope. – Chatterjee Jun 18 '13 at 19:05
  • Does the second option I mentioned above work for you in that case? Actually, just \begingroup might be easier.. – Scott H. Jun 18 '13 at 19:07
  • Yup. Can you please change it to an answer? Thanks a lot! – Chatterjee Jun 18 '13 at 19:08
10

If the intention is to start a new group then you can use

\newcommand{\openbrace}{\begingroup}

or, more simply, just

\begingroup

To close the group, the corresponding macro is \endgroup

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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