groff
[Top][All Lists]
Advanced

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

Re: [Groff] Equation Number using mom


From: Caleb
Subject: Re: [Groff] Equation Number using mom
Date: Fri, 25 Oct 2013 00:41:20 -0700 (PDT)

Hi Dale,

Thanks for your suggestion. I prefer the bare groff solution although Kernighan 
mentioned in his A Troff Tutorial that:

In the few cases where existing packages don't do the whole job, the solution 
is not to write an entirely new set of troff instructions from scratch, but to 
make small change to adapt packages that already exist.

Good advice, but not always easy to follow.

-
Caleb



On Friday, October 25, 2013 4:30 AM, Dale Snell <address@hidden> wrote:
 
On Wed, 23 Oct 2013 07:20:18 -0700 (PDT)
Caleb <address@hidden> wrote:

> I have just switch from using tex into using groff and I think
> groff is really cool!  Anyway, I have this question: I want my
> equations to be numbered, so I type
>
>
> .EQ (1)
> z sup 2 = x sup 2 + y sup 2
> .EN
>
> It work well using -me, but it doesn't work using -mom, any
> suggestion?

Hello Caleb,

What documentation I have on eqn (and it isn't much), implied that
plain eqn, without a macro package, could insert an equation
number as you did in your example.  So I experimented and found
that I have misunderstood the docs.  Annoying.  I did some more
experimenting and came up with the following:


.PRINTSTYLE TYPESET
.QUAD LEFT
.START
.EQ
x = f ( y sup 2 / 2 ) + y sup 2 / 2
.EN
.BR
.RIGHT
.RLD 1v
(Equation 1-1)
.LEFT


It's rather a hack, I suppose, but it does work.  It would
be nicer if it was used with MOM's TAB and PAD features.  Alas,
I've not needed to use that part of MOM, so you're on your own.
:-)

If you really want, you can do the same thing with bare groff.  In
fact, that's what I came up with first.


.ad l
.EQ L
x = f ( y sup 2 / 2 ) + y sup 2 / 2

.EN
.br
.ad r
\r(Eqn. 2.4a)


Anyway, I hope this helps.

--Dale

--
"Come, muse, let us sing of rats."  -- James Grainger


reply via email to

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