Re: footnotes in nodes

Jim Diamond via ntg-context <[email protected]> Sun, 2 Aug 2026 21:24:05 -0300
Newsgroups gmane.comp.tex.context
Message-ID <[email protected]>
On Sun, Aug  2, 2026 at 23:20 (+0200), Hans Hagen via ntg-context wrote:

> On 8/2/2026 8:07 PM, Jim Diamond via ntg-context wrote:
>> On Sun, Aug  2, 2026 at 12:27 (+0200), juh+ntg-context--- via ntg-context wrote:

>>> Am 01.08.26 um 19:36 schrieb Thomas Meyer:

>>> > \starttext

>>> > \startnodes [dx=1.75cm, dy=1cm]
>>> > \placenode [0,0] {bla}
>>> > \placenode [1,0] {bla\footnote{oh}}
>>> > \placenode [2,-1] {blaa\footnote{mhm}}
>>> > \placenode [3,0] {blubs}
>>> > \stopnodes

>>> > \stoptext
>>> Is it only me or do you also see a shift in the lineheight at 1,0 and 3,0??

>> I see the second "bla" to be a tiny bit higher than the first "bla" and
>> "blubs".

>> I also see the footnotes starting at 3.  Does anyone else see that?  If so,
>> does that somehow make sense?

> i'm not in notes modes ... anyway, this is what happens:

> - for various reasons we process textexts twice
> - but not always
> - so we cannot use trialmode
> - we couldn't anyway because different note tags would result in dimensions
> being off
> - this kind of usage is rare so we don't take it into account

> one way out is:

> \enabletrackers[metapost.textexts]

> \starttext

> \enabledirectives[metapost.text.fasttrack]

> \startMPcode
> draw textext("one \footnote{one}") withcolor red ;
> draw textext("two \footnote{two}") xshifted 1cm ;
> draw textext("two \footnote{two}") xshifted 2cm ;
> \stopMPcode

> \disabledirectives[metapost.text.fasttrack]

> \startMPcode
> draw textext("one \footnote{one}") withcolor red ;
> draw textext("two \footnote{two}") xshifted 1cm ;
> draw textext("two \footnote{two}") xshifted 2cm ;
> \stopMPcode

> \stoptext

> which forces single pass mode but one looses the color option. Now, given
> time and motivation i can look into modernizing this (read: use mkxl
> features) but this is not code one wants to take risks with so it might be a
> secondary mechanism.

> I'll think abnout it once we are done with other metafun stuff we're working
> on.

Hans,

thanks for that.  Is it expected that the first footnotes are numbered
        1 2 2
rather than 1 2 3?


Bonus question: why does having a footnote marker ("superscript") adjust
the vertical position of the baseline of the text?  That is, in

\enabletrackers[metapost.textexts]

\starttext

\enabledirectives[metapost.text.fasttrack]

\startMPcode
draw textext("one \footnote{one}") withcolor red ;
draw textext("two") xshifted 1cm ;
draw textext("two \footnote{two}") xshifted 2cm ;
\stopMPcode

\disabledirectives[metapost.text.fasttrack]

\startMPcode
draw textext("one \footnote{one}") withcolor red ;
draw textext("two") xshifted 1cm ;
draw textext("two \footnote{two}") xshifted 2cm ;
\stopMPcode

\stoptext

we can see that the "two"s without footnotes have a baseline a tiny bit
lower than the other words.


                                Jim

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________