The following macro works correctly for enclosing an expression in parenthesis.
\def\group#1{\left ( #1 \right )}
I want to write the equivalent macro for enclosing an expression in square brackets. I have tried the following macro with and without backslash-escaping the the square brackets, but both give errors.
\def\bgroup#1{\left [ #1 \right ] }
How can I define a macro with the desired expansion?
\bgroupis a name used within the LaTeX kernel: did you try with a different name? (\newcommandrather than\defwould tell you this.) – Joseph Wright Oct 29 '13 at 20:24defand the namebgrouptogether. – merlin2011 Oct 29 '13 at 20:35\bgroup,\begingroupand{: When should one use\begingroupinstead of\bgroup? – Qrrbrbirlbel Oct 29 '13 at 20:46\def\fi{whatever}in the preamble. The error message will be much more cryptic. Use\newcommandunless you know precisely what you're doing. Redefining “taken” commands is surely possible, but with great care and not just to glob their original meaning. – egreg Oct 29 '13 at 21:51