umoline

The Package for Under/Mid/Overline for Long Texts^{∗}

Hiroshi Nakashima (Toyohashi Univ. of Tech.)

2000/07/11

Abstract

This file provides macros to draw \Underline, \Midline and \Overline with a long text allowing line breaking in the text.

Contents

1 Introduction 2

2 Usage 2 2.1 Basic Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.2 Control Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.3 Explicit Spacing and Line Breaking . . . . . . . . . . . . . . . . . . . . . . . 4 2.4 Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

∗This file has version number v1.1, last revised 2000/07/11.

1 Introduction

Users of TEX and L^{A}TEX often complain that a text with \underline and \overline cannot have line-break points in it. This makes it hard to draw lines under a sentence in order to, for example, show that the sentence is modified by a revision.

Although it is almost impossible to find the perfect solution for the problem, we could have a acceptable approximation by introducing certain reasonable restrictions. For example, macros provided by umoline only accept ordinary texts as their objective texts to draw underline, etc. In fact, many TEXackers have written macros having this restriction, including author’s julem^{1} which copes with texts in both Japanese and English (and other European languages). The style, however, has a few drawbacks including that it consumes a huge amount of computational time and dvi-file space.

The style umoline is designed to solve the problem minimizing the time/space consumption to some acceptable level although still they are not very small. Note that umoline is only for English (and possibly some other European language) and another style jumoline by the author is available for Japanese users.

2 Usage

2.1 Basic Usage

The package is usable to both L^{A}TEX 2ε and L^{A}TEX-2.09 users with their standard package loading declaration. If you use L^{A}TEX 2ε, simply do the following.

     \usepackage{umoline}

If you still love L^{A}TEX-2.09, the following is what you have to do.

     \documentstyle[..,umoline,...]{⟨style⟩}

You have the following three basic commands to draw underlines and relatives.

\Underline  • \Underline{⟨text⟩}

Draw lines under the ⟨text⟩. For example, this sentence is generated by \Underline{

     For Example, . . . }.
\Midline  • \Midline{⟨text⟩}

Draw lines as if hyphens are overlaid on the ⟨text⟩. For example, this sentence is

     generated by \Midline{For Example, . . . }.
\Overline  • \Overline{⟨text⟩}

Draw lines over the ⟨text⟩. For example, this sentence is generated by \Overline{

     For Example, . . . }.

For each command shown above, its argument ⟨text⟩ is the sequence of one of the following elements.

1This style was named by someone who distributed author’s macro set posted to a news group, and thus the author himself does not know the reason why it is called so.

• Ordinary characters excluding those for command invocation and math staffs. For example;

     \Underline{Since this sentence does not have macro invocation nor math
     staffs, you may path it directly to the commands.}

will produce the following result.

Since this sentence does not have macro invocation nor math staffs, you may path it directly to the commands.

• Character string surrounded by ‘{’ and ‘}’. Any string that can be passed to L^{A}TEX’s \mbox is also able to be passed to \Underline and its relatives. Since the string is processed as if it is packed into \mbox, line break will never occur in the string. For example;

     \Underline{The {\textbf{boldface}} part and the math part {$y=x^2$} are
     surrounded by brace pairs because they have special characters.}

will produce the following result.

The boldface part and the math part y = x^2 are surrounded by brace pairs because they have special characters.

• Commands \UMOspace, \UMOnewline and \\ for spacing and line breaking. The usage of them will be shown later.

2.2 Control Lines

The default distance of the lines drawn by \Underline and its relatives from baselines are defined as follows, where b is the value of \baselineskip and a is the height of ‘-’^{2}. Note that positive value means the lines are drawn above baselines, while below baselines if negative.

               \Underline : −0.3b (depth of \strutbox)
                 \Midline : +0.5a
                \Overline : +0.7b (height of \strutbox)

If you wish to draw lines at the position other than the defaults, you may set the following length commands (or dimen register in TeX’s jargon) to some appropriate positive values representing the distance from baselines using \setlength.

\UnderlineDepth  • \UnderlineDepth . . . . . The depth of \Underline
\MidlineHeight  • \MidlineHeight . . . . . . The height of \Midline
\OverlineHeight  • \OverlineHeight . . . . . The height of \Overline

