In math I often find that single underlined letters have too long of a line.
Here is an example: $\beta\in[\underline{\beta},\bar{\beta}]$
Or perhaps worse:
I can solve the too narrow bar loading some accents from the mathxm
font of package mathabx
, but I have not found a good way to decrease the width of e.g. \underline{U}
.
I would appreciate a hint.
Here is a summary of different functions. I have added the nunder-function, which is kind of fun. However, it desperately needs an additional optional argument to set the division factor \mkern\the\numexpr#1/2mu\relax
(hard-coded to two).
Two see why compare the following examples of KP-fonts (left) and CM|nunder div by 2 (middle) and CM|nunder div. by 10 (right). On the right image nunder
is perhaps as nice as bunderline
.
nunder
works very well KP-fonts, but performs poorly with CM with the hard-coded value of 2. I will have two look further into two optional arguments, but my first attempt was not a success (using the blah example of TeX Faq).
\documentclass{article}
\usepackage{etex}
\usepackage{amsmath}
\usepackage{mathtools}
\newcommand{\bunderline}[2][4]{\underline{#2\mkern-#1mu}\mkern#1mu}
\newcommand{\boverline}[2][4]{\overline{#2\mkern-#1mu}\mkern#1mu}
\newcommand{\nunder}[2][5]{\mathrlap{\mkern\the\numexpr#1/2mu\relax\underline{\phantom{\mathrm{#2}\mkern-#1mu}}}#2}
\newcommand{\nunderline}[2][4]{%
\ensuremath{\mathrlap{\mkern#1mu\underline{\phantom{\mathrm{#2}\mkern-#1mu}}}}#2}
\begin{document}
\begin{align}
\label{eq:4}
\nunderline[3]{U}\nunderline[3]{\beta}\\
\nunderline[6]{U}\nunderline[6]{\beta}\\
\bunderline[6]{U}\bunderline[2]{\beta}\\
\nunder[6]{U}\nunder[2]{\beta}\\
\nunder[3]{U}\nunder[2]{\beta}
\end{align}
\end{document}
\underline
with\bar
is a bit misguided; replace\bar
with\overline
and you get something visually compatible with\underline
.\bar
is supposed to denote some other variable, like a statistical mean, and this is not what\underline
is supposed to be used for. So your quite legitimate question could have been formulated rather as "is there an\underbar
?".