Skip to content

Commit

Permalink
LaTeX: comment out footnote mark enhancement for footnote environment
Browse files Browse the repository at this point in the history
Page detection left to apply as was case before this PR, i.e. only for
the \sphinxfootnotemark mark-up, which means either in combination
with footnotetext environment, or for multiply referred-to footnotes
and the extra footnote marks additional to the initial one.

This is to avoid a problem with each LaTeX pass in certain circumstances
modifying the aux file, and latexmk consequently complaining.

refs:
sphinx-doc#10191 (comment)
  • Loading branch information
jfbu committed Feb 14, 2022
1 parent 5c0ad0b commit 6fefa2f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions sphinx/texinputs/sphinxpackagefootnote.sty
Expand Up @@ -192,26 +192,30 @@
\unrestored@protected@xdef\@thefnmark{\thempfn}%
\endgroup
% -- Sphinx specific:
\global\let\spx@saved@thefnmark\@thefnmark
% this is done to access robustly the page number where footnote mark is
\refstepcounter{sphinxfootnotemark}\label{footnotemark.\thesphinxfootnotemark}%
% if possible, compare page numbers of mark and footnote to define \@thefnmark
\ltx@ifundefined{r@\thesphinxscope.footnote.#1}%
{}% one more latex run is needed
{\sphinx@xdef@thefnmark{#1}}% check of page numbers possible
% currently commented out due to
% https://github.com/sphinx-doc/sphinx/pull/10191#issuecomment-1038807448
% \global\let\spx@saved@thefnmark\@thefnmark
% % this is done to access robustly the page number where footnote mark is
% \refstepcounter{sphinxfootnotemark}\label{footnotemark.\thesphinxfootnotemark}%
% % if possible, compare page numbers of mark and footnote to define \@thefnmark
% \ltx@ifundefined{r@\thesphinxscope.footnote.#1}%
% {}% one more latex run is needed
% {\sphinx@xdef@thefnmark{#1}}% check of page numbers possible
% --
\@footnotemark
\def\FNH@endfntext@fntext{\@footnotetext}%
% -- Sphinx specific:
% we need to reset \@thefnmark as it is used by \FNH@startfntext via
% \FNH@startnote to set \@currentlabel which will be used by \label
\global\let\@thefnmark\spx@saved@thefnmark
% currently commented out (see above)
% \global\let\@thefnmark\spx@saved@thefnmark
% --
\FNH@startfntext
% -- again Sphinx specific
% \@currentlabel as needed by \label got set by \FNH@startnote
% insert this at start of footnote text then the label will allow
% to robustly know on which page the footnote text ends up
% currently only of use for extra footnote marks so in case footnote multiply referred
\phantomsection\label{\thesphinxscope.footnote.#1}%
}%
\def\FNH@footnotetext{%
Expand Down

0 comments on commit 6fefa2f

Please sign in to comment.