summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lineno/source/lineno.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/lineno/source/lineno.tex')
-rw-r--r--macros/latex/contrib/lineno/source/lineno.tex18
1 files changed, 16 insertions, 2 deletions
diff --git a/macros/latex/contrib/lineno/source/lineno.tex b/macros/latex/contrib/lineno/source/lineno.tex
index baed81f1b8..1e2457202c 100644
--- a/macros/latex/contrib/lineno/source/lineno.tex
+++ b/macros/latex/contrib/lineno/source/lineno.tex
@@ -1,4 +1,4 @@
-\def\fileversion{v5.1} \def\filedate{2023/01/19}
+\def\fileversion{v5.2} \def\filedate{2023/05/19}
\title{\texttt{\itshape
lineno.sty \ \fileversion\ \filedate
@@ -2718,6 +2718,13 @@ 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)
+(/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)
+
\begin{code}\begin{verbatim}
\RequirePackage{etoolbox}
@@ -2741,7 +2748,14 @@ has not been loaded, no patches are applied, and a warning is issued.
\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%