groff
[Top][All Lists]
Advanced

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

[Groff] numbered displays


From: James K. Lowden
Subject: [Groff] numbered displays
Date: Mon, 8 Oct 2012 20:26:47 -0400

My world premier macro pair is below!  What would you do to improve
them?  In particular, what should I do to make them work across page
boundaries?  

The intention is to number a -ms DS display, a la eqn.  Input

.Ds (5)
.DS I
Lorem Ipsum
.DE
.De

Output

        Lorem Ipsum             (5)

When the first line of the display is the first line on the
page -- and only then -- the Ds argument is printed too low by about
1.5 vs.  

Here they are: 

[macros]
.de Ds \" macro to add display number to DS
.ds Dq \\$1
.mk Dp
..
.de De \" used after .DE
.mk                                     \" hold that thought
.\" go to position before display + display length 
.rt ( \\n(Dpu + \\n(dnu )       
.rj 1
\\*(Dq
.br
.rt                                     \" resume
..
[sorcam]

Many thanks for your help. 

--jkl



reply via email to

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