[Tex/LaTex] Can a \newcommand Definition Contain Braces as Substitution Text

bracesgroupingmacros

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.

Best Answer

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