Text FormattingHow to control underline length

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
roseandrope
Posts: 1
Joined: Tue Mar 20, 2012 4:30 am

How to control underline length

Post by roseandrope »

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.

Matt

Recommended reading 2024:

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

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

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

How to control underline length

Post by Stefan Kottwitz »

Hi Matt,

welcome to the board!

You could use \rule

Code: Select all

\newcommand{\fullrule}{\rule{\textwidth}{0.5pt}}
or \underline with \makebox:

Code: Select all

\newcommand{\fullunderline}{\underline{\makebox[\textwidth]{}}}
Stefan
LaTeX.org admin
Post Reply