Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
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… 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
Thanks a lot for those links. – Greyfox Mar 17 '13 at 16:29

2 Answers 2

up vote 14 down vote accepted

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

share|improve this answer
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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.