groff
[Top][All Lists]
Advanced

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

Re: <OK> [Groff] Strange page header problem


From: M Bianchi
Subject: Re: <OK> [Groff] Strange page header problem
Date: Wed, 28 Sep 2005 08:35:40 -0400

On Wed, Sep 28, 2005 at 10:37:45AM +0800, Lei Ming wrote:
> I encountered a strange problem with page header.
> Following is a small test case. Please process it
> with groff and see the PostScript output.
> 
> .\"______________________________________________
> .de H
> .tl 'X'Y'Z'
> \l'\n(.lu\(rn'
> ..
> .wh 0 H
> .br
> .sp 10.5i
> XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
> XXX XXX XXX XXX XXX XXX XXX XXX XXX Why?
> XXX XXX XXX
> .\"-----------------------------------------------
> 
> I want to put a horizontal line below the .tl part
> in the page header. Since the line is part of the 
> page header, I thought that all the text will come
> below it. However, you can see the string "Why?"
> appears in the page header, above the line.
> 
> It should be a feature, not a bug. So what's the
> right way to get the page header with a line as I
> described above?
> 
> Thank you in advance,
> Lei Ming


One way is to use an environment (.ev) to isolate the header processing from
the body of the document.  E.g.


.\"______________________________________________
.de H
.\"     Any partially collected text is in environment 0.
.\"     Push environment 1 onto the stack to avoid interaction with  ev 0 .
.\"     Note that  .lt  (length of title) is environment specific.
.ev 1
.tl 'X'Y'Z'
\l'\n(.lu\(rn'
.br
.\"     Pop up one environment
.ev
..
.wh 0 H
.br
.sp 10.5i
XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
XXX XXX XXX XXX XXX XXX XXX XXX XXX Why?
XXX XXX XXX
.\"-----------------------------------------------


See section 17 of the Nroff/Troff User's Manual or  .ev  in
        man troff

-- 
 Mike Bianchi
 Foveal Systems

 973 822-2085   call to arrange Fax

 address@hidden
 http://www.AutoAuditorium.com
 http://www.FovealMounts.com




reply via email to

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