[Top][All Lists]

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

Re: [Groff] tbl footnotes and graph position

From: James K. Lowden
Subject: Re: [Groff] tbl footnotes and graph position
Date: Mon, 28 Nov 2011 23:13:01 -0500

On Tue, 15 Nov 2011 23:52:51 +0100
Tadziu Hoffmann <address@hidden> wrote:

Thank you for taking the time to answer my questions, Tadziu.  I had to
do some more reading and experimenting to understand your suggestions.  

>   .TS
>   box nokeep;
>   c | cb cb | cb s s s s | c
>   c | cb cb |  c c c c c | c
>   n | n  n  |  n n n n n | n.
>       Number  Market  Quintile Average Relative to
> Market Average Stocks Average Q1      Q2
> Q3    Q4      Q5      Q1\[en]Q5 _

I appreciate the boldface and, especially, the en-dash.  

> > 2.  The last two rows in the first table are too tall.
> > I think it's the footnotes, but I don't understand why.
> To determine the height of a text block, groff renders the
> block into a temporary diversion and then reads the height of
> that diversion.  Apparently, the footnotes are also formatted
> into that diversion, and accordingly use up space, which,
> however, is not actually used when the table is finally output,
> since the footnotes are placed outside the table cell.
> A quick fix for this would be to simply ignore the footnotes
> when not in the top-level diversion, like so:
>   T{
>   Annualized Return*
>   .if !'\n(.z'' .ig
>   .FS
>   * (footnote text)
>   .FE
>   ..
>   T}

Pasting your .if line verbatim provoked syntax errors:

        <standard input>:9: zero field width

This line compiles, but has no effect:

        .if ! '\n(.z'' .ig

I added a space after the ! operator.  

AIUI, we're comparing \n(.z -- the name of the current diversion -- to a
zero-length string.  I don't know if a top-level diversion has no
name, but this one does.  If I use this:

Annualized Return\*[*]
.if ! '\n(.z'' .ig
.tm \n(.z
Compounded Annualized Return 
T}      abc

I get this on stderr:

$ make
groff -ms -t -G -p -T dvi -P-l > t.dvi

> A better solution might perhaps be to do this already in
> the FS/FE macros.

That's a little beyond my reach as yet!  I learned enough about writing
macros to know that I can't just write "wrapper" macros, but not enough
to be sure how I might improve on the current GNU ms .FS

Thanks again for your time.  I had hoped footnotes-in-tables was an
easy question.  Now that it's not, it's more interesting.  And
evidently harder than it should be.  


reply via email to

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