I need a newcommand like
\underbrace{}_{},
but I want a parenthese like that ( instead of {.
I need a newcommand like
\underbrace{}_{},
but I want a parenthese like that ( instead of {.
Here's the variant of \underbrace without the piece in the middle:
\documentclass{article}
\makeatletter
\newcommand\underparen[1]{%
\mathop{%
\vtop{
\m@th
\ialign{%
##\crcr
$\hfil\displaystyle{#1}\hfil$\crcr
\noalign{\kern3\p@\nointerlineskip}%
\upparenfill\crcr
}%
}%
}\limits
}
\newcommand\upparenfill{%
$\m@th\setbox\z@\hbox{$\braceld$}%
\bracelu\leaders\vrule \@height\ht\z@ \@depth\z@\hfill\braceru$%
}
\makeatother
\begin{document}
$\underparen{abcdef}_{x}$
\end{document}
The small misalignment is only apparent, due to pixel rounding at low resolution.
Here I do it with stacks.
\documentclass{article}
\usepackage{amsmath,stackengine,graphicx}
\makeatletter
\newcommand\underparen[1]{\@ifnextchar_{\uphelp{\uparen{#1}}}{\uparen{#1}}}
\makeatother
\def\uphelp#1_#2{\ensurestackMath{\stackunder[1pt]{#1}{\scriptstyle #2}}}
\newcommand\uparen[1]{\setbox0=\hbox{$#1$}\ensurestackMath{%
\stackunder[0pt]{#1}{\rotatebox{90}{$\left(%
\rule[\dimexpr-.5\wd0+\dp\strutbox-1.3pt]{0pt}{\wd0}\right.$}}%
}}
\begin{document}
\[
\underbrace{x^2 + y^2 + z^2}_{a}\quad
\underparen{x^2 + y^2 + z^2}\quad
\underparen{x^2 + y^2 + z^2}_{a}\quad
\]
\[
\underbrace{abcde}_{a}\quad
\underparen{abcde}\quad
\underparen{abcde}_{a}\quad
\]
\end{document}
If you dont know it yet, you also might consider using the \underbracket command from mathtools, which looks nice and may be customised (height and thickness). Of course there's also an \overbracket command:
\documentclass[10pt]{article}
\usepackage{mathtools} %
\providecommand\given{}
\DeclarePairedDelimiterXPP\EV[1]{E}(){}{
\renewcommand\given{\nonscript\,\delimsize\vert\nonscript\,}
#1}
\DeclarePairedDelimiterXPP\Var[1]{V}(){}{
\renewcommand\given{\nonscript\,\delimsize\vert\nonscript\,}
#1}
\begin{document}
\begin{align}
V(\varepsilon)&=\overbracket[0.4pt]{ E_{X}(\Var{\varepsilon \given X})}^\text{expected value}+V_{X}(\smash[b]{\underbracket[0.6pt]{\EV{\varepsilon \given X}}_\text{$=0$}})\notag
\\ & =E_{X}(\Var{\varepsilon \given X})\notag \\
&=E(\sigma^{2}_{Y\vert X})
\end{align}
\end{document}
The abraces package ("a" for "asymmetric" or "arbitrary") will do this, and a lot more besides. The optional argument specifies the "design" of the brace. See the package documentation for more.
\documentclass{article}
\usepackage{abraces}
\begin{document}
$\aunderbrace[l1r]{abcdef}_{x}$
\end{document}
\underbrace? – Sean Allred Aug 09 '15 at 16:48\undergroupmacro from themathabxpackage. – Alan Munn Aug 09 '15 at 17:04\undergroupcommand is a math command. The package is part of TeXLive and MikTeX so it should be either already present in your distribution or easily installed. – Alan Munn Aug 09 '15 at 19:22