groff
[Top][All Lists]
Advanced

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

Re: [Groff] A progress report


From: Ted Harding
Subject: Re: [Groff] A progress report
Date: Wed, 07 Feb 2007 22:26:07 -0000 (GMT)

On 07-Feb-07 Eric S. Raymond wrote:
> Ted Harding <address@hidden>:
>> I.e., can one set a "global variable2 in MathML? Where, in this
>> case, it would have the value of the offset at the "mark" point,
>> and be called on for setting offsets at subsequent "lineups"?
> 
> Alas, the answer is "no".
> 
> The MathML designers chose a model in which disjoint MathML
> expressions in the same document don't share any global state at all.
> I can't fault them for this, even though it makes the present case
> awkward.

Indeed! In fact, it probably also kills another device I use
in EQN for alignments without resorting to mark/lineup, which
is as follows:

In eqnrc:

.de hphntmsrc
.nr 0h 0
.nr 0d 0
.nr 0skew 0
.nr 0skern 0
.ds 0s \\&\h'\\n(0wu'
..
define hphantom 'vcenter special hphntmsrc'

and then, in an EQ/EN block, I can write

define thing %hphantom{<expression>}

and then "thing" has all dimensions 0 except its width,
which is whatever width eqn assigns to <expression>.

This can be very useful for formatting things which are intended
to come out like

  Z = P + Q/R + U1 + U2
              + V1 + V2
              + W1 + W2

since you could do it as

.EQ
define indent %hphantom{Z ~~=~~ P ~+~ Q/R}%
lpile {
  {Z ~~=~~ P ~+~ Q/R ~+~ U sub 1 ~+~ U sub 2} above
  {indent ~+~ V sub 1 ~+~ V sub 2} above
  {indent ~+~ W sub 1 ~+~ W sub 2}
}
.EN

(and mark/lineup doesn't work inside a single block in a "pile"
context).

I also have "vphantom" which is like "hphantom" only it
has height but no width, and "phantom" which has height
and width). These are useful for planting invisible objects
in order to force the presence of a dimension (e.g. to force
a bracket height in say a "right )" context.

However, these work (and work across separate EQ/EN blocks)
because EQN remembers them for ever unless they are undefined.
I should think that the solipsistic modular structure of
MathML would be totally unaware of this sort of thing!

(Also, the above mechanism is a groff innovation, and is not
present in classic eqn).

Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 07-Feb-07                                       Time: 22:26:03
------------------------------ XFMail ------------------------------




reply via email to

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