# Extensible multiset, or bag, delimiters

The stmaryrd package provides two types of multiset, or bag, delimiters: \lbag and \rbag; and \Lbag and \Rbag.

When I use these commands with the delimiter sizing commands \left and \right (or even \bigl and \bigr), I get a "Missing delimiter" error. Is there a way to use the multiset delimiters in varying sizes?

I am open to using symbols from another package if necessary.

The \scaleleftright and stretchleftright macros of the scalerel package give similar functionality to the \left ... \right syntax. In this case, the optional argument gives the maximum width allowed on the scale. If the width is exceeded, the aspect ratio is adjusted to preserve the limiting width.

\documentclass{arlticle}
\usepackage{stmaryrd,scalerel}
\begin{document}
$\Lbag xyz \Rbag\ = \scaleleftright[1.2ex]{\Lbag}{\frac{xyz}{XYZ}}{\Rbag}$
\end{document}


And if you add a \strut to the numerator and denominator of the \frac, it will look like this:

In the comments discussion, I raised the question on what an extensible version of this glyph might look like. For fun, I constructed one by hand. I don't recommend the implementation, but thought it would be interesting to compare, in visual appearance, to my proposed solution above:

\documentclass{arlticle}
\usepackage{stmaryrd,scalerel,stackengine}
\setstackgap{S}{0pt}
\def\LbagT{\clipbox{0pt 2.6pt 0pt 0pt}{$\Lbag$}}
\def\LbagB{\clipbox{0pt 0pt 0pt 8.5pt}{$\Lbag$}}
\def\RbagT{\clipbox{0pt 2.6pt 0pt 0pt}{$\Rbag$}}
\def\RbagB{\clipbox{0pt 0pt 0pt 8.5pt}{$\Rbag$}}
\begin{document}
$\Lbag xyz \Rbag\ = \scaleleftright[1.2ex]{\Lbag}{\frac{xyz}{XYZ}}{\Rbag}$

$\raisebox{-6pt}{\Shortstack{{\LbagT} {\rule{1pt}{2ex}\kern3pt} {\LbagB}}} \frac{xyz}{XYZ} \raisebox{-6pt}{\Shortstack{{\RbagT} {\kern2.95pt\rule{1pt}{2ex}} {\RbagB}}}$
\end{document}


• Thanks for the answer! I was hoping for symbols that would not adjust the line width or aspect ratio much, but this will do. I'll wait to see if anyone else has a different answer before accepting. – Henry DeYoung Sep 23 '14 at 16:28
• @HenryDeYoung Understood. Indeed, the scalerel package scales individual glyphs, which is not the way that extensible characters like braces are constructed. On the other hand, it is hard to envision this character in an extensible fashion. – Steven B. Segletes Sep 23 '14 at 19:00
• That's a good point. – Henry DeYoung Sep 23 '14 at 19:18
• @HenryDeYoung Please see my addendum on the issue of extensibility. – Steven B. Segletes Sep 24 '14 at 2:29