# Underline Style

I want to make bold underline.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{contour}
\usepackage{ulem}

\renewcommand{\ULdepth}{1.8pt}
\contourlength{0.8pt}

\newcommand{\myuline}[1]{%
\uline{\phantom{#1}}%
\llap{\contour{white}{#1}}%
}
\begin{document}

\myuline{bold underline}

\end{document}
• That's not the problem. The problem is that the underline is not one but two lines. @miko Sep 19, 2021 at 8:49
• I edited the post Sep 19, 2021 at 9:06

(WARNING: This answer addresses the initial format of the posting above. After posting this answer, I noticed that the OP had radically changed the question's setup and associated code. For instance, the \myunder macros is no longer either defined or used. Hence, this answer may not be of much use to either the OP or to future readers of this posting. Oh well.)

Even if you were to change the vertical offset in \dunderline from 0.5pt to 0.4pt, the macro \myunder would still suffer from two major defects:

• If the argument of \myunder contains a letter that reaches below the baseline -- such as g, j, p, q, and y -- the macro draws two separate thin lines rather than one thick line. Moreover, the upper thin line intersects with the letter(s) that have a component that falls below the baseline. (I think the \smash directive may be responsible to this unfortunate property.)

• If two consecutive \myunder directives occur, the whitespace between the two groups of words is too big.


\documentclass{article}
\usepackage[utf8]{inputenc}
\newcommand\dunderline[2][.4pt]{ % use 0.4pt, not 0.5pt
\raisebox{-#1}{\underline{\raisebox{#1}{\smash{\underline{#2}}}}}}
\newcommand{\myunder}{\dunderline}

\usepackage[normalem]{ulem} % for "\uline" macro

\begin{document}

Using \texttt{\string\myunder}

\myunder{thick underlining} \myunder{text}

\medskip
Using \texttt{\string\uline}

\uline{thin underlinining} \uline{text}

\renewcommand\ULthickness{.8pt} % <-- double the default width

\uline{thick underlinining} \uline{text}

\end{document}
• Thank you for solving my problem @Mico Sep 19, 2021 at 9:17

Use the package bm

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{contour}
\usepackage{ulem}

\renewcommand{\ULdepth}{1.8pt}
\contourlength{0.8pt}

\newcommand{\myuline}[1]{%
\bfseries %<<<<<<<<<<<<<<<<
\uline{\phantom{#1}}%
\llap{\contour{white}{#1}}%
}
\begin{document}

\myuline{bold underline}
\bigskip

\myuline{bold linguistic}

\end{document}