Text FormattingA long underscore

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
thedoctor818
Posts: 92
Joined: Fri Apr 24, 2009 8:02 pm

A long underscore

Post by thedoctor818 »

Hi,

I am still relatively new to LaTex. I would like to use the underscore.sty package to create a long underscore, i.e. an underscore stretching more than 1 textbox - so that the underscore is not ``broken'' - i.e. it is a continuous line (I do not know if that is the term I am looking for). Below is what I have attempted to do thus far.

Code: Select all

\documentclass[12pt,a4paper]{article}
\usepackage{underscore}
\begin{document}

A Reading from the Epistle of the Holy Apostle Paul to the _________.

\end{document}

-Michael Dykes
-Michael D

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

A long underscore

Post by gmedina »

Hi,

you could try using the \rule or the \hrulefill commands; take a look at the following example:

Code: Select all

\documentclass{article}

\begin{document}

A Reading from the Epistle of the Holy Apostle Paul to the \rule{1cm}{0.4pt}.

A Reading from the Epistle of the Holy Apostle Paul to the \hrulefill.

A Reading from the Epistle of the Holy Apostle Paul to the \hrulefill

\hrulefill.

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

A long underscore

Post by frabjous »

I personally feel that \rule and \hrulefill here put the line a little too far up; they appear to be above the baseline, although only slightly.

Personally I'd use \underline together with \hspace or \hspace*

Compare the following:

Code: Select all

\documentclass{article}

\begin{document}

A Reading from the Epistle of the Holy Apostle Paul to the \rule{1cm}{0.4pt}.

A Reading from the Epistle of the Holy Apostle Paul to the \underline{\hspace*{1cm}}.

\end{document}
thedoctor818
Posts: 92
Joined: Fri Apr 24, 2009 8:02 pm

Re: A long underscore

Post by thedoctor818 »

Thanks for the help; it worked fine.

-Michael
-Michael D
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

A long underscore

Post by gmedina »

frabjous wrote:I personally feel that \rule and \hrulefill here put the line a little too far up; they appear to be above the baseline, although only slightly...
The optional argument of the \rule command can be used to control the vertical position of the rule with respect to the baseline:

Code: Select all

\documentclass{article}

\begin{document}

xxxxx\rule{2cm}{.4pt}xxxxxxx

xxxxx\rule[-2pt]{2cm}{.4pt}xxxxxxx

xxxxx\rule[0.5ex]{2cm}{.4pt}xxxxxxx

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply