groff
[Top][All Lists]
Advanced

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

Re: [groff] mark/lineup in eqn


From: Ingo Schwarze
Subject: Re: [groff] mark/lineup in eqn
Date: Wed, 2 May 2018 00:34:07 +0200
User-agent: Mutt/1.8.0 (2017-02-23)

Hi Doug,

Doug McIlroy wrote on Tue, May 01, 2018 at 05:34:42PM -0400:

> Fellow groffers, what do you think of generalizing the application
> of "mark" and "lineup" in eqn to work in columns and piles as
> well as in separately displayed equations.
> 
> A typical use of mark and lineup is to align = signs in
> a sequence of equations. If the = signs signify steps of a
> derivation, the equations should obviously be connected,
> as in a pile. Displaying them separately, each with its
> own EQ-EN, spreads them out vertically. One can play
> with number registers (e.g. PD and DD in -ms) to try
> to get the pile-like resultts, but it would much cleaner
> if that could happen for free.

I suspect motivation for implementing that feature may have been
limited in the past because it seems to me that, if you want
to have the logical equations as lines within one physical .EQ,
you can already do that with piles or matrixes and do not need
the mark/lineup feature in the first place.

Both of the following work for me:

.EQ
rpile { xhortid above longidentifier }
cpile { \|=\| above = }
lpile { expression1 above expression2 }
.EN

Or:

.EQ
set column_sep 35
matrix {
  rcol { xhortid above longidentifier }
  ccol { = above = }
  lcol { expression1 above expression2 }
}
.EN

The first one is of course more concise and works better
if the left or right hand side of one of the equations
contains a matrix.

> There is even a situation that EQ-EN can't handle, but
> piles could:
> .EQ L
> xhortid mark = expression1
> .EN
> .EQ
> longidentifier lineup = expression2
> .EN
> The marked place doesn't leave room for the subsequent
> lineup. Piles, being typeset as a whole, would be
> immune to this trouble.

Right, with mark/lineup, you would need

.nr myw \w'\fIlongidentifier\fP'-\w'\fIxhortid\fI'
.in +\n[myw]u

before your code and

.in -\n[myw]u

afterwards, and that is not a real option once the
expressions become more complicated.

Yours,
  Ingo



reply via email to

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