Open dbitouze opened 2 years ago
This issue has been automatically marked as stale because it has not had recent activity.
I think the suggestion that commands and environments can query the context in which they are used is a good one, but the "context" is far wider than "am I in a footnote?". For this to make sense there should be a general mechanism to define context and also a general one to query it. That is something we have on our radar and it will eventually come. In short, I'm not that keen on introducing individual commands and tests for something like footnotes, because the same is relevant for many other places and such adhoc solutions would then conflict with a general mechanism and and would need to remain supported.
With some restrictions you can have a solution already now (as long as your footnotes do contain stuff that does a \refstepcounter
, after all within a footnote the \@currentcounter
is footnote
:
\makeatletter
\newcommand*\mygls[1]{%
\def\@tempa{footnote}%
\ifx\@tempa\@currentcounter
\acs{#1} (\acl{#1})%
\else
\gls{#1}%
\fi
}%
\makeatother
Brief outline of the enhancement
Something I'm often missing is a way to test whether a stuff is currently in a footnote or not.
A typical use case is for acronyms which, thanks to styles, can be automatically displayed at their first occurrences as ⟨short⟩\footnote{⟨long⟩}. For the first occurrences that happen to appear:
This is illustrated by the following examples.
Minimal example showing the current behaviour
Minimal example showing the desired new behaviour