groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Underlining in groff


From: Ted Harding
Subject: Re: [Groff] Underlining in groff
Date: Thu, 30 Jul 2009 19:17:03 +0100 (BST)

On 30-Jul-09 14:24:39, Blake McBride wrote:
> That kind-of works but I have two problems with it.
> 
> 1.  What if I'd rather use MM or MOM?
> 
> 2.  The underline is way too far below the line.  If you try
> underlining a word within a paragraph it almost looks like a line
> in the middle of two text lines. It's is terrible. Basically, the
> bottom of a lowercase "y" should extend through the line.  If it
> doesn't look good then the line is too thick.

The MS '.UL' macro is brief, straightforward, and stand-alone (it
requires no other resources from the MS macros):
.de UL
\Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m'\\$2
..

So you can simply copy it into your own document, whatever macro
package you use. It is also easily customisable. For instance:


.de UL
\Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m'\\$2
..
.ce
.UL "This is my Title
.br
And this is the start of the main text, on the next line, no extra space.
.br
And now we continue \(el
.sp
.de UL
\Z'\\$1'\v'.125m'\D'l \w'\\$1'u 0'\v'-.15m'\\$2
..
.ce
.UL "This is my Title
.br
And this is the start of the main text, on the next line, no extra space.
.br
And now we continue \(el

Note that all the lines in each block of 3 are equally spaced: the
underlining has not caused any extra spacing. And, if you insist on
having the underlining close up to what is being underlined, the
second block illustrates how to do it. However, with the second
definition above, I'm not sure I'd be happy with:

.sp
.UL "This is proper underlining

However, there is scope for further adjustment, of course; and
it is always a matter of taste!
Ted.

> I am having luck with a macro I found (and modified) in Volume II of
> Gehano's book as follows:
> 
> .de Ul
> .nr sL \w'\\$1'u
> .if \\n(.lu-\\n(.ku<=\\n(sLu .br
> \\$1\
> \h'-\\n(sLu'\
> \v'1p'\
> \l'\\n(sLu'\
> \v'-2p'\
> \\$2
> ..
> 
> 
> Thanks for the help.
> 
> Blake McBride
> 
> 
> 2009/7/10 Heinz-Jürgen Oertel <address@hidden>
> 
>> Am Freitag, 10. Juli 2009 schrieb Blake McBride:
>> > Greetings,
>> >
>> > I know about troff using italics, and nroff using underlines, but I
>> > want
>> to
>> > do underlines in groff (troff mode) too.  I searched the net and
>> > found
>> the
>> > ul.tmac (by Werner LEMBERG, version 1.0, 12/18/03).  It partially
>> > works
>> but
>> > not well enough for me.
>> >
>> > See: 
>> > http://osdir.com/ml/printing.groff.general/2003-12/msg00079.html
>> >
>> > If I do:
>> >
>> >     .so ul.tmac
>> >     Some text
>> >     .Underline "Executive Summary"
>> >     and some more text
>> >
>> >
>> > it works fine.  However if I do:
>> >
>> >     .so ul.tmac
>> >     .ce 1
>> >     .Underline "Executive Summary"
>> >
>> > It correctly centers the text but the entire line is underlined
>> > instead
>> of
>> > just the "Executive Summary".
>> >
>> > Also if I do:
>> >
>> >     .so ul.tmac
>> >     .ce 1
>> >     .Underline "Executive Summary"
>> >     and some more text
>> >
>> > An underline starts at the "E" and ends on the middle of the next
>> > line.
>> >
>> > How can this be easily done?
>> >
>> > Thanks.
>> >
>> > Blake McBride
>>
>>
>>
>> May be the much simpler ms macros are working in your case:
>>
>>
>> .LP
>> some text
>> .ce 1
>> .UL "Executive Summary"
>> .LP
>> and more text.
>> And more text.
>> And more text.
>> And more text.
>> And more text.
>> And more text.
>>
>> groff -ms text
>>
>>
>>
>>  Heinz
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 30-Jul-09                                       Time: 19:17:00
------------------------------ XFMail ------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]