[latex3-commits] [latex3/latex2e] tag-graphics: handle older hyperref versions (c09c5e74)
github at latex-project.org
github at latex-project.org
Sun May 21 11:40:13 CEST 2023
Repository : https://github.com/latex3/latex2e
On branch : tag-graphics
Link : https://github.com/latex3/latex2e/commit/c09c5e74b9227e262a765211896196bd9305588c
>---------------------------------------------------------------
commit c09c5e74b9227e262a765211896196bd9305588c
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sun May 21 11:40:13 2023 +0200
handle older hyperref versions
>---------------------------------------------------------------
c09c5e74b9227e262a765211896196bd9305588c
required/latex-lab/latex-lab-bib.dtx | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/required/latex-lab/latex-lab-bib.dtx b/required/latex-lab/latex-lab-bib.dtx
index 24db1b7a..d9ad2ff2 100644
--- a/required/latex-lab/latex-lab-bib.dtx
+++ b/required/latex-lab/latex-lab-bib.dtx
@@ -140,6 +140,11 @@
\immediate
\write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
% \end{macrocode}
+% we make a copy to be able to reinstate the definition. This is e.g.
+% currently needed with hyperref.
+% \begin{macrocode}
+\let\@kernel at copy@lbibitem\@lbibitem
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@bibitem}
@@ -152,6 +157,7 @@
\AddToHookNext{para/begin}{\makebox[0pt][r]{\MakeLinkTarget*{\l_@@_bib_target_tl}\hspace{\leftmargin}}}
\item\if at filesw \immediate\write\@auxout
{\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces}
+\let\@kernel at copy@bibitem\@bibitem
% \end{macrocode}
% \end{macro}
%
@@ -180,6 +186,7 @@
\UseHookWithArguments{bibcite/after}{2}{#1}{#2}
}%
}%
+\let\@kernel at copy@bibcite\bibcite
% \end{macrocode}
% Now we add the tagging structure.
% TODO: the ref key should expand its argument directly!
@@ -202,8 +209,18 @@
% \begin{macrocode}
\AddToHook{package/hyperref/after}
{
- \AddToHookWithArguments{bibcite/before}{\hyper at linkstart{cite}{cite.#1\@extra at b@citeb}}
- \AddToHookWithArguments{bibcite/after}{\hyper at linkend}
+% \end{macrocode}
+% the next hyperref will allow to suppress the bib patches, but with older
+% versions we muss reinstated them.
+% \begin{macrocode}
+ \@ifpackagelater{hyperref}{2023-05-01}{}
+ {
+ \let\@lbibitem\@kernel at copy@lbibitem
+ \let\@bibitem\@kernel at copy@bibitem
+ \let\bibcite\@kernel at copy@bibcite
+ }
+ \AddToHookWithArguments{bibcite/before}{\hyper at linkstart{cite}{cite.#1\@extra at b@citeb}}
+ \AddToHookWithArguments{bibcite/after}{\hyper at linkend}
}
% \end{macrocode}
%
More information about the latex3-commits
mailing list.