Text FormattingChange Underline Thickness

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
LavaTyper
Posts: 69
Joined: Sat Feb 11, 2012 2:38 am

Change Underline Thickness

Post by LavaTyper »

How do I change the underline thickness?

I searched all over the internet but came up with two failed solutions:

[1] http://amath.colorado.edu/documentation ... e/ulem.sty

This website just tells me to use \renewcommand, but didn't say how, and by looking around some of the manuals, \renewcommand seems really confusing for me to figure out.

[2] http://www.howtotex.com/other/underlini ... l-package/

This website suggested an easy solution:

Code: Select all

\documentclass[12pt]{article}
\usepackage{soul}

\begin{document}
\setul{}{2pt}

\underline{Some underlined text with a 2pt underline}

\end{document}
but it didn't work.

What do I need to do?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Change Underline Thickness

Post by Stefan Kottwitz »

Hi Andrej,

use \ul instead of \underline, since \ul is the soul package underlining command:

Code: Select all

\documentclass[12pt]{article}
\usepackage{soul}
\begin{document}
\setul{}{2pt}
\ul{Some underlined text with a 2pt underline}
\end{document}
underline.png
underline.png (2.52 KiB) Viewed 15323 times
Stefan
LaTeX.org admin
Post Reply