texlive[65586] Master/texmf-dist: lineno (19jan23)

commits+karl at tug.org commits+karl at tug.org
Thu Jan 19 22:02:36 CET 2023


Revision: 65586
          http://tug.org/svn/texlive?view=revision&revision=65586
Author:   karl
Date:     2023-01-19 22:02:35 +0100 (Thu, 19 Jan 2023)
Log Message:
-----------
lineno (19jan23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/lineno/CHANGEs.txt
    trunk/Master/texmf-dist/doc/latex/lineno/COPYING.txt
    trunk/Master/texmf-dist/doc/latex/lineno/README.md
    trunk/Master/texmf-dist/doc/latex/lineno/SRCFILEs.txt
    trunk/Master/texmf-dist/doc/latex/lineno/fnlineno.pdf
    trunk/Master/texmf-dist/doc/latex/lineno/fnlineno.tex
    trunk/Master/texmf-dist/doc/latex/lineno/lineno.pdf
    trunk/Master/texmf-dist/doc/latex/lineno/lineno.tex
    trunk/Master/texmf-dist/doc/latex/lineno/linenoamsmathdemo.pdf
    trunk/Master/texmf-dist/doc/latex/lineno/linenoamsmathdemo.tex
    trunk/Master/texmf-dist/doc/latex/lineno/lnosuppl.pdf
    trunk/Master/texmf-dist/doc/latex/lineno/ulineno.pdf
    trunk/Master/texmf-dist/doc/latex/lineno/ulineno.tex
    trunk/Master/texmf-dist/tex/latex/lineno/ednmath0.sty
    trunk/Master/texmf-dist/tex/latex/lineno/edtable.sty
    trunk/Master/texmf-dist/tex/latex/lineno/fnlineno.sty
    trunk/Master/texmf-dist/tex/latex/lineno/lineno.sty
    trunk/Master/texmf-dist/tex/latex/lineno/vplref.sty

Modified: trunk/Master/texmf-dist/doc/latex/lineno/CHANGEs.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lineno/CHANGEs.txt	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/doc/latex/lineno/CHANGEs.txt	2023-01-19 21:02:35 UTC (rev 65586)
@@ -1,3 +1,8 @@
+CHANGES  for lineno pkg v5.1   2023/01/19:
+
+1. Patch `amsmath` with \AddToHook if possible.
+
+
 CHANGES  for lineno pkg v5.0   2022/07/30:
 
 1. Merge in `linenoamsmath' patches.
@@ -147,11 +152,9 @@
 
 We have devised macros for indexing with line numbers,
 yet we don't take the time to release them officially.
-If you are interested, please ask via
+If you are interested, please ask via http://contact-ednotes.sty.de.vu
 
-    http://contact-ednotes.sty.de.vu
 
-
 CHANGES  for lineno.sty v4.1   2004/10/19:
 
 Extension packages from the Ednotes bundle for enabling

Modified: trunk/Master/texmf-dist/doc/latex/lineno/COPYING.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lineno/COPYING.txt	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/doc/latex/lineno/COPYING.txt	2023-01-19 21:02:35 UTC (rev 65586)
@@ -5,7 +5,7 @@
 % Copyright 1995--2003 Stephan I. Böttcher
 % Copyright 2002--2005 Uwe Lück for versions 4.x and code from former Ednotes
 % Copyright 2011       Uwe Lück for fnlineno.sty/tex/pdf
-% Copyright 2021--2022 Karl Wette for versions 5.x
+% Copyright 2021--2023 Karl Wette for versions 5.x
 %
 % The files can be redistributed and/or modified under
 % the terms of the LaTeX Project Public License; either

Modified: trunk/Master/texmf-dist/doc/latex/lineno/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lineno/README.md	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/doc/latex/lineno/README.md	2023-01-19 21:02:35 UTC (rev 65586)
@@ -1,4 +1,4 @@
-# lineno.sty v5.0, fnlineno.sty v0.55
+# lineno.sty v5.1, fnlineno.sty v0.55
 
 2022-11-29
 
@@ -10,7 +10,7 @@
 - Copyright 1995--2003 Stephan I. Böttcher
 - Copyright 2002--2005 Uwe Lück for versions 4.x and code from former Ednotes
 - Copyright 2011       Uwe Lück for fnlineno.sty/tex/pdf
-- Copyright 2021--2022 Karl Wette for versions 5.x
+- Copyright 2021--2023 Karl Wette for versions 5.x
 
 The files can be redistributed and/or modified under
 the terms of the LaTeX Project Public License; either
@@ -46,12 +46,10 @@
 For being able to use ALL the new `lineno.sty` options, the following files must
 be "visible" to (La)TeX ("visible" explained below for beginners):
 
-```lineno.sty, edtable.sty, ednmath0.sty, ltabptch.sty```
+- `lineno.sty`, `edtable.sty`, `ednmath0.sty`, `ltabptch.sty` -- as above
+  ("Home", note that clicking on "entire directory" suffices);
+- `longtable.sty` -- from the standard LaTeX Tools bundle.
 
-as above ("Home", note that clicking on "entire directory" suffices);
-
-`longtable.sty` -- from the standard LaTeX Tools bundle.
-
 Usage always starts with loading lineno.sty by `\usepackage`.  The remaining
 `.sty` files are loaded automatically on the `lineno.sty` options (and we
 recommend not to load them through [the mandatory argument of] `\usepackage`).

Modified: trunk/Master/texmf-dist/doc/latex/lineno/SRCFILEs.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lineno/SRCFILEs.txt	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/doc/latex/lineno/SRCFILEs.txt	2023-01-19 21:02:35 UTC (rev 65586)
@@ -1,10 +1,10 @@
 ednmath0.sty            2005/01/10 v0.2b math support for lineno/ednotes (ul)
 edtable.sty             2005/10/03 v1.3c arrays with lineno + ednotes (ul)
 fnlineno.sty            2011/01/07 v0.55 numbers to footnote lines (UL)
-lineno.sty              2022/07/30 line numbers on paragraphs v5.0
+lineno.sty              2023/01/19 line numbers on paragraphs v5.1
 vplref.sty              2005/04/25 v0.2a page-line cross-refs
 fnlineno.tex            2011/02/14 documenting fnlineno.sty (UL)
-lineno.tex              2022/07/30 line numbers on paragraphs v5.0
+lineno.tex              2023/01/19 line numbers on paragraphs v5.1
 lnosuppl.tex            2011/02/16 documenting supplementary files
 ulineno.tex             2001/08/03 lineno.sty users manual
 linenoamsmathdemo.tex   2021/09/30 Make amsmath work with lineno

Modified: trunk/Master/texmf-dist/doc/latex/lineno/fnlineno.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/lineno/fnlineno.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lineno/fnlineno.tex	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/doc/latex/lineno/fnlineno.tex	2023-01-19 21:02:35 UTC (rev 65586)
@@ -7,7 +7,7 @@
        of \textsf{fnlineno.sty} as of \UseDateOf{fnlineno.sty}.}}
 % \listfiles                                          %% 2010/12/22
 { \RequirePackage{makedoc}[2010/12/20] \ProcessLineMessage{}
-  \MakeJobDoc{19}{\SectionLevelThreeParseInput}     %% 2010/12/16
+  \MakeJobDoc{17}{\SectionLevelThreeParseInput}     %% 2010/12/16
 }
 \documentclass{article}%% TODO paper dimensions!?
 \input{makedoc.cfg} %% shared formatting settings

Modified: trunk/Master/texmf-dist/doc/latex/lineno/lineno.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/lineno/lineno.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lineno/lineno.tex	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/doc/latex/lineno/lineno.tex	2023-01-19 21:02:35 UTC (rev 65586)
@@ -1,4 +1,4 @@
-\def\fileversion{v5.0}  \def\filedate{2022/07/30}                     
+\def\fileversion{v5.1}  \def\filedate{2023/01/19}                     
 
 \title{\texttt{\itshape
 lineno.sty \ \fileversion\ \filedate
@@ -8,9 +8,9 @@
 \unskip}\author{%
 Stephan I. B\"ottcher
 \\          Uwe L\"uck
+\\          Karl Wette
 \unskip}\date{%
-boettcher at physik.uni-kiel.de
-\\        http://contact-ednotes.sty.de.vu
+\url{https://github.com/latex-lineno/lineno}
 \\}
 
 \documentclass[a4paper,12pt]{article}%D
@@ -103,11 +103,7 @@
 
 Since late 2002, Christian Tapp and Uwe L\"uck have employed
 ~lineno.sty~ for their ~ednotes.sty~, a package supporting
-critical editions---cf.
-\[\mbox{\tt
-http://ednotes.sty.de.vu
-\unskip}\]
----while you find ~ednotes.sty~ and surrounding files in
+critical editions, while you find ~ednotes.sty~ and surrounding files in
 CTAN folder \path{macros/latex/contrib/ednotes}.
 
 Soon, some weaknesses of ~lineno.sty~ showed up, mainly since
@@ -213,6 +209,7 @@
 (New v4.00)               And we use ~\newcommand*~ for
 controlling length of user macro arguments, which has been
 available since December 1994.
+(/New v4.00)
 \begin{code}\begin{verbatim}
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
 \ProvidesPackage{lineno}
@@ -219,7 +216,6 @@
   [\filedate\space line numbers on paragraphs \fileversion]
 \end{verbatim}
 \end{code}
-(/New v4.00)
 
 
 \section{%
@@ -2429,14 +2425,14 @@
 (/New v4.1)
 
 \section{%
-Former package extensions
+Package extensions
 \label{s:Xt}\unskip}
 
-The extensions in this section were previously supplied
+Some of the extensions in this section were previously supplied
 in separate ~.sty~ files.
 
 \subsection{%
-$display math$
+\texttt{displaymath}
 \unskip}\label{ss:display}
 (New v4.3)    From now on, you no longer need to type
 the ~{linenomath}~ environment with the ~\[~, ~{equation}~,
@@ -2712,53 +2708,76 @@
 (New v5.0) Patches ~amsmath~ to work with ~lineno~. These patches used to be
 supplied by the ~linenoamsmath~ package. See ~linenoamsmathdemo.pdf~ for a
 demonstration.
+(/New v5.0)
 
+(/New v5.1) ~lineno~ tries to use \LaTeX's hook management system to patch
+~amsmath~, so that the two packages may be loaded independently. This requires
+the October 2020 release of \LaTeX. As a fallback for older releases, ~lineno~
+tests whether ~amsmath~ had already been loaded (by testing for the presence
+of the ~gather~ command) and if so applies the patches; otherwise if ~amsmath~
+has not been loaded, no patches are applied, and a warning is issued.
+(/New v5.1)
+
 \begin{code}\begin{verbatim}
 \RequirePackage{etoolbox}
  
-\newcommand*\linenoamsmath at patch[1]{%
-  \cspreto{#1}{\linenomath}%
-  \cspreto{#1*}{\linenomath}%
-  \csappto{end#1}{\endlinenomath}%
-  \csappto{end#1*}{\endlinenomath}%
-}
-\newcount\linenoamsmath at ams@eqpen
-\cspreto{math at cr@}{\global\@eqpen\numexpr\@eqpen+\linenoamsmath at ams@eqpen\relax}
-\newcommand*\linenoamsmath at patch@ams[1]{%
-  \cspreto{#1}{%
-    \linenomath%
-    \postdisplaypenalty=0%
+\ifdefined\AddToHook
+  \def\linenoamsmath at patches#1{\AddToHook{package/amsmath/after}{#1}}
+\else
+  \ifdefined\endgather
+    \def\linenoamsmath at patches#1{#1}
+  \else
+    \PackageWarning{lineno}{%
+      `amsmath' must be loaded before `lineno' for patches to be applied}
+    \def\linenoamsmath at patches#1{\relax}
+  \fi
+\fi
+ 
+\linenoamsmath at patches{
+  \newcommand*\linenoamsmath at patch[1]{%
+    \cspreto{#1}{\linenomath}%
+    \cspreto{#1*}{\linenomath}%
+    \csappto{end#1}{\endlinenomath}%
+    \csappto{end#1*}{\endlinenomath}%
+  }
+  \newcount\linenoamsmath at ams@eqpen
+  \cspreto{math at cr@}{\global\@eqpen\numexpr\@eqpen+\linenoamsmath at ams@eqpen\relax}
+  \newcommand*\linenoamsmath at patch@ams[1]{%
+    \cspreto{#1}{%
+      \linenomath%
+      \postdisplaypenalty=0%
+      \global\linenoamsmath at ams@eqpen\interdisplaylinepenalty%
+    }%
+    \cspreto{#1*}{%
+      \linenomath%
+      \postdisplaypenalty=0%
+      \global\linenoamsmath at ams@eqpen\interdisplaylinepenalty%
+    }%
+    \csappto{end#1}{%
+      \global\linenoamsmath at ams@eqpen\z@%
+      \endlinenomath%
+    }%
+    \csappto{end#1*}{%
+      \global\linenoamsmath at ams@eqpen\z@%
+      \endlinenomath%
+    }%
+  }
+  \linenoamsmath at patch{equation}
+  \linenoamsmath at patch@ams{multline}
+  \linenoamsmath at patch@ams{gather}
+  \linenoamsmath at patch@ams{align}
+  \linenoamsmath at patch@ams{alignat}
+  \linenoamsmath at patch@ams{flalign}
+  \let\linenoamsmath at ams@mmeasure\mmeasure@
+  \def\mmeasure@#1{%
+    \global\linenoamsmath at ams@eqpen\z@%
+    \begingroup%
+    \interdisplaylinepenalty=0%
+    \linenoamsmath at ams@mmeasure{#1\\}%
+    \endgroup%
     \global\linenoamsmath at ams@eqpen\interdisplaylinepenalty%
-  }%
-  \cspreto{#1*}{%
-    \linenomath%
-    \postdisplaypenalty=0%
-    \global\linenoamsmath at ams@eqpen\interdisplaylinepenalty%
-  }%
-  \csappto{end#1}{%
-    \global\linenoamsmath at ams@eqpen\z@%
-    \endlinenomath%
-  }%
-  \csappto{end#1*}{%
-    \global\linenoamsmath at ams@eqpen\z@%
-    \endlinenomath%
-  }%
+  }
 }
-\linenoamsmath at patch{equation}
-\linenoamsmath at patch@ams{multline}
-\linenoamsmath at patch@ams{gather}
-\linenoamsmath at patch@ams{align}
-\linenoamsmath at patch@ams{alignat}
-\linenoamsmath at patch@ams{flalign}
-\let\linenoamsmath at ams@mmeasure\mmeasure@
-\def\mmeasure@#1{%
-  \global\linenoamsmath at ams@eqpen\z@%
-  \begingroup%
-  \interdisplaylinepenalty=0%
-  \linenoamsmath at ams@mmeasure{#1\\}%
-  \endgroup%
-  \global\linenoamsmath at ams@eqpen\interdisplaylinepenalty%
-}
 \end{verbatim}
 \end{code}
 

Modified: trunk/Master/texmf-dist/doc/latex/lineno/linenoamsmathdemo.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/lineno/linenoamsmathdemo.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lineno/linenoamsmathdemo.tex	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/doc/latex/lineno/linenoamsmathdemo.tex	2023-01-19 21:02:35 UTC (rev 65586)
@@ -17,8 +17,15 @@
 
 \documentclass{ltxdoc}
 
-\usepackage[leqno]{amsmath}
-\usepackage[mathlines]{lineno}
+\ifdefined\AddToHook
+  \newcommand{\loadorder}{\textsf{lineno} is loaded first, and then patches \textsf{amsmath} using \texttt{\textbackslash AddToHook}}
+  \usepackage[mathlines]{lineno}
+  \usepackage[leqno]{amsmath}
+\else
+  \newcommand{\loadorder}{\textsf{amsmath} is loaded first, and then patched directly by \textsf{lineno}}
+  \usepackage[leqno]{amsmath}
+  \usepackage[mathlines]{lineno}
+\fi
 \usepackage{lipsum}
 \usepackage{hyperref}
 
@@ -39,7 +46,7 @@
 \section*{Demonstration}
 
 This section demonstrates that, with this package, line numbers are correctly
-formatted when using \textsf{amsmath} math environments.
+formatted when using \textsf{amsmath} math environments. \loadorder.
 
 \newcounter{lipsumparagraph}
 \newcommand{\nextlipsum}{\stepcounter{lipsumparagraph}\lipsum[\thelipsumparagraph][1-4]}

Modified: trunk/Master/texmf-dist/doc/latex/lineno/lnosuppl.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/lineno/ulineno.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/lineno/ulineno.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lineno/ulineno.tex	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/doc/latex/lineno/ulineno.tex	2023-01-19 21:02:35 UTC (rev 65586)
@@ -1,4 +1,4 @@
-% Copyright 1995--1999 Stephan I. B"ottcher <stephan at nevis1.columbia.edu>
+% Copyright 1995--1999 Stephan I. Böttcher
 %
 % This program can be redistributed and/or modified under the terms
 % of the LaTeX Project Public License Distributed from CTAN

Modified: trunk/Master/texmf-dist/tex/latex/lineno/ednmath0.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lineno/ednmath0.sty	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/tex/latex/lineno/ednmath0.sty	2023-01-19 21:02:35 UTC (rev 65586)
@@ -1,7 +1,5 @@
 %% Macro package `ednmath0.sty' for LaTeX2e,
-%% copyright (C) 2004 Uwe L\"uck,
-%% http://www.contact-ednotes.sty.de.vu
-%% --author-maintained;
+%% copyright (C) 2004 Uwe Lück
 %% math support for `lineno.sty' and `ednotes.sty'.
 %%
 \def\fileversion{v0.2b} \def\filedate{2005/01/10}
@@ -16,7 +14,7 @@
 %%
 %% Please report bugs, problems, and suggestions via
 %%
-%%   http://www.contact-ednotes.sty@web.de
+%%   https://github.com/latex-lineno/lineno
 %
 %% * MAIN FEATURE *
 %

Modified: trunk/Master/texmf-dist/tex/latex/lineno/edtable.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lineno/edtable.sty	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/tex/latex/lineno/edtable.sty	2023-01-19 21:02:35 UTC (rev 65586)
@@ -1,8 +1,8 @@
-%% `edtable.sty'---Uwe L"uck, direction Christian Tapp.
+%% `edtable.sty'---Uwe Lück, direction Christian Tapp.
 %% LaTeX package for tables with line numbers and
 %% editorial notes.
 %%
-%% Copyright (C) 2003-2005 Uwe L"uck--author-maintained.
+%% Copyright (C) 2003-2005 Uwe Lück
 %%
 \def\fileversion{1.3c} \def\filedate{2005/10/03}
 %%
@@ -15,7 +15,7 @@
 %%
 %% Please send your comments via
 %%
-%%   http://www.contact-ednotes.sty.de.vu
+%%   https://github.com/latex-lineno/lineno
 %%
 %% * USAGE: *
 %

Modified: trunk/Master/texmf-dist/tex/latex/lineno/fnlineno.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lineno/fnlineno.sty	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/tex/latex/lineno/fnlineno.sty	2023-01-19 21:02:35 UTC (rev 65586)
@@ -2,9 +2,7 @@
 \ProvidesPackage{fnlineno}[2011/01/07 v0.55
                            numbers to footnote lines (UL)]
 
-%% Copyright (C) 2010 Uwe Lueck,
-%% http://www.contact-ednotes.sty.de.vu
-%% -- author-maintained in the sense of LPPL below --
+%% Copyright (C) 2010 Uwe Lück
 %%
 %% This file can be redistributed and/or modified under
 %% the terms of the LaTeX Project Public License; either
@@ -15,7 +13,7 @@
 %%
 %% Please report bugs, problems, and suggestions via
 %%
-%%   http://www.contact-ednotes.sty.de.vu
+%%   https://github.com/latex-lineno/lineno
 %%
 %% {\it This work has been supported
 %%  % and is owned      %% wrong, owner is RUB -- 2011/02/09

Modified: trunk/Master/texmf-dist/tex/latex/lineno/lineno.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lineno/lineno.sty	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/tex/latex/lineno/lineno.sty	2023-01-19 21:02:35 UTC (rev 65586)
@@ -3,12 +3,11 @@
 
 Macro file lineno.sty for LaTeX: attach line numbers, refer to them.
                                                                            \fi
-\def\fileversion{v5.0}  \def\filedate{2022/07/30}                     %VERSION
+\def\fileversion{v5.1}  \def\filedate{2023/01/19}                     %VERSION
 
-%%% Copyright 1995--2003 Stephan I. B"ottcher <boettcher at physik.uni-kiel.de>;
-%%% Copyright 2002--2005 Uwe L"uck, http://www.contact-ednotes.sty.de.vu
-%%%                      for version 4 and code from former Ednotes bundle
-%%%                      --author-maintained.
+%%% Copyright 1995--2003 Stephan I. Böttcher
+%%% Copyright 2002--2005 Uwe Lück for versions 4.x and code from former Ednotes
+%%% Copyright 2021--2023 Karl Wette for versions 5.x
 %%%
 %%% This file can be redistributed and/or modified under
 %%% the terms of the LaTeX Project Public License; either
@@ -29,11 +28,9 @@
 %                                                            \unskip}\author{%
 %              Stephan I. B\"ottcher
 %  \\          Uwe L\"uck
+%  \\          Karl Wette
 %                                                              \unskip}\date{%
-%            boettcher at physik.uni-kiel.de
-%  \\        http://contact-ednotes.sty.de.vu
-%% \\        stephan at nevis.columbia.edu
-%% \\        Stephan.Boettcher at cern.ch
+%            \url{https://github.com/latex-lineno/lineno}
 %                                                                          \\}
 %
 %                                      \documentclass[a4paper,12pt]{article}%D
@@ -138,11 +135,7 @@
 %
 % Since late 2002, Christian Tapp and Uwe L\"uck have employed
 % ~lineno.sty~ for their ~ednotes.sty~, a package supporting
-% critical editions---cf.
-%                                                                  \[\mbox{\tt
-%     http://ednotes.sty.de.vu
-%                                                                   \unskip}\]
-% ---while you find ~ednotes.sty~ and surrounding files in
+% critical editions, while you find ~ednotes.sty~ and surrounding files in
 % CTAN folder \path{macros/latex/contrib/ednotes}.
 %
 % Soon, some weaknesses of ~lineno.sty~ showed up, mainly since
@@ -261,6 +254,7 @@
 % (New v4.00)               And we use ~\newcommand*~ for
 % controlling length of user macro arguments, which has been
 % available since December 1994.
+% (/New v4.00)
 %%
 
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
@@ -267,7 +261,6 @@
 %%                                                                [1994/11/04]
 \ProvidesPackage{lineno}
   [\filedate\space line numbers on paragraphs \fileversion]
-% (/New v4.00)
 %%
 %% History of versions:
 %% v1.00 1995/03/31  SIB: first release for Petra's interview transcriptions
@@ -393,6 +386,7 @@
 %%                        \stepcounter{linenumber} (confusion again).
 %% v4.41 2005/11/02  UL:  Raised \CheckCommand*.
 %% v5.0  2022/07/30  KW:  Merge in `linenoamsmath' patches
+%% v5.1  2023/01/19  KW:  Patch `amsmath` with \AddToHook if possible.
 %%
 %% Acknowledgements:
 %% v3.06:  Donald Arseneau, pointed to mparhack.sty.
@@ -2604,14 +2598,14 @@
 % (/New v4.1)
 %
 %                                                                   \section{%
-%               Former package extensions
+%               Package extensions
 %                                                         \label{s:Xt}\unskip}
 %
-% The extensions in this section were previously supplied
+% Some of the extensions in this section were previously supplied
 % in separate ~.sty~ files.
 %
 %                                                                \subsection{%
-%              $display math$
+%              \texttt{displaymath}
 %                                                   \unskip}\label{ss:display}
 %% (New v4.32)
 % (New v4.3)    From now on, you no longer need to type
@@ -2888,53 +2882,76 @@
 % (New v5.0) Patches ~amsmath~ to work with ~lineno~. These patches used to be
 % supplied by the ~linenoamsmath~ package. See ~linenoamsmathdemo.pdf~ for a
 % demonstration.
+% (/New v5.0)
 %
+% (/New v5.1) ~lineno~ tries to use \LaTeX's hook management system to patch
+% ~amsmath~, so that the two packages may be loaded independently. This requires
+% the October 2020 release of \LaTeX. As a fallback for older releases, ~lineno~
+% tests whether ~amsmath~ had already been loaded (by testing for the presence
+% of the ~gather~ command) and if so applies the patches; otherwise if ~amsmath~
+% has not been loaded, no patches are applied, and a warning is issued.
+% (/New v5.1)
+%
 
 \RequirePackage{etoolbox}
 
-\newcommand*\linenoamsmath at patch[1]{%
-  \cspreto{#1}{\linenomath}%
-  \cspreto{#1*}{\linenomath}%
-  \csappto{end#1}{\endlinenomath}%
-  \csappto{end#1*}{\endlinenomath}%
-}
-\newcount\linenoamsmath at ams@eqpen
-\cspreto{math at cr@}{\global\@eqpen\numexpr\@eqpen+\linenoamsmath at ams@eqpen\relax}
-\newcommand*\linenoamsmath at patch@ams[1]{%
-  \cspreto{#1}{%
-    \linenomath%
-    \postdisplaypenalty=0%
+\ifdefined\AddToHook
+  \def\linenoamsmath at patches#1{\AddToHook{package/amsmath/after}{#1}}
+\else
+  \ifdefined\endgather
+    \def\linenoamsmath at patches#1{#1}
+  \else
+    \PackageWarning{lineno}{%
+      `amsmath' must be loaded before `lineno' for patches to be applied}
+    \def\linenoamsmath at patches#1{\relax}
+  \fi
+\fi
+
+\linenoamsmath at patches{
+  \newcommand*\linenoamsmath at patch[1]{%
+    \cspreto{#1}{\linenomath}%
+    \cspreto{#1*}{\linenomath}%
+    \csappto{end#1}{\endlinenomath}%
+    \csappto{end#1*}{\endlinenomath}%
+  }
+  \newcount\linenoamsmath at ams@eqpen
+  \cspreto{math at cr@}{\global\@eqpen\numexpr\@eqpen+\linenoamsmath at ams@eqpen\relax}
+  \newcommand*\linenoamsmath at patch@ams[1]{%
+    \cspreto{#1}{%
+      \linenomath%
+      \postdisplaypenalty=0%
+      \global\linenoamsmath at ams@eqpen\interdisplaylinepenalty%
+    }%
+    \cspreto{#1*}{%
+      \linenomath%
+      \postdisplaypenalty=0%
+      \global\linenoamsmath at ams@eqpen\interdisplaylinepenalty%
+    }%
+    \csappto{end#1}{%
+      \global\linenoamsmath at ams@eqpen\z@%
+      \endlinenomath%
+    }%
+    \csappto{end#1*}{%
+      \global\linenoamsmath at ams@eqpen\z@%
+      \endlinenomath%
+    }%
+  }
+  \linenoamsmath at patch{equation}
+  \linenoamsmath at patch@ams{multline}
+  \linenoamsmath at patch@ams{gather}
+  \linenoamsmath at patch@ams{align}
+  \linenoamsmath at patch@ams{alignat}
+  \linenoamsmath at patch@ams{flalign}
+  \let\linenoamsmath at ams@mmeasure\mmeasure@
+  \def\mmeasure@#1{%
+    \global\linenoamsmath at ams@eqpen\z@%
+    \begingroup%
+    \interdisplaylinepenalty=0%
+    \linenoamsmath at ams@mmeasure{#1\\}%
+    \endgroup%
     \global\linenoamsmath at ams@eqpen\interdisplaylinepenalty%
-  }%
-  \cspreto{#1*}{%
-    \linenomath%
-    \postdisplaypenalty=0%
-    \global\linenoamsmath at ams@eqpen\interdisplaylinepenalty%
-  }%
-  \csappto{end#1}{%
-    \global\linenoamsmath at ams@eqpen\z@%
-    \endlinenomath%
-  }%
-  \csappto{end#1*}{%
-    \global\linenoamsmath at ams@eqpen\z@%
-    \endlinenomath%
-  }%
+  }
 }
-\linenoamsmath at patch{equation}
-\linenoamsmath at patch@ams{multline}
-\linenoamsmath at patch@ams{gather}
-\linenoamsmath at patch@ams{align}
-\linenoamsmath at patch@ams{alignat}
-\linenoamsmath at patch@ams{flalign}
-\let\linenoamsmath at ams@mmeasure\mmeasure@
-\def\mmeasure@#1{%
-  \global\linenoamsmath at ams@eqpen\z@%
-  \begingroup%
-  \interdisplaylinepenalty=0%
-  \linenoamsmath at ams@mmeasure{#1\\}%
-  \endgroup%
-  \global\linenoamsmath at ams@eqpen\interdisplaylinepenalty%
-}
 
 %
 %

Modified: trunk/Master/texmf-dist/tex/latex/lineno/vplref.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lineno/vplref.sty	2023-01-19 21:02:19 UTC (rev 65585)
+++ trunk/Master/texmf-dist/tex/latex/lineno/vplref.sty	2023-01-19 21:02:35 UTC (rev 65586)
@@ -3,8 +3,7 @@
 
 \def\filedate{2005/04/25} \def\fileversion{0.2a}
 
-%% Copyright (C) 2004, 2005 Uwe Lueck,
-%% http://contact-ednotes.sty.de.vu --author-maintained
+%% Copyright (C) 2004, 2005 Uwe Lück
 %% -- support of lineno.sty for varioref.sty.
 
 %% This file can be redistributed and/or modified under



More information about the tex-live-commits mailing list.