[NTG-context] check if inside footnote

Henning Hraban Ramm texml at fiee.net
Tue Aug 4 11:04:49 CEST 2020


Hi, me again...

Is there a check if a macro is called from inside of a footnote, like a system mode *footnote?
(Same with captions?)

In my current project, index entries should get italic page numbers if they occurr inside of a footnote (or a caption, but that is rare).
I’m using different shortcuts for both cases (that call \index with or without processor), but some paragraphs are very confusing (many long footnotes, or footnotes within footnotes), and I could avoid manually analyzing the structure if my macro could determine on its own if it’s called from a footnote.

Not-working example:


\setupinteraction[state=start]
\defineprocessor[kursiv][style=italicface]

\define[1]\Idx{\doifmodeelse{*footnote}{\index{#1}}{\index[kursiv->]{kursiv->#1}}#1}

\starttext

Text

---
\index[C]{A}{B}\footnote{Inside\index{FN}}\index{BF}
---

\placeregister[index][criterium=all]

\stoptext


This also shows the text-running-into-footnotes problem with both of my ConTeXt versions:
ConTeXt  ver: 2020.01.30 14:13 MKIV beta  fmt: 2020.4.12
ConTeXt  ver: 2020.07.27 16:30 LMTX  fmt: 2020.7.28


Hraban


More information about the ntg-context mailing list