[latex3-commits] [latex3/hyperref] develop: allow bib code to be suppressed (c2da037)

github at latex-project.org github at latex-project.org
Thu May 11 20:16:20 CEST 2023


Repository : https://github.com/latex3/hyperref
On branch  : develop
Link       : https://github.com/latex3/hyperref/commit/c2da037dc0f5f875945843b28268ea1a91157f4c

>---------------------------------------------------------------

commit c2da037dc0f5f875945843b28268ea1a91157f4c
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu May 11 20:16:20 2023 +0200

    allow bib code to be suppressed


>---------------------------------------------------------------

c2da037dc0f5f875945843b28268ea1a91157f4c
 hyperref.dtx | 121 ++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 62 insertions(+), 59 deletions(-)

diff --git a/hyperref.dtx b/hyperref.dtx
index c26068e..27a7d30 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -11475,77 +11475,80 @@
 % not expanded immediately, we use \cs{@extra at b@citeb}, so cites in a
 % chapter will link to the bibliography in that chapter.
 %    \begin{macrocode}
-\ltx at IfUndefined{NAT at parse}{%
-  \providecommand*\@extra at binfo{}%
-  \providecommand*\@extra at b@citeb{}%
-  \def\bibcite#1#2{%
-    \@newl at bel{b}{#1\@extra at binfo}{%
-      \hyper@@link[cite]{}{cite.#1\@extra at b@citeb}{#2}%
-    }%
-  }%
-  \gdef\@extra at binfo{}%
+\@ifundefined{hyper at nopatch@bib}
+ {%
+   \ltx at IfUndefined{NAT at parse}{%
+     \providecommand*\@extra at binfo{}%
+     \providecommand*\@extra at b@citeb{}%
+     \def\bibcite#1#2{%
+       \@newl at bel{b}{#1\@extra at binfo}{%
+         \hyper@@link[cite]{}{cite.#1\@extra at b@citeb}{#2}%
+       }%
+     }%
+     \gdef\@extra at binfo{}%
 %    \end{macrocode}
 %    Package |babel| redefines \cmd{\bibcite} with
 %    macro \cmd{\bbl at cite@choice}. It needs to be overwritten
 %    to avoid the warning ``Label(s) may have changed.''.
 %    \begin{macrocode}
-  \let\Hy at bibcite\bibcite
-  \begingroup
-    \@ifundefined{bbl at cite@choice}{}{%
-      \g at addto@macro\bbl at cite@choice{%
-        \let\bibcite\Hy at bibcite
-      }%
-    }%
-  \endgroup
+     \let\Hy at bibcite\bibcite
+     \begingroup
+       \@ifundefined{bbl at cite@choice}{}{%
+         \g at addto@macro\bbl at cite@choice{%
+           \let\bibcite\Hy at bibcite
+         }%
+       }%
+     \endgroup
 %    \end{macrocode}
 % |\@BIBLABEL| is working around a `feature' of Rev\TeX.
 %    \begin{macrocode}
-  \providecommand*{\@BIBLABEL}{\@biblabel}%
-  \def\@lbibitem[#1]#2{%
-    \@skiphyperreftrue
-    \H at item[%
-      \ifx\Hy at raisedlink\@empty
-        \hyper at anchorstart{cite.#2\@extra at b@citeb}%
-          \@BIBLABEL{#1}%
-        \hyper at anchorend
-      \else
-        \Hy at raisedlink{%
-          \hyper at anchorstart{cite.#2\@extra at b@citeb}\hyper at anchorend
-        }%
-        \@BIBLABEL{#1}%
-      \fi
-      \hfill
-    ]%
-    \@skiphyperreffalse
-    \if at filesw
-      \begingroup
-        \let\protect\noexpand
-        \immediate\write\@auxout{%
-          \string\bibcite{#2}{#1}%
-        }%
-      \endgroup
-    \fi
-    \ignorespaces
-  }%
+     \providecommand*{\@BIBLABEL}{\@biblabel}%
+     \def\@lbibitem[#1]#2{%
+       \@skiphyperreftrue
+       \H at item[%
+         \ifx\Hy at raisedlink\@empty
+           \hyper at anchorstart{cite.#2\@extra at b@citeb}%
+             \@BIBLABEL{#1}%
+           \hyper at anchorend
+         \else
+           \Hy at raisedlink{%
+             \hyper at anchorstart{cite.#2\@extra at b@citeb}\hyper at anchorend
+           }%
+           \@BIBLABEL{#1}%
+         \fi
+         \hfill
+       ]%
+       \@skiphyperreffalse
+       \if at filesw
+         \begingroup
+           \let\protect\noexpand
+           \immediate\write\@auxout{%
+             \string\bibcite{#2}{#1}%
+           }%
+         \endgroup
+       \fi
+       \ignorespaces
+     }%
 %    \end{macrocode}
 % Since |\bibitem| is doing its own labelling, call the raw
 % version of |\item|, to avoid extra spurious labels
 %    \begin{macrocode}
-  \def\@bibitem#1{%
-    \@skiphyperreftrue\H at item\@skiphyperreffalse
-    \Hy at raisedlink{%
-      \hyper at anchorstart{cite.#1\@extra at b@citeb}\relax\hyper at anchorend
-    }%
-    \if at filesw
-      \begingroup
-        \let\protect\noexpand
-        \immediate\write\@auxout{%
-          \string\bibcite{#1}{\the\value{\@listctr}}%
-        }%
-      \endgroup
-    \fi
-    \ignorespaces
-  }%
+     \def\@bibitem#1{%
+       \@skiphyperreftrue\H at item\@skiphyperreffalse
+       \Hy at raisedlink{%
+         \hyper at anchorstart{cite.#1\@extra at b@citeb}\relax\hyper at anchorend
+       }%
+       \if at filesw
+         \begingroup
+           \let\protect\noexpand
+           \immediate\write\@auxout{%
+             \string\bibcite{#1}{\the\value{\@listctr}}%
+           }%
+         \endgroup
+       \fi
+       \ignorespaces
+     }%
+  }{}%   
 }{}
 %    \end{macrocode}
 %





More information about the latex3-commits mailing list.