[Tex/LaTex] Multiset notation in LaTeX

amsmathmath-mode

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 wikpedia they typset 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.

Thanks for any help. I'm surprised I can't find a solution on google.

Best Answer

I got the definition below after some tinkering. It seems to look fine at any size.

\documentclass[a4paper,12pt]{article}
\pagestyle{empty}
\usepackage{mathtools}
\def\multiset#1#2{\ensuremath{\left(\kern-.3em\left(\genfrac{}{}{0pt}{}{#1}{#2}\right)\kern-.3em\right)}}

\begin{document}
Consider an inline multiset, \multiset{n}{k}, or a displayed one,
\[ \multiset{n}{k}, \]
or perhaps even a displayed one with something big up- and downstairs,
\[\multiset{
    {\displaystyle \sum_{j=1}^n n^j}}
    {{\displaystyle \sum_{j=1}^n (-1)^j n^j}}_{n \text{ even}}. 
\]
\end{document}

enter image description here