texlive[67171] Master/texmf-dist: lineno (20may23)
commits+karl at tug.org
commits+karl at tug.org
Sat May 20 22:18:42 CEST 2023
Revision: 67171
http://tug.org/svn/texlive?view=revision&revision=67171
Author: karl
Date: 2023-05-20 22:18:42 +0200 (Sat, 20 May 2023)
Log Message:
-----------
lineno (20may23)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/lineno/CHANGEs.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/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/tex/latex/lineno/lineno.sty
Modified: trunk/Master/texmf-dist/doc/latex/lineno/CHANGEs.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lineno/CHANGEs.txt 2023-05-20 20:18:25 UTC (rev 67170)
+++ trunk/Master/texmf-dist/doc/latex/lineno/CHANGEs.txt 2023-05-20 20:18:42 UTC (rev 67171)
@@ -1,3 +1,13 @@
+CHANGES for lineno pkg v5.3 2023/05/20:
+
+1. Handle special value of \prevdepth=-1000pt;
+ thanks to Yukai Chou and Frank Mittelbach.
+2. Add package options `sep' and `width' for
+ setting line number separation and width.
+3. Add `twocolumn` support for `bframe` env;
+ thanks to Yukai Chou.
+
+
CHANGES for lineno pkg v5.2 2023/05/19:
1. Support `amsmath` option `\allowdisplaybreaks`.
Modified: trunk/Master/texmf-dist/doc/latex/lineno/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lineno/README.md 2023-05-20 20:18:25 UTC (rev 67170)
+++ trunk/Master/texmf-dist/doc/latex/lineno/README.md 2023-05-20 20:18:42 UTC (rev 67171)
@@ -1,6 +1,6 @@
-# lineno.sty v5.2, fnlineno.sty v0.55
+# lineno.sty v5.3, fnlineno.sty v0.55
-2023-05-19
+2023-05-20
The LaTeX package lineno.sty provides line numbers on paragraphs. After TeX has
broken a paragraph into lines there will be line numbers attached to them, with
Modified: trunk/Master/texmf-dist/doc/latex/lineno/SRCFILEs.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lineno/SRCFILEs.txt 2023-05-20 20:18:25 UTC (rev 67170)
+++ trunk/Master/texmf-dist/doc/latex/lineno/SRCFILEs.txt 2023-05-20 20:18:42 UTC (rev 67171)
@@ -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 2023/05/19 line numbers on paragraphs v5.2
+lineno.sty 2023/05/20 line numbers on paragraphs v5.3
vplref.sty 2005/04/25 v0.2a page-line cross-refs
fnlineno.tex 2011/02/14 documenting fnlineno.sty (UL)
-lineno.tex 2023/05/19 line numbers on paragraphs v5.2
+lineno.tex 2023/05/20 line numbers on paragraphs v5.3
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/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-05-20 20:18:25 UTC (rev 67170)
+++ trunk/Master/texmf-dist/doc/latex/lineno/lineno.tex 2023-05-20 20:18:42 UTC (rev 67171)
@@ -1,4 +1,4 @@
-\def\fileversion{v5.2} \def\filedate{2023/05/19}
+\def\fileversion{v5.3} \def\filedate{2023/05/20}
\title{\texttt{\itshape
lineno.sty \ \fileversion\ \filedate
@@ -214,6 +214,8 @@
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{lineno}
[\filedate\space line numbers on paragraphs \fileversion]
+\RequirePackage{etoolbox}
+\RequirePackage{kvoptions}
\end{verbatim}
\end{code}
@@ -414,7 +416,7 @@
horizontal mode, e.g, from ~\linelabel~.
Sorry, neither a ~\linelabel~ nor a ~\marginpar~ should
-insert a penalty, else the following linenumber
+insert a penalty, else the following line number
could go to the next page. Nor should any other
float. So let us suppress the ~\interlinepenalty~
altogether with the ~\@nobreak~ switch.
@@ -718,10 +720,18 @@
(New v4.4) The depth preserving trick is drawn here from
~\MakeLineNo~ because it will be used again in
section_\ref{ss:calls}.
+(v5.3) Handle special value of ~\prevdepth=-1000pt~. (/v5.3)
\begin{code}\begin{verbatim}
\def\@LN at depthbox{%
- \dp\@tempboxa=\@tempdima
- \nointerlineskip \kern-\@tempdima \box\@tempboxa}
+ \ifdim\@tempdima=-1000pt
+ % \nointerlineskip is already set so we don't need set it again
+ % (and we shouldn't back up)
+ \else
+ \dp\@tempboxa=\@tempdima
+ \nointerlineskip
+ \kern-\@tempdima
+ \fi
+ \box\@tempboxa}
\end{verbatim}
\end{code}
(/New v4.4)
@@ -1347,8 +1357,8 @@
\newdimen\linenumbersep
\newdimen\linenumberwidth
+\linenumbersep=10pt
\linenumberwidth=10pt
-\linenumbersep=10pt
\end{verbatim}
\end{code}
Margin switching requires ~pagewise~ numbering mode, but
@@ -1588,7 +1598,7 @@
\begin{code}\begin{verbatim}
\let\lastLN\relax % compare to last line on this page
\let\firstLN\relax % compare to first line on this page
-\let\pageLN\relax % get the page number, compute the linenumber
+\let\pageLN\relax % get the page number, compute the line number
\let\nextLN\relax % move to the next page
\end{verbatim}
\end{code}
@@ -1707,8 +1717,7 @@
\def\testNextNumberedPage#1{\ifx#1\relax
\global\def\NumberedPageCache{\gotNumberedPage0000}%
\PackageWarningNoLine{lineno}%
- {Linenumber reference failed,
- \MessageBreak rerun to get it right}%
+ {Line number reference failed, re-run to get it right}%
\else
\global\let\NumberedPageCache#1%
\fi
@@ -2125,7 +2134,7 @@
~addpageno~ is due to a suggestion by Sergei Mariev.
\begin{code}\begin{verbatim}
-\DeclareOption{addpageno}{%
+\DeclareVoidOption{addpageno}{%
\AtEndOfPackage{\RequirePackage{vplref}[2005/04/25]}}
\end{verbatim}
\end{code}
@@ -2149,7 +2158,7 @@
is postponed to ~\AtBeginDocument~ when we know whether these
adjustments are needed.
\begin{code}\begin{verbatim}
-\DeclareOption{mathrefs}{\AtBeginDocument
+\DeclareVoidOption{mathrefs}{\AtBeginDocument
{\RequirePackage{ednmath0}[2004/08/20]}}
\end{verbatim}
\end{code}
@@ -2216,12 +2225,12 @@
\begin{code}\begin{verbatim}
\let\if at LN@edtable\iffalse
-\DeclareOption{edtable}{\let\if at LN@edtable\iftrue}
+\DeclareVoidOption{edtable}{\let\if at LN@edtable\iftrue}
-\DeclareOption{longtable}{\let\if at LN@edtable\iftrue
+\DeclareVoidOption{longtable}{\let\if at LN@edtable\iftrue
\PassOptionsToPackage{longtable}{edtable}}
-\DeclareOption{nolongtablepatch}{%
+\DeclareVoidOption{nolongtablepatch}{%
\PassOptionsToPackage{nolongtablepatch}{edtable}}
\end{verbatim}
\end{code}
@@ -2238,9 +2247,9 @@
(right) margin. This works in all modes. ~left~ is the
default.
\begin{code}\begin{verbatim}
-\DeclareOption{left}{\leftlinenumbers*}
+\DeclareVoidOption{left}{\leftlinenumbers*}
-\DeclareOption{right}{\rightlinenumbers*}
+\DeclareVoidOption{right}{\rightlinenumbers*}
\end{verbatim}
\end{code}
Option ~switch~ (~switch*~) puts the line numbers on the
@@ -2249,13 +2258,13 @@
subtraction, getting sort of running numbers again. The
~pagewise~ option may restore true pagewise mode later.
\begin{code}\begin{verbatim}
-\DeclareOption{switch}{\setpagewiselinenumbers
- \switchlinenumbers
- \runningpagewiselinenumbers}
+\DeclareVoidOption{switch}{\setpagewiselinenumbers
+ \switchlinenumbers
+ \runningpagewiselinenumbers}
-\DeclareOption{switch*}{\setpagewiselinenumbers
- \switchlinenumbers*%
- \runningpagewiselinenumbers}
+\DeclareVoidOption{switch*}{\setpagewiselinenumbers
+ \switchlinenumbers*%
+ \runningpagewiselinenumbers}
\end{verbatim}
\end{code}
In twocolumn mode, we can switch the line numbers to
@@ -2263,13 +2272,13 @@
column. Margin switching is covered by the ~switch~
options.
\begin{code}\begin{verbatim}
-\DeclareOption{columnwise}{\setpagewiselinenumbers
- \columnwiselinenumberstrue
- \realpagewiselinenumbers}
+\DeclareVoidOption{columnwise}{\setpagewiselinenumbers
+ \columnwiselinenumberstrue
+ \realpagewiselinenumbers}
\end{verbatim}
\end{code}
The options ~pagewise~ and ~running~ select the major
-linenumber mechanism. ~running~ line numbers refer to a real
+line number mechanism. ~running~ line numbers refer to a real
counter value, which can be reset for any paragraph,
even getting multiple paragraphs on one page starting
with line number one. ~pagewise~ line numbers get a
@@ -2291,22 +2300,22 @@
real pagewise line numbers.
\begin{code}\begin{verbatim}
-\DeclareOption{pagewise}{\setpagewiselinenumbers
- \realpagewiselinenumbers}
+\DeclareVoidOption{pagewise}{\setpagewiselinenumbers
+ \realpagewiselinenumbers}
-\DeclareOption{running}{\setrunninglinenumbers}
+\DeclareVoidOption{running}{\setrunninglinenumbers}
\end{verbatim}
\end{code}
The option ~modulo~ causes only those linenumbers to be
printed which are multiples of five.
\begin{code}\begin{verbatim}
-\DeclareOption{modulo}{\modulolinenumbers\relax}
+\DeclareVoidOption{modulo}{\modulolinenumbers\relax}
\end{verbatim}
\end{code}
Option ~modulo*~ modifies ~modulo~ in working like
~\modulolinenumbers*~---see section_\ref{s:UserCmds}.
\begin{code}\begin{verbatim}
-\DeclareOption{modulo*}{\modulolinenumbers*\relax}
+\DeclareVoidOption{modulo*}{\modulolinenumbers*\relax}
\end{verbatim}
\end{code}
The package option ~mathlines~ switches the behavior of
@@ -2316,7 +2325,7 @@
does. With this option, its just the opposite.
\begin{code}\begin{verbatim}
-\DeclareOption{mathlines}{\linenumberdisplaymath}
+\DeclareVoidOption{mathlines}{\linenumberdisplaymath}
\end{verbatim}
\end{code}
~displaymath~ now calls for wrappers of the standard
@@ -2330,12 +2339,26 @@
~\endlinenomath~ provides ~\ignorespaces~, so what could go
wrong now?
\begin{code}\begin{verbatim}
-\DeclareOption{displaymath}{\PackageWarningNoLine{lineno}{%
- Option [displaymath] is obsolete -- default now!}}
+\DeclareVoidOption{displaymath}{%
+ \PackageWarningNoLine{lineno}{Option [displaymath] is obsolete}}
\end{verbatim}
\end{code}
(/New v4.3)
+(New v5.3) Options `sep' and `width' set ~\linenumbersep~ (the separation of
+the line number to the text) and ~\linenumberwidth~ (the width of the line
+number box on the right margin) respectively; see section_\ref{s:CustHooks}.
+\begin{code}\begin{verbatim}
+\DeclareStringOption[\linenumbersep]{sep}
+\DeclareStringOption[\linenumberwidth]{width}
+\AtBeginDocument{%
+ \linenumbersep=\lineno at sep%
+ \linenumberwidth=\lineno at width%
+}
+\end{verbatim}
+\end{code}
+(/New v5.3)
+
\subsection{%
Compatibility with \texttt{hyperref} %% own subsec. v4.3.
\unskip}
@@ -2356,9 +2379,8 @@
first ~\linenumbers~ and before a next one (if there is some).
(/New v4.3)
\begin{code}\begin{verbatim}
-\DeclareOption{hyperref}{\PackageWarningNoLine{lineno}{%
- Option [hyperref] is obsolete.
- \MessageBreak The hyperref package is detected automatically.}}
+\DeclareVoidOption{hyperref}{%
+ \PackageWarningNoLine{lineno}{Option [hyperref] is obsolete}}
\AtBeginDocument{%
\@ifpackageloaded{nameref}{%
@@ -2413,7 +2435,7 @@
We stop declaring options and execute the ones that are
called by the user. (/New v4.1)
\begin{code}\begin{verbatim}
-\ProcessOptions
+\ProcessKeyvalOptions*
\end{verbatim}
\end{code}
(New v4.1) Now we know whether ~edtable.sty~ is wanted
@@ -2538,10 +2560,16 @@
\begingroup
\c at internallinenumbers\prevgraf
\setbox\@tempboxa\hbox{\vbox{\makeinternalLinenumbers}}%
- \dp\@tempboxa\prevdepth
\ht\@tempboxa\z@
- \nobreak\vskip-\prevdepth
- \nointerlineskip\box\@tempboxa
+ \ifdim\prevdepth=-1000pt
+ % \nointerlineskip is already set so we don't need set it again
+ % (and we shouldn't back up)
+ \else
+ \dp\@tempboxa\prevdepth
+ \nobreak\vskip-\prevdepth
+ \nointerlineskip
+ \fi
+ \box\@tempboxa
\endgroup
\fi\fi
}
@@ -2662,9 +2690,9 @@
\begin{code}\begin{verbatim}
\newenvironment{bframe}
{\par
- \@tempdima\textwidth
+ \@tempdima\columnwidth
\advance\@tempdima 2\bframesep
- \setbox\bframebox\hb at xt@\textwidth{%
+ \setbox\bframebox\hb at xt@\columnwidth{%
\hskip-\bframesep
\vrule\@width\bframerule\@height\baselineskip\@depth\bframesep
\advance\@tempdima-2\bframerule
@@ -2682,10 +2710,12 @@
\def\makeLineNumber{\copy\bframebox\hss}%
}
{\par
- \kern-\prevdepth
+ \ifdim\prevdepth=-1000pt \else
+ \kern-\prevdepth
+ \fi
\kern\bframesep
\nointerlineskip
- \@tempdima\textwidth
+ \@tempdima\columnwidth
\advance\@tempdima 2\bframesep
\hbox{\hskip-\bframesep
\vrule\@width\@tempdima\@height\bframerule\@depth\z@}%
@@ -2710,7 +2740,7 @@
demonstration.
(/New v5.0)
-(/New v5.1) ~lineno~ tries to use \LaTeX's hook management system to patch
+(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
@@ -2718,7 +2748,7 @@
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~
+(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
@@ -2726,8 +2756,6 @@
(/New v5.2)
\begin{code}\begin{verbatim}
-\RequirePackage{etoolbox}
-
\ifdefined\AddToHook
\def\linenoamsmath at patches#1{\AddToHook{package/amsmath/after}{#1}}
\else
@@ -2734,8 +2762,8 @@
\ifdefined\endgather
\def\linenoamsmath at patches#1{#1}
\else
- \PackageWarning{lineno}{%
- `amsmath' must be loaded before `lineno' for patches to be applied}
+ \PackageWarningNoLine{lineno}%
+ {`amsmath' must be loaded before `lineno' for patches to be applied}
\def\linenoamsmath at patches#1{\relax}
\fi
\fi
@@ -3000,8 +3028,8 @@
\unskip}
(New v4.1) We have completed inclusion of the earlier
-extension packages ~linenox0.sty~, ~linenox1.sty~, and
-~lnopatch.sty~. If one of them is loaded, though,
+extension packages ~linenox0.sty~, ~linenox1.sty~, ~lnopatch.sty~,
+and ~linenoamsmath~. If one of them is loaded, though,
we produce an error message before something weird happens.
We avoid ~\newif~ because the switchings occur so rarely.
\begin{code}\begin{verbatim}
@@ -3010,10 +3038,12 @@
\@ifpackageloaded{linenox0}{\let\if at LN@obsolete\iftrue}\relax
\@ifpackageloaded{linenox1}{\let\if at LN@obsolete\iftrue}\relax
\@ifpackageloaded{lnopatch}{\let\if at LN@obsolete\iftrue}\relax
+ \@ifpackageloaded{linenoamsmath}{\let\if at LN@obsolete\iftrue}\relax
\if at LN@obsolete
\PackageError{lineno}{Obsolete extension package(s)}{%
- With lineno.sty version 4.00 or later,\MessageBreak
- linenox0/linenox1/lnopatch.sty must no longer be loaded.}%
+ As of \fileversion, `lineno' includes the functionality of \MessageBreak
+ `linenox0', `linenox1', `lnopatch', and `linenoamsmath'; \MessageBreak
+ these packages are therefore obsolete and must not be loaded.}%
\fi
}
\end{verbatim}
@@ -3191,7 +3221,7 @@
\subsection{%
Customization hooks
-\unskip}
+\unskip}\label{s:CustHooks}
There are several hooks to customize the appearance of the
line numbers, and some low level hooks for special
@@ -3219,7 +3249,7 @@
the right margin.
The default definition is \par$\qquad$
-~\linenumberfont\hskip\linenumbersep\hskip\textwidth~ \par$\qquad$
+~\linenumberfont\hskip\linenumbersep\hskip\columnwidth~ \par$\qquad$
~\hbox to\linenumberwidth{\hss\LineNumber}\hss~
\item
[|\linenumberfont] \ \par
@@ -3228,7 +3258,7 @@
\item
[|\linenumbersep] \ \par
This dimension register sets the separation of the
-linenumber to the text. Default value is ~10pt~.
+line number to the text. Default value is ~10pt~.
\item
[|\linenumberwidth] \ \par
This dimension register sets the width of the line
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-05-20 20:18:25 UTC (rev 67170)
+++ trunk/Master/texmf-dist/doc/latex/lineno/linenoamsmathdemo.tex 2023-05-20 20:18:42 UTC (rev 67171)
@@ -19,12 +19,12 @@
\ifdefined\AddToHook
\newcommand{\loadorder}{\textsf{lineno} is loaded first, and then patches \textsf{amsmath} using \texttt{\textbackslash AddToHook}}
- \usepackage[mathlines]{lineno}
+ \usepackage[mathlines,sep=11pt,width=11pt]{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}
+ \usepackage[mathlines,sep=11pt,width=11pt]{lineno}
\fi
\usepackage{lipsum}
\usepackage{hyperref}
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/tex/latex/lineno/lineno.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lineno/lineno.sty 2023-05-20 20:18:25 UTC (rev 67170)
+++ trunk/Master/texmf-dist/tex/latex/lineno/lineno.sty 2023-05-20 20:18:42 UTC (rev 67171)
@@ -3,7 +3,7 @@
Macro file lineno.sty for LaTeX: attach line numbers, refer to them.
\fi
-\def\fileversion{v5.2} \def\filedate{2023/05/19} %VERSION
+\def\fileversion{v5.3} \def\filedate{2023/05/20} %VERSION
%%% Copyright 1995--2003 Stephan I. Böttcher
%%% Copyright 2002--2005 Uwe Lück for versions 4.x and code from former Ednotes
@@ -262,6 +262,8 @@
\ProvidesPackage{lineno}
[\filedate\space line numbers on paragraphs \fileversion]
%%
+\RequirePackage{etoolbox}
+\RequirePackage{kvoptions}
%% History of versions:
%% v1.00 1995/03/31 SIB: first release for Petra's interview transcriptions
%% v1.01 1995/10/28 SIB: added ~pagewise~ mode
@@ -388,6 +390,10 @@
%% 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`.
+%% v5.3 2023/05/20 KW: Handle special value of \prevdepth=-1000pt.
+%% Add package options `sep' and `width' for
+%% setting line number separation and width.
+%% Add `twocolumn` support for `bframe` env.
%%
%% Acknowledgements:
%% v3.06: Donald Arseneau, pointed to mparhack.sty.
@@ -404,6 +410,9 @@
%% Saravanan M.'s and David Josef Dev.
%% v4.4: David Josef Dev points out that \kern\z@ after a paragraph
%% tends to place its final baseline wrongly.
+%% v5.3: Yukai Chou and Frank Mittelbach for patches to handle special
+%% value of \prevdepth=-1000pt, and add `twocolumn` support for
+%% `bframe` env.
%
%
% \section{%
@@ -602,7 +611,7 @@
% horizontal mode, e.g, from ~\linelabel~.
%
% Sorry, neither a ~\linelabel~ nor a ~\marginpar~ should
-% insert a penalty, else the following linenumber
+% insert a penalty, else the following line number
% could go to the next page. Nor should any other
% float. So let us suppress the ~\interlinepenalty~
% altogether with the ~\@nobreak~ switch.
@@ -914,10 +923,18 @@
% (New v4.4) The depth preserving trick is drawn here from
% ~\MakeLineNo~ because it will be used again in
% section_\ref{ss:calls}.
+% (v5.3) Handle special value of ~\prevdepth=-1000pt~. (/v5.3)
\def\@LN at depthbox{%
- \dp\@tempboxa=\@tempdima
- \nointerlineskip \kern-\@tempdima \box\@tempboxa}
+ \ifdim\@tempdima=-1000pt
+ % \nointerlineskip is already set so we don't need set it again
+ % (and we shouldn't back up)
+ \else
+ \dp\@tempboxa=\@tempdima
+ \nointerlineskip
+ \kern-\@tempdima
+ \fi
+ \box\@tempboxa}
% (/New v4.4)
%
@@ -1531,8 +1548,8 @@
\newdimen\linenumbersep
\newdimen\linenumberwidth
+\linenumbersep=10pt
\linenumberwidth=10pt
-\linenumbersep=10pt
% Margin switching requires ~pagewise~ numbering mode, but
% choosing the left or right margin for the numbers always
@@ -1778,7 +1795,7 @@
\let\lastLN\relax % compare to last line on this page
\let\firstLN\relax % compare to first line on this page
-\let\pageLN\relax % get the page number, compute the linenumber
+\let\pageLN\relax % get the page number, compute the line number
\let\nextLN\relax % move to the next page
% During the end-document run through the aux-files, we
@@ -1889,8 +1906,7 @@
\def\testNextNumberedPage#1{\ifx#1\relax
\global\def\NumberedPageCache{\gotNumberedPage0000}%
\PackageWarningNoLine{lineno}%
- {Linenumber reference failed,
- \MessageBreak rerun to get it right}%
+ {Line number reference failed, re-run to get it right}%
\else
\global\let\NumberedPageCache#1%
\fi
@@ -2312,7 +2328,7 @@
%
% ~addpageno~ is due to a suggestion by Sergei Mariev.
-\DeclareOption{addpageno}{%
+\DeclareVoidOption{addpageno}{%
\AtEndOfPackage{\RequirePackage{vplref}[2005/04/25]}}
% \subsection{%
@@ -2335,7 +2351,7 @@
% is postponed to ~\AtBeginDocument~ when we know whether these
% adjustments are needed.
-\DeclareOption{mathrefs}{\AtBeginDocument
+\DeclareVoidOption{mathrefs}{\AtBeginDocument
{\RequirePackage{ednmath0}[2004/08/20]}}
%
@@ -2401,12 +2417,12 @@
\let\if at LN@edtable\iffalse
-\DeclareOption{edtable}{\let\if at LN@edtable\iftrue}
+\DeclareVoidOption{edtable}{\let\if at LN@edtable\iftrue}
-\DeclareOption{longtable}{\let\if at LN@edtable\iftrue
+\DeclareVoidOption{longtable}{\let\if at LN@edtable\iftrue
\PassOptionsToPackage{longtable}{edtable}}
-\DeclareOption{nolongtablepatch}{%
+\DeclareVoidOption{nolongtablepatch}{%
\PassOptionsToPackage{nolongtablepatch}{edtable}}
% (/New v4.1)
@@ -2424,9 +2440,9 @@
% (right) margin. This works in all modes. ~left~ is the
% default.
-\DeclareOption{left}{\leftlinenumbers*}
+\DeclareVoidOption{left}{\leftlinenumbers*}
-\DeclareOption{right}{\rightlinenumbers*}
+\DeclareVoidOption{right}{\rightlinenumbers*}
% Option ~switch~ (~switch*~) puts the line numbers on the
% outer (inner) margin of the text. This requires running
@@ -2434,13 +2450,13 @@
% subtraction, getting sort of running numbers again. The
% ~pagewise~ option may restore true pagewise mode later.
-\DeclareOption{switch}{\setpagewiselinenumbers
- \switchlinenumbers
- \runningpagewiselinenumbers}
+\DeclareVoidOption{switch}{\setpagewiselinenumbers
+ \switchlinenumbers
+ \runningpagewiselinenumbers}
-\DeclareOption{switch*}{\setpagewiselinenumbers
- \switchlinenumbers*%
- \runningpagewiselinenumbers}
+\DeclareVoidOption{switch*}{\setpagewiselinenumbers
+ \switchlinenumbers*%
+ \runningpagewiselinenumbers}
% In twocolumn mode, we can switch the line numbers to
% the outer margin, and/or start with number 1 in each
@@ -2447,12 +2463,12 @@
% column. Margin switching is covered by the ~switch~
% options.
-\DeclareOption{columnwise}{\setpagewiselinenumbers
- \columnwiselinenumberstrue
- \realpagewiselinenumbers}
+\DeclareVoidOption{columnwise}{\setpagewiselinenumbers
+ \columnwiselinenumberstrue
+ \realpagewiselinenumbers}
% The options ~pagewise~ and ~running~ select the major
-% linenumber mechanism. ~running~ line numbers refer to a real
+% line number mechanism. ~running~ line numbers refer to a real
% counter value, which can be reset for any paragraph,
% even getting multiple paragraphs on one page starting
% with line number one. ~pagewise~ line numbers get a
@@ -2473,20 +2489,20 @@
% ~\pagewiselinenumbers~, you get margin switching, with
% real pagewise line numbers.
%
-\DeclareOption{pagewise}{\setpagewiselinenumbers
- \realpagewiselinenumbers}
+\DeclareVoidOption{pagewise}{\setpagewiselinenumbers
+ \realpagewiselinenumbers}
-\DeclareOption{running}{\setrunninglinenumbers}
+\DeclareVoidOption{running}{\setrunninglinenumbers}
% The option ~modulo~ causes only those linenumbers to be
% printed which are multiples of five.
-\DeclareOption{modulo}{\modulolinenumbers\relax}
+\DeclareVoidOption{modulo}{\modulolinenumbers\relax}
% Option ~modulo*~ modifies ~modulo~ in working like
% ~\modulolinenumbers*~---see section_\ref{s:UserCmds}.
-\DeclareOption{modulo*}{\modulolinenumbers*\relax}
+\DeclareVoidOption{modulo*}{\modulolinenumbers*\relax}
% The package option ~mathlines~ switches the behavior of
% the ~{linenomath}~ environment with its star-form.
@@ -2496,7 +2512,7 @@
%
%%% 1999-06-10: renamed ~displaymath~ to ~mathlines~.
-\DeclareOption{mathlines}{\linenumberdisplaymath}
+\DeclareVoidOption{mathlines}{\linenumberdisplaymath}
% ~displaymath~ now calls for wrappers of the standard
% \LaTeX\ display math environment. This was previously
@@ -2509,13 +2525,26 @@
% ~\endlinenomath~ provides ~\ignorespaces~, so what could go
% wrong now?
-\DeclareOption{displaymath}{\PackageWarningNoLine{lineno}{%
- Option [displaymath] is obsolete -- default now!}}
-%%
+\DeclareVoidOption{displaymath}{%
+ \PackageWarningNoLine{lineno}{Option [displaymath] is obsolete}}
+
%%\let\do at mlineno\relax
%%\DeclareOption{displaymath}{\let\do at mlineno\@empty}
% (/New v4.3)
%
+% (New v5.3) Options `sep' and `width' set ~\linenumbersep~ (the separation of
+% the line number to the text) and ~\linenumberwidth~ (the width of the line
+% number box on the right margin) respectively; see section_\ref{s:CustHooks}.
+
+\DeclareStringOption[\linenumbersep]{sep}
+\DeclareStringOption[\linenumberwidth]{width}
+\AtBeginDocument{%
+ \linenumbersep=\lineno at sep%
+ \linenumberwidth=\lineno at width%
+}
+
+% (/New v5.3)
+%
% \subsection{%
% Compatibility with \texttt{hyperref} %% own subsec. v4.3.
% \unskip}
@@ -2536,9 +2565,8 @@
% first ~\linenumbers~ and before a next one (if there is some).
% (/New v4.3)
-\DeclareOption{hyperref}{\PackageWarningNoLine{lineno}{%
- Option [hyperref] is obsolete.
- \MessageBreak The hyperref package is detected automatically.}}
+\DeclareVoidOption{hyperref}{%
+ \PackageWarningNoLine{lineno}{Option [hyperref] is obsolete}}
\AtBeginDocument{%
\@ifpackageloaded{nameref}{%
@@ -2589,7 +2617,7 @@
% We stop declaring options and execute the ones that are
% called by the user. (/New v4.1)
-\ProcessOptions
+\ProcessKeyvalOptions*
% (New v4.1) Now we know whether ~edtable.sty~ is wanted
% and (if it is) with which options it is to be called.
@@ -2717,10 +2745,16 @@
\begingroup
\c at internallinenumbers\prevgraf
\setbox\@tempboxa\hbox{\vbox{\makeinternalLinenumbers}}%
- \dp\@tempboxa\prevdepth
\ht\@tempboxa\z@
- \nobreak\vskip-\prevdepth
- \nointerlineskip\box\@tempboxa
+ \ifdim\prevdepth=-1000pt
+ % \nointerlineskip is already set so we don't need set it again
+ % (and we shouldn't back up)
+ \else
+ \dp\@tempboxa\prevdepth
+ \nobreak\vskip-\prevdepth
+ \nointerlineskip
+ \fi
+ \box\@tempboxa
\endgroup
\fi\fi
}
@@ -2838,9 +2872,9 @@
\newenvironment{bframe}
{\par
- \@tempdima\textwidth
+ \@tempdima\columnwidth
\advance\@tempdima 2\bframesep
- \setbox\bframebox\hb at xt@\textwidth{%
+ \setbox\bframebox\hb at xt@\columnwidth{%
\hskip-\bframesep
\vrule\@width\bframerule\@height\baselineskip\@depth\bframesep
\advance\@tempdima-2\bframerule
@@ -2858,10 +2892,12 @@
\def\makeLineNumber{\copy\bframebox\hss}%
}
{\par
- \kern-\prevdepth
+ \ifdim\prevdepth=-1000pt \else
+ \kern-\prevdepth
+ \fi
\kern\bframesep
\nointerlineskip
- \@tempdima\textwidth
+ \@tempdima\columnwidth
\advance\@tempdima 2\bframesep
\hbox{\hskip-\bframesep
\vrule\@width\@tempdima\@height\bframerule\@depth\z@}%
@@ -2885,7 +2921,7 @@
% demonstration.
% (/New v5.0)
%
-% (/New v5.1) ~lineno~ tries to use \LaTeX's hook management system to patch
+% (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
@@ -2893,7 +2929,7 @@
% 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~
+% (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
@@ -2901,8 +2937,6 @@
% (/New v5.2)
%
-\RequirePackage{etoolbox}
-
\ifdefined\AddToHook
\def\linenoamsmath at patches#1{\AddToHook{package/amsmath/after}{#1}}
\else
@@ -2909,8 +2943,8 @@
\ifdefined\endgather
\def\linenoamsmath at patches#1{#1}
\else
- \PackageWarning{lineno}{%
- `amsmath' must be loaded before `lineno' for patches to be applied}
+ \PackageWarningNoLine{lineno}%
+ {`amsmath' must be loaded before `lineno' for patches to be applied}
\def\linenoamsmath at patches#1{\relax}
\fi
\fi
@@ -3181,8 +3215,8 @@
% \unskip}
%
% (New v4.1) We have completed inclusion of the earlier
-% extension packages ~linenox0.sty~, ~linenox1.sty~, and
-% ~lnopatch.sty~. If one of them is loaded, though,
+% extension packages ~linenox0.sty~, ~linenox1.sty~, ~lnopatch.sty~,
+% and ~linenoamsmath~. If one of them is loaded, though,
% we produce an error message before something weird happens.
% We avoid ~\newif~ because the switchings occur so rarely.
@@ -3191,10 +3225,12 @@
\@ifpackageloaded{linenox0}{\let\if at LN@obsolete\iftrue}\relax
\@ifpackageloaded{linenox1}{\let\if at LN@obsolete\iftrue}\relax
\@ifpackageloaded{lnopatch}{\let\if at LN@obsolete\iftrue}\relax
+ \@ifpackageloaded{linenoamsmath}{\let\if at LN@obsolete\iftrue}\relax
\if at LN@obsolete
\PackageError{lineno}{Obsolete extension package(s)}{%
- With lineno.sty version 4.00 or later,\MessageBreak
- linenox0/linenox1/lnopatch.sty must no longer be loaded.}%
+ As of \fileversion, `lineno' includes the functionality of \MessageBreak
+ `linenox0', `linenox1', `lnopatch', and `linenoamsmath'; \MessageBreak
+ these packages are therefore obsolete and must not be loaded.}%
\fi
}
@@ -3384,7 +3420,7 @@
%
% \subsection{%
% Customization hooks
-% \unskip}
+% \unskip}\label{s:CustHooks}
%
% There are several hooks to customize the appearance of the
% line numbers, and some low level hooks for special
@@ -3412,7 +3448,7 @@
% the right margin.
%
% The default definition is \par$\qquad$
-% ~\linenumberfont\hskip\linenumbersep\hskip\textwidth~ \par$\qquad$
+% ~\linenumberfont\hskip\linenumbersep\hskip\columnwidth~ \par$\qquad$
% ~\hbox to\linenumberwidth{\hss\LineNumber}\hss~
% \item
% [|\linenumberfont] \ \par
@@ -3421,7 +3457,7 @@
% \item
% [|\linenumbersep] \ \par
% This dimension register sets the separation of the
-% linenumber to the text. Default value is ~10pt~.
+% line number to the text. Default value is ~10pt~.
% \item
% [|\linenumberwidth] \ \par
% This dimension register sets the width of the line
More information about the tex-live-commits
mailing list.