Skip to content

Commit

Permalink
lineno.sty: further patches to handle special value of \prevdepth=-10…
Browse files Browse the repository at this point in the history
…00pt

- See #3 (comment)
- Thanks to @muzimuzhi and @FrankMittelbach for the patches and testing
  • Loading branch information
kwwette committed May 19, 2023
1 parent c23b32a commit 6074fea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGEs.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CHANGES for lineno pkg v5.3 2023/xx/xx:

1. Handle special value of \prevdepth=-1000pt.
(thanks to @muzimuzhi and @FrankMittelbach)
2. Add package options `sep' and `width' for
setting line number separation and width.
3. Add `twocolumn` support for `bframe` env.
Expand Down
18 changes: 13 additions & 5 deletions lineno.sty
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ Macro file lineno.sty for LaTeX: attach line numbers, refer to them.
% (v5.3) Handle special value of ~\prevdepth=-1000pt~. (/v5.3)

\def\@LN@depthbox{%
\ifdim\@tempdima = -1000pt
\ifdim\@tempdima=-1000pt
% \nointerlineskip is already set so we don't need set it again
% (and we shouldn't back up)
\else
Expand Down Expand Up @@ -2738,10 +2738,16 @@ Macro file lineno.sty for LaTeX: attach line numbers, refer to them.
\begingroup
\c@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
}
Expand Down Expand Up @@ -2879,7 +2885,9 @@ Macro file lineno.sty for LaTeX: attach line numbers, refer to them.
\def\makeLineNumber{\copy\bframebox\hss}%
}
{\par
\kern-\prevdepth
\ifdim\prevdepth=-1000pt \else
\kern-\prevdepth
\fi
\kern\bframesep
\nointerlineskip
\@tempdima\columnwidth
Expand Down

0 comments on commit 6074fea

Please sign in to comment.