Setting these commands to any negative values makes corresponding lines drawn at the defaults.

\MidlineChar Another position control for \Midline is to change the reference character by \Midline Char{⟨c⟩}. That is, \Midline will be drawn 0.5a above baselines where a is the height of c.

\UMOline Yet another position control can be done by a generalized line drawing command;

\UMOline{⟨height⟩}{⟨text⟩}

This command draw lines ⟨height⟩ above (or below if negative) baselines for the ⟨text⟩.

\UMOlineThickness The thickness of lines is the value set to the length-command \UMOlineThickness, whose default value is 0.4 pt.

2.3 Explicit Spacing and Line Breaking

If the argument ⟨text⟩ has a command invocation, it should be surrounded by ‘{’ and ‘}’ and its result will be packed in a \mbox. Therefore a space inserted by {\hspace{⟨len⟩}} will not disappear when a line is broken just before the space. Commands for line breaking, such as \(no)linebreak, \newline and \\ will not have any effect in \mbox (or cause error).

To solve these problems, the following commands for spacing and line breaking are available.

\UMOspace  • \UMOspace{⟨len⟩}[⟨num⟩]

A space of ⟨len⟩ wide is inserted and will disappear if a line is broken just before the space. The optional argument ⟨num⟩ discourage or encourage the line break at the space. If ⟨num⟩ is non-negative, it discourages line breaking in the same way as the argument of \nolinebreak. If negative, it encourages breaking and its absolute value corresponds to the argument of \linebreak.

Note that if [⟨num⟩] follows ‘*’, ⟨num⟩ is interpreted as the value to pass TEX’s

     \penalty.
\UMOspace*  • \UMOspace*{⟨len⟩}

A space of ⟨len⟩ wide is inserted and will not disappear even if a line is broken at the space.

\UMOnewline  • \UMOnewline, \\
\\

Terminate a line simply leaving space.

\UMOnewline*  • \UMOnewline*, \\*
\\*

Terminate a line leaving underlined (or mid/overlined) space.

2The height of ‘-’ is not the distance between a baseline and the visible short line of the image of ‘-’.

Rather, its invisible part is approximately twice as tall as the distance.

2.4 Remarks

1. No hyphenation will be performed in ⟨text⟩.

2. As other L^{A}TEX’s commands, \verb in ⟨text⟩ may cause an error even if it surrounded by ‘{’ and ‘}’.

3. Also as other L^{A}TEX’s commands, paragraph separator cannot be included in ⟨text⟩ or you will have an error message.

4. Processing time for underlined (or mid/overlined) text is approximately 10 times as long as that for ordinary text. The size of dvi file also enlarged by factor three or so.

Index

Underlined number refers to the page where the specification of corresponding entry is described.

=  \subitem *+\\*+, \main{4}

¯

*+

+,  4,  \underline{4}

baselineskip=  \subitem *+\baselineskip+, 3
documentstyle=  \subitem *+\documentstyle+, 2
hspace=  \subitem *+\hspace+, 4
linebreak=  \subitem *+\linebreak+, 4
Midline=  \subitem *+\Midline+, \main{2}
MidlineChar=  \subitem *+\MidlineChar+, \main{4}
MidlineHeight=  \subitem *+\MidlineHeight+, \main{3}
newline=  \subitem *+\newline+, 4

nolinebreak=  \subitem *+\nolinebreak+, 4
Overline=  \subitem *+\Overline+, \main{2}
OverlineHeight=  \subitem *+\OverlineHeight+, \main{3}
penalty=  \subitem *+\penalty+, 4
strutbox=  \subitem *+\strutbox+, 3
UMOline=  \subitem *+\UMOline+, \main{4}
UMOlineThickness=  \subitem *+\UMOlineThickness+, \main{4}
UMOnewline*=  \subitem *+\UMOnewline*+, \main{4}
UMOnewline=  \subitem *+\UMOnewline+, \main{4}
UMOspace*=  \subitem *+\UMOspace*+, \main{4}
UMOspace=  \subitem *+\UMOspace+, \main{4}
Underline=  \subitem *+\Underline+, \main{2}
UnderlineDepth=  \subitem *+\UnderlineDepth+, \main{3}
usepackage=  \subitem *+\usepackage+, 2