groff
[Top][All Lists]
Advanced

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

Re: [Groff] tables side-by-side


From: Ted Harding
Subject: Re: [Groff] tables side-by-side
Date: Sun, 03 Nov 2013 21:09:39 -0000 (GMT)

[See in-line below]

On 02-Nov-2013 22:05:01 James K. Lowden wrote:
> On Sat, 26 Oct 2013 19:16:02 +0100 (BST)
> (Ted Harding) <address@hidden> wrote:
> 
>> Follow-up: I have found the source of your pronblem (the one
>> to do with vertical displacement). When a table is oujtput using
>> the .TS macro, a "display drop" vertical spacing is added (and
>> the same happens for .EQ using eqn, and in other contexts).
>> 
>> You can get rid of this (in ms macros) by setting the "display
>> drop" to zero.
> 
> Many thanks, Ted.  Setting DD to zero did indeed get it closer; I also
> had to set PD to zero.

In fact I also set various such registers to zero (and re-defined the
values of many others)! (ms has been my favourite macro set for decades).
If I want to add spacing, I do it with ".sp ..."; that way I know exactly
what I'm doing, and why. Also, one can do good things in special cases,
For example (with eqn, and setting .DDto 0), first doing it "straight":
-------------------------------

.nr DD 0
.nr PI 2m
.LP
The variable $X$ satisfies
.EQ I
a X sup 3 ~+~ b X sup 2 ~+~ c X ~+~ d ~=~
 {sin ( u ~+~ v )} over {cos ( w~+~ z )}
.EN

-------------------------------

Now .EQ places the whole equation entirely below the line of text above it,
including the "high" part corresponding to thw ratio. This forces down
the first part of the equation.

But note that the equation could be lifted a bit, since the high part
is to the right of the partial line of text:

-------------------------------

.sp
.LP
The variable $X$ satisfies
.sp -0.25m
.EQ I
a X sup 3 ~+~ b X sup 2 ~+~ c X ~+~ d ~=~
 {sin ( u ~+~ v )} over {cos ( w~+~ z )}
.EN

-------------------------------

so that now the first part of the equation is (near enough)
one vertical line-space below the text above, and looks better;
while the higher part of the equation just touches the baseline
of the text above (but since it is off to the right, this is not
noticeable).

> DD isn't mentioned afaik in groff_ms or in usd-17.  That leads me with
> two questions:

Agreed! It should be.

> 1.  Do you find the best way to really understand -ms is to read
> the macros?  I keep hoping just to rely on the documentation.

Yes, I do! In fact, the text of the ms macro file "s.tmac" contains
a lot of (admittedly terse) explanation of what is going on.

> 2.  Is there a good/accepted convention for naming user-defined
> registers?  I used
> 
>       .nr DD1 \n(DD
>       ...
>       .nr DD \n[DD1]
> 
> on the theory that /usr/share/tmac/ms.tmac is unlikely to use register
> names longer than 2 letters. 
> 
> --jkl

All the standard ("public") ms macros have two-letter names, so
in principle using names longer than 2 letters is fine. However,
ms uses a lot of "internal" macros which mostly have long names,
so a bit of care is needed.

Most of these are very long, and many begin with "@" or include "*"
in the name, so are unlikely to be spontaneous choices for users
writing their own macros. Nevertheless, it is useful to open the
file and search through using "\.de" as search term, to see what
is happening. And, of course, if you have thought of a name
(e.g. "MyMac") for your macro, you can search in ther file for
that name.

Hoping this helps!
Ted.

-------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Date: 03-Nov-2013  Time: 21:09:36
This message was sent by XFMail
-------------------------------------------------


reply via email to

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