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 }? 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
    Oct 17, 2014 at 13:09
  • 2
    then why not use \begingroup and \endgroup?
    – cgnieder
    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

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.