12

Consider this code,

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
C(s)=\underbracket{\frac{K_1}{s}}_{\text{forced}}+\underbracket{\frac{K_2}{s+2}+\frac{K_3}{s+4}+\frac{K_4}{s+5}}_{\text{natural}}
\]
\end{document}

and the result below

enter image description here

I think the underbracket is too thick. How to make it thinner?

Sukan
  • 849

2 Answers2

17

Excerpting from p. 14 of the user guide of the mathtools package (highlighting added):

enter image description here

The user guide says that the default width of underbrackets is ca 5/18ex = ca. 0.28ex. The following screenshot shows expressions with underbrackets that involve the default width as well as one half, two thirds, and three quarters of the default width; choose your favorite.

enter image description here

\documentclass{article}
\usepackage{mathtools} % for '\underbracket' macro
\begin{document}
\[
% default width: 5/18ex = ca 0.28ex
 \underbracket{1+2+3}_{\text{default}} % default width
+\underbracket[0.140ex]{1+2+3}_{\text{spaghetti}}% (1/2)default
+\underbracket[0.187ex]{1+2+3}_{\text{skinny}}   % (2/3)default
+\underbracket[0.210ex]{1+2+3}_{\text{thin}}     % (3/4)default
+\underbracket[0.280ex]{1+2+3}_{\text{default}}  %      default
\]
\end{document}
Mico
  • 506,678
  • 3
    I'd actually use the default rulethickness of the math font (\fontdimen8\textfont3) which would fall in your “anorexic” category. – Henri Menke Aug 18 '20 at 04:51
  • 1
    Oh no, not at all. The information about the default line width of \underbracket is entirely correct, but it doesn't acutally use the default rulethickness that is defined in the font. The value of \fontdimen8\textfont3 is for instance used to draw the fraction bar and is the default height of \hrule. – Henri Menke Aug 18 '20 at 05:07
  • 3
    Done. Thanks Mico. @HenriMenke we are scraping "anorexic" from this answer out of respect for those struggling with anorexia. Could you help us out too? – jessexknight Aug 19 '20 at 01:24
  • Was looking for this, but for some reason none of the size options work for me. I have loaded mathtools and am using beamer. I do have many other packages loaded. Can you think of a potential incompatibility? Many thanks! – PatrickT Apr 29 '22 at 05:39
  • @PatrickT - Please provide some specific examples of what you’re doing. Thanks. – Mico Apr 29 '22 at 09:13
  • Thanks Mico. The problem is that my minimal examples work fine so I haven't been able to find the culprit. Perhaps there's a package out there that defines an \underbracket command... Not to worry, thanks for your reply! – PatrickT Apr 29 '22 at 21:10
11

The thickness of brackets can be specified in the first optional argument of \underbracket and \overbracket. The default thickness is the height of $\braceld$ (in current math font).

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
  C(s) = 
  % use 0.5 thickness
  \underbracket[.5pt]{\frac{K_1}{s}}_{\text{forced}} + 
  % use default thickness
  \underbracket{\frac{K_2}{s+2}+\frac{K_3}{s+4}+\frac{K_4}{s+5}}_{\text{natural}}
\]
\end{document}

enter image description here

You can also change the thickness of brackets once for all:

\documentclass{article}
\usepackage{mathtools}
\usepackage{xpatch}

% change default thickness of brackets to .6pt \MHInternalSyntaxOn \xpatchcmd\upbracketfill {\sbox\z@{$\braceld$}\edef\l_MT_bracketheight_fdim{\the\ht\z@}} {\edef\l_MT_bracketheight_fdim{.6pt}} {}{\fail}

\xpatchcmd\downbracketfill {\sbox\z@{$\braceld$}\edef\l_MT_bracketheight_fdim{\the\ht\z@}} {\edef\l_MT_bracketheight_fdim{.6pt}} {}{\fail} \MHInternalSyntaxOff

\begin{document} [ C(s) = \underbracket{\frac{K_1}{s}}_{\text{forced}} + \overbracket{\frac{K_2}{s+2}+\frac{K_3}{s+4}+\frac{K_4}{s+5}}^{\text{natural}} ] \end{document}

enter image description here

muzimuzhi Z
  • 26,474