On Friday, 25 August 2023 17:00:23 BST Tadziu Hoffmann wrote:
> I have attached a demonstration file you can use for experimenting.
> (I have used 3 cm margins for this.  Coloring the margins with XX
> (for debugging purposes) only works with the PS device; you can
> safely remove this.)

A slight change and you can colour the margins with pure troff so it works for 
both postscript and pdf:-

groff -Tpdf -P-pa4 -P-e margins.trf > margins.pdf

Cheers

Deri
.\"
.\" ----------------------------------------------------------------
.pl 29.7c
.po 2.5c
.ll 16c
.lt 16c
.\" ----------------------------------------------------------------
.ev 1
.ll 16c
.lt 16c
.gcolor blue
.ft 2
.ev
.\" ----------------------------------------------------------------
.de HD
.ev 1
.XX
.sp |1.5c-1v
.if o .tl '\\*[RH]''%'
.if e .tl '%''\\*[LH]'
.tl ''\v'-0.5v'\D'l \\n[.lt]u 0'''
.sp |3c
.ev
..
.de FO
.ev 1
.sp |29.7c-1.5c-2v
.tl ''\D'l \\n[.lt]u 0'''
.if o .tl '\\*[RF]''%'
.if e .tl '%''\\*[LF]'
.bp
.ev
..
.ds RH right header
.ds LH left header
.ds RF right footer
.ds LF left footer
.wh 0 HD
.wh -3c-1v FO
.\" ----------------------------------------------------------------
.de XX
.vpt 0
.ev XX
.vs 0
.po 0
.sp |0
.fcolor pink
\D'P 21c 0 0 3c -21c 0'
.sp |26.7c
\D'P 21c 0 0 3c -21c 0'
.fcolor
.fl
.po
.vs
.ev
.vpt 1
..
.\" ----------------------------------------------------------------
.ft 3
5.2. Extra line-space.
.ft
.de ZZ
.sp .5
If a word contains a tall construct requiring the output line
containing it to have extra vertical space before and/or after it,
the extra-line-space function \\\\x'N' can be embedded in or attached
to that word.
If N is negative, the output line containing the word will be preceded
by N extra vertical space; if N is positive, the output line containing
the word will be followed by N extra vertical space.
If successive requests for extra space apply to the same line, the
maximum values are used.
The most recently utilized post-line extra line-space is available
in the .a register.
..
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ
.ZZ

Attachment: margins.pdf
Description: Adobe PDF document

Reply via email to