groff
[Top][All Lists]
Advanced

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

Re: mom footnote belonging to a Heading


From: Heinz-Jürgen Oertel
Subject: Re: mom footnote belonging to a Heading
Date: Mon, 30 Mar 2020 09:47:17 +0200

Am Montag, 30. März 2020, 04:00:37 CEST schrieb Peter Schaffter:
> On Mon, Mar 30, 2020, Heinz-Jürgen Oertel wrote:
> > Am Sonntag, 29. März 2020, 22:04:57 CEST schrieb Peter Schaffter:
> > > On Sun, Mar 29, 2020, Heinz-Jürgen Oertel wrote:
> > > > I have a need to place a foote note to a HEADING, but can not manage
> > > > it.
> > > > Any hint for me?
> > > 
> > > As a workaround, insert this code at the top of your file:
> > >   am HEADING
> > >   
> > >     .ev HEADING
> > >     .vpt 0
> > >     .sp -1
> > >     .vpt
> > >     .nop \v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\h'\w'\\$1'u'\c
> > >   
> > >   ..
> > > 
> > > This allows adding a footnote to any heading level provided that
> > > 
> > >   - no \c is attached to the heading text
> > >   - the footnote is terminated with .FOOTNOTE END BREAK
> > > 
> > > Text after a HEADING or a HEADING+FOOTNOTE must be a PP, EPIGRAPH,
> > > QUOTE,
> > > BLOCKQUOTE, CODE, or another HEADING.  If not, insert
> > > 
> > >   .br
> > >   .ev 0
> > > 
> > > after the HEADING.
> > 
> > works not perfect, sorry, attached the result as screen shot.
> > You see the foot note number just behind the capital letter 'B'
> 
> You neglected to say you were centering your headings. :)


yeah, that's because of the flexibility of the HEADING macro :-)


> The following amended code should take care of the problem:
> 
>   .am HEADING
>   . ev HEADING
>   . shift \\n[.$]-1
>   . vpt 0
>   . sp -1
>   . vpt
>   . nr heading_w \w'\\$1'
>   . nr center_i \\n[.l]+\\n[.i]-\\n[heading_w]/2
>   . if \\n[.ce] .in \\n[center_i]u
>   . nop \h'\w'\\$1'u'\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\c
>   ..
> 
> A minor annoyance to this is that you must pop the HEADING
> environment explicitly after the footnote:
> 
>   .HEADING 1 "Aus der Dobrudscha und Bessarabien"
>   .FOOTNOTE
>   Dieser Teil erschien im Jahrbuch 1963 ab Seite 173
>   .FOOTNOTE END BREAK
>   .ev
>   .PP
>   Begin paragraph text...
> 
> Please test.  Further tweaks may be required.

I did, and now it looks very good for me. For now it's a good solution for me.
Thank you Peter.


stay healthy
       Heinz





reply via email to

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