Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiset notation in LaTeX

Tags:

latex

Does anyone know how to make (nice looking) double bracket multiset notation in LaTeX, i.e something like (\binom{n}{k}) where there are two outer brackets instead of 1 as in binomial? You can see an example of what I mean in http://en.wikipedia.org/wiki/Multiset under the heading "Multiset coefficients" with the double brackets.

In Wikipedia they typeset it as:

\left(\!\!{n\choose k}\!\!\right)

but although this works well for LaTeX in maths mode, with inline equations the outer bracket becomes much larger than the inner bracket.

I have also tried using

\genfrac{((}{))}{0pt}{}{n}{k}

but it has an error with the double brackets.

I am using \binom as well in my document, so I would like the bracket sizes to be similar for \binom and \multiset.

like image 701
jjh Avatar asked Dec 01 '25 20:12

jjh


2 Answers

You can explicitly specify the size of the brackets via

\big( \Big( \bigg( or \Bigg(

Then use \! for negative space to get the brackets closer to each other.

like image 131
Lagerbaer Avatar answered Dec 04 '25 21:12

Lagerbaer


One can use the e-TeX \middle command as follows:

\newcommand{\multibinom}[2]{
  \left(\!\middle(\genfrac{}{}{0pt}{}{#1}{#2}\middle)\!\right)
}

This assumes that you are using the AMSmath package. If not, replace \genfrac with the appropriate construct using \atop.

(Of course this is a hack: the proper solution would be scalable glyphs for the doubled parenthesis, but I can't find any fonts that provide it.)

I'm surprised it wasn't googlable either, so I'll provide a solution here for posterity's sake.

like image 39
Carl Hamilton Avatar answered Dec 04 '25 19:12

Carl Hamilton