Text FormattingHow to control underline length

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Jill D Holloman
Posts: 1
Joined: Fri Mar 15, 2019 6:18 pm

How to control underline length

Post by Jill D Holloman »

Hi there,

I have a question about underline:basically I want to get the effect that make the underline span all the textwidth, is there anyway to achieve it?

I search lots of solution, no luck.

Thanks a lot.

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

How to control underline length

Post by Stefan Kottwitz »

Hi Jill,

welcome to the forum!

Instead of directly underlining text, you could put that text into a box and underline that box:

Code: Select all

\documentclass{article}
\begin{document}
\noindent
\underline{\makebox[\textwidth][c]{Some text}}
\end{document}
Stefan
LaTeX.org admin
Post Reply