groff
[Top][All Lists]
Advanced

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

Re: [Groff] ms.tmac .HD written to footer instead of header


From: Larry Kollar
Subject: Re: [Groff] ms.tmac .HD written to footer instead of header
Date: Mon, 25 Oct 2010 13:46:58 -0400

Cedric Sodhi <address@hidden> wrote: 
 
> I use the ms.tmac macros as a "lightweight" and focused alternative
> to the full fledged me.tmac. On a sidenode, I'm rather new to groff, so
> if someone could correct me on that assumption that me is nothing but
> a completer version of ms, please do so.

The ms, me, and mm packages all have similar goals in mind: format medium to 
large documents. Of the three, I would call the mm package the 
fullest-featured. The ms package is very popular because it was part of most 
*roff distributions and makes a good platform to build upon.

> My issue is that I define the .HD macro as described in the documentation
> (with \l'6i' or anything for that matter), but it's printed just before the 
> footer,
> rather than just after the header.

Ralph answered your question already, you need to add a break (.br) request to 
the end of your HD definition:

.de HD
.ti 0
\l'6i'
.br
..

There's an alternative way to do what you want, by appending the rule to PT 
instead of using HD:

.am PT
\D'l \\n[LT]u 0'
.. 
.P1 
.PP 
Test

I used \D, a more general drawing escape, and used the LT register to define 
the line length (so the line length automatically matches the title width). The 
actual difference is that using HD sets the rule (line) right at the bottom of 
the footer, where appending to PT sets it 1v higher. If you need a little space 
between the rule and your body text, try:

.de HD
.ti 0
.sp -0.5v
\l'6i'
.sp 0.5v
..

The .sp (space) request automatically supplies the needed break, so the rule is 
set where expected.

So there's a couple different ways to get where you want to go. Whichever one 
makes the most sense to you is best. ;-)

-- Larry



reply via email to

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