summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lineno/tex/lineno.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/lineno/tex/lineno.sty')
-rw-r--r--macros/latex/contrib/lineno/tex/lineno.sty19
1 files changed, 17 insertions, 2 deletions
diff --git a/macros/latex/contrib/lineno/tex/lineno.sty b/macros/latex/contrib/lineno/tex/lineno.sty
index c879008a20..03958a8589 100644
--- a/macros/latex/contrib/lineno/tex/lineno.sty
+++ b/macros/latex/contrib/lineno/tex/lineno.sty
@@ -3,7 +3,7 @@
Macro file lineno.sty for LaTeX: attach line numbers, refer to them.
\fi
-\def\fileversion{v5.1} \def\filedate{2023/01/19} %VERSION
+\def\fileversion{v5.2} \def\filedate{2023/05/19} %VERSION
%%% Copyright 1995--2003 Stephan I. Böttcher
%%% Copyright 2002--2005 Uwe Lück for versions 4.x and code from former Ednotes
@@ -387,6 +387,7 @@ Macro file lineno.sty for LaTeX: attach line numbers, refer to them.
%% 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.
+%% v5.2 2023/05/19 KW: Support `amsmath` option `\allowdisplaybreaks`.
%%
%% Acknowledgements:
%% v3.06: Donald Arseneau, pointed to mparhack.sty.
@@ -2892,6 +2893,13 @@ Macro file lineno.sty for LaTeX: attach line numbers, refer to them.
% has not been loaded, no patches are applied, and a warning is issued.
% (/New v5.1)
%
+% (/New v5.2) Fix ~lineno~ to work with ~amsmath~'s ~\allowdisplaybreaks~
+% option. A side effect is that now ~\\*~ suppresses a line number on that
+% line. This is because ~\\*~ prohibits a page break after a given line, and
+% ~lineno~ basically works by hijacking page breaks. It's probably not possible
+% to fix this without losing the behaviour of ~\\*~.
+% (/New v5.2)
+%
\RequirePackage{etoolbox}
@@ -2915,7 +2923,14 @@ Macro file lineno.sty for LaTeX: attach line numbers, refer to them.
\csappto{end#1*}{\endlinenomath}%
}
\newcount\linenoamsmath@ams@eqpen
- \cspreto{math@cr@}{\global\@eqpen\numexpr\@eqpen+\linenoamsmath@ams@eqpen\relax}
+ \cspreto{math@cr@}{%
+ %%% Uncommenting the following 2 lines restores the line number on a line
+ %%% ended with \\*, by making \\* act just like \\. This is probably
+ %%% undesirable, however, so these lines are disabled.
+ % \global\@eqpen%
+ % \ifnum\dspbrk@lvl <\z@ \interdisplaylinepenalty \else -\@getpen\dspbrk@lvl \fi%
+ \advance\@eqpen\linenoamsmath@ams@eqpen\relax%
+ }
\newcommand*\linenoamsmath@patch@ams[1]{%
\cspreto{#1}{%
\linenomath%