In my combinatorics homework I use double parenthesis to represent a multiset. I have referred to all the answers under Multiset notation in LaTeX on how to build such a notation.
However, the double parenthesis looks good alone but when put together with a binomial, it looks very inconsistent.
I used the code that come from this answer https://tex.stackexchange.com/a/5825/91144, which utilizes a \genfrac
with left(
/right)
.
\def\multiset#1#2{\ensuremath{\left(\kern-.3em\left(\genfrac{}{}{0pt}{}{#1}{#2}\right)\kern-.3em\right)}}
Here are four problematic examples
\documentclass{article}
\def\multiset#1#2{\ensuremath{\left(\kern-.3em\left(\genfrac{}{}{0pt}{}{#1}{#2}\right)\kern-.3em\right)}}
\begin{document}
\verb~$\multiset{5}{k}+\multiset{5}{k-1}+\multiset{5}{k-4}$~ \\
$\multiset{5}{k}+\multiset{5}{k-1}+\multiset{5}{k-4}$
\verb~$\sum_{\substack{i+j=15\\i,j\geq0}}\binom{5}{i}\multiset{3}{j}$~ \\
$\sum_{\substack{i+j=15\\i,j\geq0}}\binom{5}{i}\multiset{3}{j}$
\verb~\[ ab\binom{5}{i}123\multiset{3}{j}cd \]~ \\
\[ ab\binom{5}{i}123\multiset{3}{j}cd \]
\verb~\[ \sum{\multiset{5}{k}\multiset{5}{k}} \]~ \\
\[ \sum_{i=0}^{k}{\multiset{m}{i}\multiset{n}{k-i}} \]
\end{document}
- inconsistent height (inline mode)
- inconsistent height with
\binom
(inline mode) - incorrect spacing, comparing to
\binom
(display mode) - inconsistent sizes (display mode)
What I wanted is a notation that looks just similar to \binom{n}{k}
, i.e. size, shape, spacing, etc, while having two pair of parenthesis around. And I expect it to work both inline and in display mode. Thank you :)
\left
and\right
; this is particularly evident in text style. The difference in case 4 is because the-
has a depth (you'd see the same with+
).