I want to use the closing bracket in a \newcommand definition. I can give more explanation as to why, but this seems unnecessary at the moment. Obviously the MWE does not work, but how to make this work?




which gives the error

! Too many }'s.
  • Do you want to end a group, or do you want to display the }? Commented Oct 17, 2014 at 13:07
  • End a group. I have another command with an opening bracket, some text in between and then a command with a closing bracket (the one I am asking about now).
    – Ritz
    Commented Oct 17, 2014 at 13:09
  • 2
    then why not use \begingroup and \endgroup?
    – cgnieder
    Commented Oct 17, 2014 at 13:11

1 Answer 1


You can use \bgroup and \egroup to begin and end groups in such circumstances.

\newcommand\test{sheep \egroup}
Pig \bgroup\Huge\test goat

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .