I am using the amsmath package and I'd like to control the size of my delimiters manually, i.e. using the \bigl, \Bigl, ... , \Bigr, \bigr commands, instead of \left, \middle, \right.

Now I want to create macros which include delimiters and I want to have the size as an argument. For example, if I have a \set macro:

\newcommand{\set}[2]{ \left\{ #1 \,\middle\vert\, #2\right\} }

I want to change it into a command, where I can give the size as an argument, i.e.


should produce \Bigl\{ A \,\Big\vert\, B\Bigr\} or, even better, \set{A}{B}{2} produces this result.

Is there any command like \leftdelimitersize to implement this kind of macros?

  • The mathtools package has features that should help you. – egreg Mar 17 '13 at 13:20
  • And also this question. Which has a different way of implementing it than the mathtools package. – Manuel Mar 17 '13 at 13:24
  • Something here tex.stackexchange.com/questions/100966/… might help. In that case, \scalerel was used, but if you wish to define the size, the sister routine \scaleto or \stretchto might suffice. – Steven B. Segletes Mar 17 '13 at 15:17

The package mathtools already provides the necessary features; you just have to add the possibility of using numbers instead of the commands \big and siblings.



    \innset{#2}{#3}\or         % 0
    \innset[\big]{#2}{#3}\or   % 1
    \innset[\Big]{#2}{#3}\or   % 2
    \innset[\bigg]{#2}{#3}\or  % 3
    \innset[\Bigg]{#2}{#3}     % 4


With a number not in the range 0–4, the version with \left, \middle and \right would be used.

enter image description here

  • 1
    The numbers are much more memorable than the names! – Ryan Reich Mar 17 '13 at 14:44

If you are prepared to take something like Big as an argument then a simple solution to your request is to use \csname ...\endcsname to generate command names as needed, e.g.,

\newcommand\set[3]{\csname #3l\endcsname\{#1%
                   #2\csname #3r\endcsname\}}

If you want to generate the needed commands via a numerical argument consider using \ifcase.

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.