13

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?

2 Answers 2

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}
6
  • 3
    I'd actually use the default rulethickness of the math font (\fontdimen8\textfont3) which would fall in your “anorexic” category. Aug 18, 2020 at 4: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. Aug 18, 2020 at 5: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? Aug 19, 2020 at 1: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, 2022 at 5:39
  • @PatrickT - Please provide some specific examples of what you’re doing. Thanks.
    – Mico
    Apr 29, 2022 at 9:13
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

2
  • Great answer. Can this be used for 'underbrace' and 'overbrace' as well? if so how so? Jan 2, 2021 at 21:27
  • 1
    @guillermoedgardo No. Braces use the glyphs in math fonts, but brackets are drawn by latex rules. Jan 3, 2021 at 9:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .