On 8/4/2020 11:04 AM, Henning Hraban Ramm wrote:
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 bad MWE ... took me more time to se that \Idx was not used than this:
\appendtoks \setsystemmode\currentnote \to \everysynchronizenote can you check if that works ok? 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 -----------------------------------------------------------------