Re: footnotes in nodes
Hans Hagen via ntg-context <[email protected]> Mon, 3 Aug 2026 09:40:39 +0200
| Newsgroups | gmane.comp.tex.context |
|---|---|
| Message-ID | <[email protected]> |
On 8/3/2026 2:24 AM, Jim Diamond via ntg-context wrote:
> 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?
Yes, we hash content and render once ... keep in mind that we're talking
graphics and when you have multiple copies you want them the same. In
this case, if you really want a different number add something ({} will
do).
Most of these interfaces originate in mkii, so decades old, and we
always try to be compatible when possible.
Keep in mind that mp doesn't really do text out of its own. You can add
to the bottom of your already long list "look into the way mp typesets
text, btex/etec and such".
> 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.
textext ... one with suffixes .top .left etc and also one normally will
add a \strut in the text
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________