fnlineno.sty numbering footnote linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf ·...
TRANSCRIPT
![Page 1: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/1.jpg)
fnlineno.sty
—
Numbering Footnote Lines∗
Uwe Luck†
February 16, 2011
Abstract
fnlineno.sty extends lineno.sty1 (created by Stephan I. Bottcher) suchthat even \footnote lines are numbered and can be referred to using\linelabel, \ref, etc.
Making the package was motivated as support for critical editions ofprinted works with footnotes as opposed to scholarly critical editions ofmanuscripts. For this purpose, an extension edfnotes of the ednotes pack-age for critical editions, building on fnlineno, is provided by the ednotesbundle.2
lineno.sty has also been used for the revision process of submissions.With fnlineno.sty, reference to footnotes in the submitted work may be-come possible.
As to implementation: 1. Some included tools for storing and restoringglobal settings may be “exported” as standalone packages later. 2. Themethod of typesetting footnotes on the main vertical list may later leadto applying the line numbering method to several parallel texts (withfootnotes) and to inner material such as table cells.
Keywords: line numbers; footnotes, pagewise, critical editions, revision
Contents
1 Usage and Features 21.1 Package File Header (Legalize) . . . . . . . . . . . . . . . . . . . 21.2 Installing and Calling . . . . . . . . . . . . . . . . . . . . . . . . 31.3 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
∗This document describes version v0.55 of fnlineno.sty as of 2011/01/07.†http://contact-ednotes.sty.de.vu1http://ctan.org/pkg/lineno2http://ctan.org/pkg/ednotes
1
![Page 2: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/2.jpg)
1 USAGE AND FEATURES 2
2 Implementation 42.1 Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.2 Basic Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.3 Package Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.4 Footnote Commands . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4.1 Standard Footnotes . . . . . . . . . . . . . . . . . . . . . 42.4.2 Modifying Footnote Commands . . . . . . . . . . . . . . . 5
2.5 Output Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.5.1 lineno’s Output Routine . . . . . . . . . . . . . . . . . . . 62.5.2 Tools for Temporary Parameter Changes . . . . . . . . . 62.5.3 The basic hook . . . . . . . . . . . . . . . . . . . . . . . . 72.5.4 Typesetting the Footnote Text . . . . . . . . . . . . . . . 82.5.5 \insert the Footnote Text . . . . . . . . . . . . . . . . . 10
2.6 “Continuous” Numbering . . . . . . . . . . . . . . . . . . . . . . 112.6.1 Goal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.6.2 How to Number Lines Pagewise . . . . . . . . . . . . . . . 112.6.3 Summary of Changes . . . . . . . . . . . . . . . . . . . . 122.6.4 Info Building . . . . . . . . . . . . . . . . . . . . . . . . . 132.6.5 Tool for Reusing Global Operations with Macros . . . . . 152.6.6 General Settings for Typesetting Stage . . . . . . . . . . . 162.6.7 Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.6.8 “Public” Line Numbers . . . . . . . . . . . . . . . . . . . 182.6.9 Referencing . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.7 Leaving the Package File . . . . . . . . . . . . . . . . . . . . . . . 21
3 Acknowledgements 22
4 VERSION HISTORY 22
1 Usage and Features
1.1 Package File Header (Legalize)
1 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
2 \ProvidesPackage{fnlineno}[2011/01/07 v0.55
3 numbers to footnote lines (UL)]
4
5 %% Copyright (C) 2010 Uwe Lueck,
6 %% http://www.contact-ednotes.sty.de.vu
7 %% -- author-maintained in the sense of LPPL below --
8 %%
9 %% This file can be redistributed and/or modified under
10 %% the terms of the LaTeX Project Public License; either
11 %% version 1.3c of the License, or any later version.
12 %% The latest version of this license is in
13 %% http://www.latex-project.org/lppl.txt
14 %% We did our best to help you, but there is NO WARRANTY.
![Page 3: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/3.jpg)
1 USAGE AND FEATURES 3
15 %%
16 %% Please report bugs, problems, and suggestions via
17 %%
18 %% http://www.contact-ednotes.sty.de.vu
19 %%
This work has been supported by the Deutsche Forschungsgemeinschaft (DFG),organized by Prof. Dr. Dr. Christian Tapp at Ruhr-Universitat Bochum, Ger-many. Christian also has constructed some critical tests.
1.2 Installing and Calling
The file fnlineno.sty is provided ready, installation only requires putting it some-where where TEX finds it (which may need updating the filename data base).3
As usually, fnlineno.sty is loaded by \usepackage{fnlineno} below the\documentclass line and before \begin{document}.
1.3 Limitations
v0.55 should really work the way users expect, but please consider:
1. Nothing is known about compatibility with packages (other than manyfootand bigfoot) providing footnote features beyond standard LATEX.
2. \lipsum[〈opt-arg〉] in main text produces a different number of para-graphs . . .
3. v0.41 tried supporting \pagebreak in footnotes for manual control of split-ting footnotes. However, it wrongly assumed that \pagebreak[4] forcesa footnote split, cf. Section 2.5.3; users better still don’t use \pagebreakin footnotes!
4. Much of the code is “guessed” without complete knowledge of TEX inter-nals and without having tested many possible cases.
5. Local switching to “pagewise” numbering won’t be possible for a while;we rather assume that you always want “pagewise” numbering.
6. Nothing has been tried to offer choices about the style of numbering foot-notes.
3http://www.tex.ac.uk/cgi-bin/texfaq2html?label=inst-wlcf
![Page 4: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/4.jpg)
2 IMPLEMENTATION 4
2 Implementation
2.1 Terms
“OTR” is short for “output routine”, “MVL” is short for “main vertical list”.
2.2 Basic Strategy
LATEX’s \@footnotetext writes the footnote text into the insertion register.For numbering the footnote lines, we here do not execute this \@footnotetextimmediately after placing \@footnotemark , but postpone its \insert a littleso it is executed only after the main text paragraph has been broken into lines.Right below the line that contains the footnote mark, a special new “slot” ofthe OTR is called that interchanges “the page so far” with the footnote text.When the latter has been typeset, another “slot” of the OTR puts “the page sofar” back to the MVL and immediately after that fills the footnote text as justtypeset on the MVL into the \insert register.
Passing footnotes from horizontal mode to vertical mode resembles lineno’s\PostponeVadjust, but a different list \FNLN@list must store code (a) forthe footnote mark and (b) for the footnote text.
2.3 Package Options
A package option [check-latex] for checking vital LATEX internals may oncebe offered (TODO 2010/12/12) . . .
20 \newif\if@FNLN@check@
21 \DeclareOption{check-latex}{\@FNLN@check@true}
22 \ProcessOptions
2.4 Footnote Commands
2.4.1 Standard Footnotes
The following macro \FNLN@ltx@fntext is a copy of LATEX’s \@footnotetextthat we are varying. It may be used for a check if the \@footnotetext that fn-lineno.sty encounters is the one expected (TODO). In line numbering mode, thiscode may never be needed all at once, rather we will have to see which materialmust be used at which point of our unusual way of processeing footnotes.
23 \if@FNLN@check@
24 \long\def\FNLN@ltx@fntext#1{\insert\footins{%
25 \reset@font\footnotesize
26 \interlinepenalty\interfootnotelinepenalty
27 \splittopskip\footnotesep
28 \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
29 \hsize\columnwidth \@parboxrestore
30 \protected@edef\@currentlabel{%
31 \csname p@footnote\endcsname\@thefnmark
![Page 5: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/5.jpg)
2 IMPLEMENTATION 5
32 }%
33 \color@begingroup
34 \@makefntext{%
35 \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
36 \color@endgroup}}%
37 \fi
2.4.2 Modifying Footnote Commands
In order to number \footnote lines and make \linelabel available in foot-notes, it seems to suffice (with standard LATEX) to redefine the internal\@footnotetext . In line numbering mode, \@footnotetext will act as\FNLN@text , (i) placing a “signal” output penalty below the current linevia \vadjust and (ii) appending the footnote text to the list \FNLN@list offootnote texts.
\FNLN@@text stores the \@footnotetext found, we might check if it is\FNLN@ltx@fntext . . .
38 \let\FNLN@@text\@footnotetext
39 \def\@footnotetext{%
40 \ifLineNumbers \expandafter \FNLN@text
41 \else \expandafter \FNLN@@text
42 \fi}
43 \def \FNLN@text {% %% 2010/12/31 arg read later
44 \vadjust{\penalty-\FNLN@M@swap@codepen}%
Standard LATEX’s \@footnotetext expands \@thefnmark to produce the foot-note mark at the page bottom, right after it has been determined for the mark inthe main text. Here the footnote text will be typeset only when other footnotemarks may have been formed for typesetting the main text paragraph before. Inthe footnote list macro \FNLN@list , the (“\protected”) current expansion〈mark〉 of \@thefnmark is stored as an item preceding the footnote text 〈text〉.One footnote entry in \FNLN@list thus has the form ‘〈mark〉\@lt〈text〉\@lt’.LATEX’s internal \g@addto@macro is used to append an entry to the list (at theright). The OTR will later take the entries from the left of the list.
The argument of the auxiliary/temporary \@tempa will contain the footnotetext and thus must be able to carry \par tokens. We therefore need a \longversion of \protected@edef:
45 \let\@@protect\protect
46 \let\protect\@unexpandable@protect
47 \afterassignment\restore@protect
48 \long \edef \@tempa ##1{%
49 \noexpand\g@addto@macro \noexpand\FNLN@list {%
50 \@thefnmark \noexpand\@lt ##1\noexpand \@lt}}%
. . . issuing ‘\g@addto@macro\FNLN@list{〈mark〉\elt〈text〉\@lt}’ . . .
51 \@tempa %% reads arg
52 }
![Page 6: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/6.jpg)
2 IMPLEMENTATION 6
Here we initialize \FNLN@list :
53 \let\FNLN@list\@empty
2.5 Output Routines
2.5.1 lineno’s Output Routine
The following is a copy of lineno’s OTR that we are varying. It may be used fora check if the OTR that fnlineno.sty encounters is the one expected (TODO).
54 \if@FNLN@check@
55 \def\FNLN@lno@output {%
56 \LineNoTest
57 \if@tempswa
58 \ifnum\outputpenalty=-\@Mllbcodepen
59 \WriteLineNo
60 \else
61 \ifnum\outputpenalty=-\@Mppvacodepen
62 \PassVadjustList
63 \else
64 \LineNoLaTeXOutput
65 \fi
66 \fi
67 \else
68 \MakeLineNo
69 \fi
70 }
The “signal penalties” used here are
71 \mathchardef\FNLN@M@llbl@codepen=11111
72 \mathchardef\FNLN@M@ppva@codepen=11112
73 \fi
Their names should mean “\linelabel code penalty” and “\PostponeVadjustcode penalty.”
\TheLineNoLaTeXOutput : It turns out to be inconvenient here that linenosacrifices access to the primitive \output (“\@tempa”; TODO: auxiliary pack-age before loading lineno!?; later change lineno.sty indeed). So to change theOTR we use \LineNoLaTeXOutput as a hook for adding additional cases of\outputpenalties. We take a copy of \LineNoLaTeXOutput here.
74 \let\TheLineNoLaTeXOutput\LineNoLaTeXOutput
2.5.2 Tools for Temporary Parameter Changes
\GStoreReg{〈register〉} (or \GStoreReg〈register〉when 〈register〉 is a single token—‘\count0’ being a counterexample . . .) storesthe current content of 〈register〉 (globally) as an internal macro so that it can
![Page 7: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/7.jpg)
2 IMPLEMENTATION 7
be restored later by\RestoreReg{〈register〉} (or \RestoreReg〈register〉 )or globally by\GRestoreReg{〈register〉} ( \GRestoreReg〈register〉 )(The OTR runs in a local group!—Recall that assignments to “special dimens”—TEXbook p. 271—are automatically global.) 〈register〉 is something that can beprefixed by \the to read its content and to which you can assign a value 〈value〉by ‘〈register〉〈value〉’. (TODO: could also be some \catcode!)
75 \newcommand*{\GStoreReg}[1]{%
76 \expandafter \xdef \csname GS\string#1\endcsname {\the #1}}
77 \newcommand*{\RestoreReg}[1]{#1\csname GS\string#1\endcsname \relax}
78 \newcommand*{\GRestoreReg}{\global\RestoreReg}
\GStoreSetReg{〈register〉}{〈value〉} assigns 〈value〉 to 〈register〉 (locally) af-ter executing \GStoreSet, \GStoreGSetReg does the same globally (and stillargument braces aren’t needed when a single token refers to the register).
79 \newcommand*{\g@storesetreg}[3]{\GStoreReg{#2}#1#2#3\relax}
80 \newcommand*{\GStoreSetReg} {\g@storesetreg\relax}
81 \newcommand*{\GStoreGSetReg}{\g@storesetreg\global}
(These preliminaries might go into an own new package, TODO! + loop on listof 〈register〉s . . .)
2.5.3 The basic hook
We use two more penalties triggering the “MVL swaps:”
82 \mathchardef\FNLN@M@swap@codepen =11113
83 \mathchardef\FNLN@M@insert@codepen=11114
v0.41 deals with \pagebreak in footnote texts, using a flag \if@FNLN@sw@that must be set globally. It turned out not to work properly; however, thenew switch has served a different purpose for “continuous line numbering,” cf.section 2.6.
84 \newif\if@FNLN@sw@ \global\@FNLN@sw@false %% v0.41
When a \pagebreak triggers the OTR while typesetting the footnote text, thepage content is collected in a box \FNLN@holdft :
85 \newsavebox\FNLN@holdft %% v0.41
Using \LineNoLaTeXOutput for hooking into the OTR:
86 \renewcommand*{\LineNoLaTeXOutput}{%
87 \ifnum\outputpenalty=-\FNLN@M@swap@codepen
88 \SwapFootnoteMain
89 \else
![Page 8: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/8.jpg)
2 IMPLEMENTATION 8
90 \ifnum\outputpenalty=-\FNLN@M@insert@codepen
91 \InsertFootnote
92 \else
93 \if@FNLN@sw@ %% v0.41
94 % \showthe\outputpenalty %% 2010/12/20
95 \global\setbox \FNLN@holdft \vbox{%
96 \unvbox\FNLN@holdft
TODO from v0.41: \pagebreak[4] does not seem to force (reliably) splitting afootnote; if the footnote is not split here, at present the \baselineskip is lost,see the footnote paragraph starting with ‘C’ in edfndemo.pdf as of 2010/12/21.We would need some measuring . . . \pagebreak might be redefined . . . resem-bling LATEX’s \@specialoutput!
97 \unvbox\@cclv
TODO same problem here, see the footnote paragraph starting with ‘D’ inedfndemo.pdf as of 2010/12/21.
98 \penalty\outputpenalty}%
99 %% TODO reset page book-keeping!? %% v0.41
100 \else
101 \TheLineNoLaTeXOutput %% "the real \LineNoLaTeXOuput"
102 \fi
103 \fi
104 \fi
105 }
An idea: Instead of so many \ifnum, use
\csname〈chars〉\the\outputpenalty\endcsname
. . . in lineno.sty, when you really have a broad range of \outputpenalties usefulto be described by \ifnum range checks . . .
2.5.4 Typesetting the Footnote Text
\SwapFootnoteMain is the slot of the OTR that our modified \@footnotetextcalls with \outputpenalty = −\FNLN@M@swap@codepen. The “column so far”is stored in a new box register \FLNL@holdcol .
106 \newsavebox\FNLN@holdcol
107 \newcommand*{\SwapFootnoteMain}{%
108 \global \setbox\FNLN@holdcol \vbox{\unvbox\@cclv}%
(. . . cf. \@holdpg in LATEX.)The entire text of a footnote is typeset on top of the MVL. \vsize is maxi-
mized temporarily to avoid that the footnote text is broken across pages.
109 \GStoreGSetReg\vsize\maxdimen
![Page 9: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/9.jpg)
2 IMPLEMENTATION 9
However, the user may want to use \pagebreak in a footnote in order to controlmanually where a “long” footnote is split. v0.41 tries to support this:
110 \global\@FNLN@sw@true %% v0.41
. . . cf. Section 2.5.3.There shouldn’t be any \topskip, the space on top of a footnote is controlled
by \footnotesep entirely:
111 \GStoreGSetReg\topskip\z@skip
(\nointerlineskip as well as setting \topskip locally instead fails . . . accord-ing to \showlists . . .)
Resetting \pagegoal (why doesn’t it switch to \vsize = \maxdimen au-tomatically?), \pagetotal , and the other “special dimens” (TEXbook p. 271;rather experimental . . . I think it is important to restore them later . . .)
112 \GStoreSetReg\pagegoal \vsize
113 \GStoreSetReg\pagetotal\z@
114 \GStoreSetReg\pagestretch\z@
115 \GStoreSetReg\pagefilstretch\z@
116 \GStoreSetReg\pagefillstretch\z@
117 \GStoreSetReg\pagefilllstretch\z@
118 \GStoreSetReg\pageshrink\z@
119 \GStoreSetReg\pagedepth\z@
We must choose certain settings from \@footnotetext such as font:
120 \reset@font\footnotesize
121 \interlinepenalty\interfootnotelinepenalty
LATEX’s split things here are relevant at \insert\footins only: (TODO!?)
122 % \splittopskip\footnotesep
123 % \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
124 \hsize\columnwidth \@parboxrestore
The previous lines were from LATEX’s \@footnotetext. Now we need to re-store the \@thefnmark that belongs to the current footnote text. We use amacro that tears two items from \FNLN@list and executes the rest of LATEX’s\@footnotetext:
125 \expandafter \FNLN@typeset \FNLN@list \@@
126 % \showthe\vsize
. . . so a \vsize assignment without \global is noted here, and an analogous\topskip assignment is not!? TODO . . .
127 }
![Page 10: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/10.jpg)
2 IMPLEMENTATION 10
\FNLN@typeset first removes something from the list of footnotes, similarly toLATEX’s \@xnext and lineno’s \@LN@xnext, then executes a remaining portionof LATEX’s \@footnotetext. The footnote text may contain \par tokens, so thedefinition must be \long:
128 \long\def \FNLN@typeset #1\@lt #2\@lt #3\@@{%
129 \gdef\FNLN@list{#3}%
130 \def\@thefnmark{#1}%
This was our own, and next LATEX continues:
131 \protected@edef\@currentlabel{%
132 \csname p@footnote\endcsname\@thefnmark
133 }%
134 \color@begingroup
We insert starting the lineno settings . . .
135 \linenumbers
136 \setfootnotelinenumbers %% 2010/12/25
. . . LATEX again (v0.41 exports dealing with closing \par to finstrut.sty):
137 \@makefntext{%
138 \rule\z@\footnotesep\ignorespaces
We replace #1 by #2\par (\linenumberpar), so we really need finstrut.sty:
139 #2\par
140 \@finalstrut\strutbox}%
141 \color@endgroup
Now we trigger the “swap back slot” of the OTR:
142 \penalty-\FNLN@M@insert@codepen
143 }
144 \RequirePackage{finstrut}
2.5.5 \insert the Footnote Text
\InsertFootnote is the slot of the OTR that executes \insert\footins withthe numbered footnote text. The “column so far” stored in \FNLN@holdcol isput onto the top of the MVL, and then parts of LATEX’s \@footnotetext areperformed that haven’t been done earlier, applied to the footnote text that theOTR should have found in \box255. Before however, the previous \topskip,\vsize, and the \page. . . book-keeping parameters are restored:
145 \newcommand*{\InsertFootnote}{%
146 \GRestoreReg\topskip \GRestoreReg\vsize
![Page 11: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/11.jpg)
2 IMPLEMENTATION 11
(. . . global restoring of \vsize proved vital with edfndemo 2010/12/17 . . .)
147 \RestoreReg \pagegoal \RestoreReg\pagetotal
148 \RestoreReg \pagestretch
149 \RestoreReg \pagefilstretch
150 \RestoreReg \pagefillstretch
151 \RestoreReg \pagefilllstretch
152 \RestoreReg \pageshrink \RestoreReg\pagedepth
153 \unvbox\FNLN@holdcol
154 \insert\footins{%
155 \splittopskip\footnotesep
156 \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
Support of \pagebreak with v0.41:
157 \unvbox\FNLN@holdft %% v0.41
158 \unvbox\@cclv}%
159 \global\@FNLN@sw@false %% v0.41
With v0.5, global settings for “pagewise” numbering must be restored:
160 \unsetfootnotelinenumbers
161 }
2.6 “Continuous” Numbering
2.6.1 Goal
With v0.5, for the first time we try to get a “pagewise” numbering such that, ifa main text line has a footnote, (i) its printed number is just the natural succes-sor of the printed number of the previous main text line (instead of continuingprevious numbering with the lines of the footnote first), and (ii) the printednumbers of footnote lines just continue the printed numbers of the main textlines. This “obvious” desirement is not easy to achieve; already pagewise num-bering of main text lines, without numbering footnote lines, has been somewhatingenious.
2.6.2 How to Number Lines Pagewise
The basic idea of lineno’s pagewise numbering is:
1. Each numbered line of the document is identified by a unique countervalue, an “absolute” number.
2. For each page (and column), the range of absolute line numbers occurringon them is recorded (or actually: the first and the last number).
3. The “public,” “human-readable” (“pagewise”) format of a given absoluteline number l is generated by (i) finding the page (and column) with firstnumber n and last number k such that n ≤ l ≤ k, (ii) “printing” l−n + 1in “columnwise” mode, otherwise l −m + 1 where m is the first absoluteline number in the left-hand column of the same page.
![Page 12: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/12.jpg)
2 IMPLEMENTATION 12
Generating the “pagewise” representation for a given absolute line number lthus may be summarized as finding the corresponding offset value to be sub-tracted (n, n + 1, m, or m + 1 . . .).
When footnote lines are to be numbered as well, a little problem is the orderin which main text and footnote lines increment the absolute counter. lineno’smechanism for this is started immediately after a paragraph has been brokeninto lines. Each line of the paragraph then calls a macro generating the linenumber. fnlineno now interrupts numbering of main text lines at a line issuinga footnote. The footnote text is typeset, including numbering its lines at eachend of a footnote paragraph. When the footnote text has been sent into the\insert register, numbering of main text lines is resumed.
Up to v0.4 (a development version), we used the same absolute counter formain text and footnote lines. When a page p has more than one main text lineand the first one has a long footnote continued on the next page p + 1, thereis no “range” of absolute line numbers characterizing page p any more, becausethe greatest absolute line number of page p exceeds the absolute line numbersof the footnote continued on page p + 1.
lineno’s procedure can be revived by numbering main text lines and footnotelines independently from each other. We use two absolute counters, one is incre-mented with main text lines only, the other with footnote lines only. Numberingof main text lines just will not be affected by numbering of the footnote lines.
Almost the same will hold for footnote lines. Each page (and column) willhave a characteristic “range” of absolute footnote line numbers {n, . . . , k}. Theonly notable difference will be that for footnote line l we print (l−n+1)+(K−N + 1) = (K + l)− (N + n) + 2 instead of l − n + 1—where {N, . . . , K} is therange of main text line numbers of the page (and column).
The previous discussion of generating the printed line number from itsabsolute version has assumed that corresponding offset values have been givensomehow, or that the “line number ranges” for pages are known from some-where. In fact, these ranges are computed at the start of a LATEX run beforetypesetting, when reading the .aux file for the first time. They are used in theentire document. While typesetting, each numbered line of main text leavesa record of its absolute number and page number in the new version of the.aux file that the run creates, a two-parameter macro \@LN. With fnlineno.sty,there will be new \@FLN entries of the same type. These .aux entries are usedfor building the page range data for the next run. When the document sourcehas been changed, at least two runs will usually be required to get correct linenumbers in page margins, and another run will be needed so references to linenumbers by \ref and \linelabel are correct.
2.6.3 Summary of Changes
Variants of lineno.sty’s code for “pagewise” numbering are following. Sometimeswe generalize pagewise stuff from lineno and re-implement pagewise numberingof main text lines as a special case, the other special case being numbering offootnote lines.
![Page 13: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/13.jpg)
2 IMPLEMENTATION 13
Five things need modifications:
Building page info macros: Processing \@LN and \@FLN .aux entries will useshared building macros, the difference is obtained by switching namespaces. (It may be notable that a page may get one info macro for maintext and another for footnote text, if it contains footnote text.)
Logging: While typesetting, the shared logging macro is switched to writeeither \@LN or \@FLN to the .aux file. Also, \c@linenumber may refer toeither the main text or to the footnote text counter.
Generating “pagewise” format: The choice of \c@linenumber also deter-mines which counter is incremented, and again name spaces for page infomacros are switched. For footnote lines, a tail macro for adding the num-ber of main text lines will be activated.
Referencing: The .aux file may have entries from \linelabel containing largenumbers from an “absolute” counter. In generating the “human-readable”number, it must be known whether it is a main text or a footnote linenumber. An additional complication is referring to a main text line froma footnote and vice versa—thinking of global changes in generating thenumber. Or even think of the case referring from unnumbered text tonumbered text! (I have wondered before if the entry couldn’t be the readyhuman-readable number, TODO!)
Lists of “vertical tasks”: lineno.sty (v4) has introduced two lists of tasks thatwere issued in horizontal mode but only can be completed after breakinga paragraph into lines: one for \linelabels and one for \vadjust itemsthat must wait until the line number has been attached. It is essentialthat the tasks are processed in the same order in vertical mode as theywere issued in horizontal mode. As we are now interrupting processingof main text paragraphs for processing footnotes, tasks for footnote textmust be lined up in separate lists than tasks for main text. This is indeedessential for the previous issue of getting \linelabel work in footnotesas well as in main text.
2.6.4 Info Building
\@LN , \@FLN , and \@FNLN are processed at reading the .aux file before type-setting only. The interface to generating “pagewise” and footnote line num-bers just are \LN@Pfirst and \FLN@Pfirst , eventually pointing to the firstpage/column with numbered main text lines or footnote lines, resp.
162 \def \FLN@Pfirst {\nextLN\relax}
This initialization of \FLN@Pfirst is just the same as the one of \LN@Pfirstin lineno.sty; their expansions are changed as soon as such a page is found,replacing the \relax by the corresponding page info macro.
![Page 14: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/14.jpg)
2 IMPLEMENTATION 14
\LN@Pfirst and \FLN@Pfirst are passed to \testFirstNumberedPage viathe hook \FNLN@first@numbered that by default is the same as \LN@first:
163 \def \FNLN@first@numbered {\LN@Pfirst}
(oh, it must be \def here to recognize the change . . .). This must be changedby \setfootnotelinenumbers (\let then, as when called the change will havehappened).
Moreover, they are passed to \NumberedPageCache (the page info macrowhere a search starts, “current” page/column) as its initialization; the “gener-ating” macros then change the latter macro following \nextLN in the page infomacros.
In this sense, no other “name space switching” is needed for communicationwith other functions.
lineno.sty has changed \LastNumberedPage globally . . . the last page withnumbered footnote lines may well be another one than the last page with num-bered main text lines . . . But fortunately, also \LastNumberedPage is needed inreading the .aux before typesetting only (\@onlypreamble is LATEX’s disablingcommand):
164 \@onlypreamble\LastNumberedPage
In lineno.sty, we have \def\LastNumberedPage{first}. We need the same forthe footnote variant \FNLN@last@numbered (to be handled globally!):
165 \global \let \FNLN@last@numbered \LastNumberedPage
166 \@onlypreamble \FNLN@last@numbered
\@FNLN{〈names〉}〈last-numbered〉{〈line〉}{〈page〉}generalizes lineno.sty’s \@LN{〈line〉}{〈page〉} to re-implement it. There is an ad-ditional parameter argument 〈names〉 for choosing name spaces and a parameter〈last-numbered〉 for choosing the macro storing the “last numbered page.” (Anargument without braces expects a macro name.)
167 \newcommand* \@FNLN [4]{{%
168 \expandafter\@@LN
169 \csname #1#4C\@LN@column \expandafter\endcsname
170 \csname #1O#4\endcsname
171 {#3}{#4}{#1}{#2}}}
172 \@onlypreamble\@FNLN
As in lineno.sty \@LN calls \@@LN, a new variant of \@@LN is called by \@FLNhere, but it gets one additional parameter for passing 〈names〉 and another forpassing 〈last-numbered〉 from \@FLN. So the new syntax is\@@LN〈info〉〈first-page-line〉{〈line〉}{〈page〉}{〈names〉}〈last-numbered〉 :
173 \renewcommand* \@@LN [6]{%
174 \ifx#1\relax
175 \ifx#2\relax\gdef#2{#3}\fi
176 \expandafter\@@@LN\csname #5#6\endcsname#1%
![Page 15: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/15.jpg)
2 IMPLEMENTATION 15
177 \xdef#1{\lastLN{#3}\firstLN{#3}%
178 \pageLN{#4}{\@LN@column}{#2}\nextLN\relax}%
179 \else
180 \def\lastLN##1{\noexpand\lastLN{#3}}%
181 \xdef#1{#1}%
182 \fi
183 \xdef#6{#4C\@LN@column}}
184 \@onlypreamble\@@LN
lineno.sty’s \@@@LN does not need any adjustment.lineno.sty’s \@LN{〈line〉}{〈page〉} is reimplemented as
185 \def \@LN {\@FNLN{LN@P}\LastNumberedPage}
—so \@LN really does the same as before, including name spaces.\@FLN{〈line〉}{〈page〉} is the other special case of the new \@FNLN—an F
precedes the earlier names, and \FNLN@last@numbered is the storing macroinitialized above:
186 \def \@FLN {\@FNLN{FLN@P}\FNLN@last@numbered}
For logging, we make both unexpandable:
187 % \AtBeginDocument{\let\@LN\relax \let\@FLN\relax}
. . . but this way nothing appears in the file!? TODO . . .
188 \@onlypreamble\@LN \@onlypreamble\@FLN
For reading the .aux finally, we do what lineno does with \@LN:
189 \AtEndDocument{\let\@FLN\@gobbletwo}
2.6.5 Tool for Reusing Global Operations with Macros
lineno.sty v4 provides list handling (changing lists globally) and global changesof \NumberedPageCache. We want to use them in “main text” mode aswell as in “footnote” mode. To use such an operation on 〈ln-macro〉 for〈fln-macro〉, we \global\let〈ln-macro〉〈fln-macro〉, apply the operations, andfinally \global\let〈fln-macro〉〈ln-macro〉. However, we are not only interestedin how 〈fln-macro〉 is changed this way, rather 〈ln-macro〉 also is used as inputfor some operations, and we can choose which 〈fln-macro〉 should be used asinput. To switch from working on/with 〈fln-1 〉 to 〈fln-2 〉 using 〈ln-macro〉 withan option to use 〈fln-1 〉 later again, a tool \GStoreUse〈ln-macro〉〈fln-1 〉〈fln-2 〉is provided (should render later switchings much better readable):
190 \newcommand* \GStoreUse [3]{\global\let#2#1\global\let#1#3}
I.e., current content of #1 is stored in #2, then #1 attains the content of #3.
![Page 16: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/16.jpg)
2 IMPLEMENTATION 16
2.6.6 General Settings for Typesetting Stage
Oh my dear, it seems that all the switching for the footnote variant of pagewisemust be global (I can’t find something useful using \aftergroup quickly).Therefore, I render lineno’s \setpagewisenumbers acting globally:
191 \renewcommand*\setpagewiselinenumbers{%
192 \global\let \theLineNumber \thePagewiseLineNumber
193 \global\let \c@linenumber \c@pagewiselinenumber
194 \global\let \makeLineNumber \makePagewiseLineNumber
195 }
I just force this, hehe . . .
196 \setpagewiselinenumbers
As a counterpart to \c@pagelinenumber, \c@footnotelinenumber is reservedfor the absolute footnote line numbers:
197 \newcount\c@footnotelinenumber
\FNLN@@cache stores \NumberedPageCache as from “main” mode:
198 \let \FNLN@@cache \NumberedPageCache
\FNLN@cache stores \NumberedPageCache as from “footnote” mode; its initialcontent is the counterpart or analogue to \LN@Pfirst:
199 \def \FNLN@cache {\FLN@Pfirst}
\FNLN@foot@cache and \FNLN@main@cache switch \NumberedPageCache :
200 \def \FNLN@foot@cache {%
201 \GStoreUse \NumberedPageCache \FNLN@@cache \FNLN@cache}
202 \def \FNLN@main@cache {%
203 \GStoreUse \NumberedPageCache \FNLN@cache \FNLN@@cache}
\FNLN@labels will be the counterpart to lineno.sty’s \@LN@labellist:
204 \global\let \FNLN@labels \@empty
\FNLN@vadjusts will be the counterpart to lineno’s \@LN@vadjustlist:
205 \global\let \FNLN@vadjusts \@empty
Settings for footnote line numbers first resemble \setpagewiselinenumbers;but more changes are needed, and results from main text numbering must bestored. Some of the settings are needed locally for generating numbers for labels,collected in \setgetfootnotelinenumbers ; for this purpose nothing must bestored explicitly:
206 \newcommand* \setgetfootnotelinenumbers {%
![Page 17: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/17.jpg)
2 IMPLEMENTATION 17
Change of \theLineNumber is omitted as we are reading, not writing a label.
207 \let\c@linenumber\c@footnotelinenumber
208 % \let\makeLineNumber\makeFootnoteLineNumber
But in fact, \makeFootnoteLineNumber and \makePagewiseLineNumber willbe the same. The difference is made by the choice of \FNLN@first@numberedand \NumberedPageCache for the line range searches.
209 \let \FNLN@first@numbered \FLN@Pfirst
210 \let \FNLN@finish \FNLN@add
211 }
\setfootnotelinenumbers performs all the settings for typesetting footnotesin line numbering mode globally, including storing results from typesetting maintext:
212 \newcommand* \setfootnotelinenumbers {%
213 \globaldefs\@ne
The previous line also renders \setgetfootnotelinenumbers global:
214 \setgetfootnotelinenumbers
\theLineNumber is used for \linelabel entries. \thePagewiseLineNumber isreplaced by \theFootnoteLineNumber :
215 \let\theLineNumber\theFootnoteLineNumber
Logging to .aux:
216 \def \FNLN@log {\string\@FLN}%
Starting range search: \NumberedPageCache
217 \FNLN@foot@cache
Reusing lineno’s task list operations:
218 \GStoreUse \@LN@labellist \FNLN@@labels \FNLN@labels
219 \GStoreUse \@LN@vadjustlist \FNLN@@vadjusts \FNLN@vadjusts
220 \globaldefs\z@
221 }
For switching back to “main text mode,” again some settings may need a localvariant—for processing line references from footnotes to main text! This is thepurpose of \setgetpagewiselinenumbers :
222 \newcommand* \setgetpagewiselinenumbers {%
223 \let \FNLN@first@numbered \LN@Pfirst
224 \let \FNLN@finish \@gobbletwo
225 }
![Page 18: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/18.jpg)
2 IMPLEMENTATION 18
\unsetfootnotelinenumbers stores the “current” page with footnote linesand loads the “most recent” page with main text lines—and more . . .:
226 \newcommand* \unsetfootnotelinenumbers {%
227 \gdef \FNLN@log {\string\@LN}%
228 \FNLN@main@cache
Task lists:
229 \GStoreUse \@LN@labellist \FNLN@labels \FNLN@@labels
230 \GStoreUse \@LN@vadjustlist \FNLN@vadjusts \FNLN@@vadjusts
231 \globaldefs\@ne \setgetpagewiselinenumbers \globaldefs\z@ %% v0.53
232 \setpagewiselinenumbers
233 }
\makeFootnoteLineNumber actually only copies \makePagewiseLineNumber ,different results are obtained be changing hooks. The command first callslogging— \logtheLineNumber , then generating the “public” line number—\getLineNumber (which in turn only is a copy of \testNumberedPage inlineno.sty).
234 \@ifdefinable\makeFootnoteLineNumber
235 {\let \makeFootnoteLineNumber \makePagewiseLineNumber}
2.6.7 Logging
\logtheLineNumber is redefined to log both main text and footnote line num-bers.
236 \def \logtheLineNumber {%
237 \protected@write\@auxout{}{%
238 \FNLN@log{\the\c@linenumber}{\noexpand\the\c@LN@truepage}}}
\FNLN@log is the hook for the difference, its default expansion \@LN is madefor main text line numbers:
239 \gdef \FNLN@log {\string\@LN}
2.6.8 “Public” Line Numbers
Fortunately, these commands don’t need to know much about name spaces.The interfaces to them are \NumberedPageCache —changing globally—and\FNLN@first@numbered . Our \FNLN@cache is initialized by analogy to itscounterpart \NumberedPageCache (a minute name space change):
240 \def \FNLN@cache {\FLN@Pfirst}
\testFirstNumberedPage{〈integer〉} from lineno.sty is modified by replacing\LN@Pfirst only:
241 \renewcommand* \testFirstNumberedPage [1]{%
242 \ifnum#1>\c@linenumber
![Page 19: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/19.jpg)
2 IMPLEMENTATION 19
243 \def\nextLN##1{%
244 \testNextNumberedPage\FNLN@first@numbered}%
245 \else
246 \let\nextLN\@gobble
247 \def\pageLN{\gotNumberedPage{#1}}%
248 \fi}
\testNumberedPage and \testNextNumberedPage from lineno don’t need anymodification. \testLastNumberedPage is modified in edfnotes.sty.
\gotNumberedPage just needs a closing hook \FNLN@finish to allow forfootnote lines.
249 \renewcommand* \gotNumberedPage [4]{%
250 \oddNumberedPagefalse
251 \ifodd \if@twocolumn #3\else #2\fi\relax\oddNumberedPagetrue\fi
252 \advance\c@linenumber\@ne
253 \ifcolumnwiselinenumbers
254 \subtractlinenumberoffset{#1}%
255 \else
256 \subtractlinenumberoffset{#4}%
257 \fi
258 % \show\FNLN@finish
259 \FNLN@finish{#2}{#3}%
260 }
\FNLN@finish{〈page〉}{〈column〉} gobbles both arguments with main textlines, but will add the number of main text lines to footnote line numbers:
261 \global\let \FNLN@finish \@gobbletwo
Then it will act as \FNLN@add . We run the page info macro for the same page(column; if defined).
262 \newcommand* \FNLN@add [2]{%
263 \expandafter \let\expandafter \@tempa\csname LN@P#1C#2\endcsname
264 \ifx\@tempa\relax
265 \else
266 \advance\c@linenumber\@ne
267 \ifcolumnwiselinenumbers
268 \let\firstLN\subtractlinenumberoffset
. . . rather assuming \realpagewiselinenumbers.
269 \let\pageLN\@gobblethree
270 \else
271 \let\firstLN\@gobble
272 \def\pageLN##1##2##3{\subtractlinenumberoffset{##3}}%
273 \fi
274 \def\lastLN##1{\subtractlinenumberoffset{-##1}}%
275 \let\nextLN\@gobble
![Page 20: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/20.jpg)
2 IMPLEMENTATION 20
. . . TODO all needed?
276 \@tempa
277 \fi
278 }
2.6.9 Referencing
Now that we are using two separate counters for main text lines and foot-note lines (v0.5), correct references to footnote lines using \linelabel and\ref need further adjustments. lineno.sty’s \thePagewiseLineNumber and\getpagewiselinenumber{〈integer〉} are generalized and re-implemented bymacros that then serve to implement referring to footnote line numbers.
\theWiseLineNumber{〈trans〉} leaves a \protected call to a one-parametermacro 〈trans〉 in the .aux file:
279 \newcommand* \theWiseLineNumber [1]{\protect #1{\the\c@linenumber}}
\getwiselinenumber{〈choice〉}{〈integer〉} executes 〈choice〉 before applying\testNumberedPage to 〈integer〉—within a local group:
280 \newcommand* \getwiselinenumber [2]{{%
Some wisdom is needed to take account of the current “numbering state” fromwhich \ref was called.
Referring to main text line:
• Unless called from numbered footnote, no extra care is needed.
• If called from numbered footnote, \setgetpagewiselinenumbersand temporary switching of \NumberedPageCache is needed.
Referring to footnote line:
• If called from numbered footnote, no extra care is needed.
• Otherwise, \setgetfootnotelinenumbers and temporary switchingof \NumberedPageCache is needed.
281 \ifx#1\relax %% to main text
282 \if@FNLN@sw@ %% from footnote
283 \setgetpagewiselinenumbers
284 \FNLN@main@cache
285 \let \FNLN@restore@cache \FNLN@foot@cache
286 \fi
287 \else %% to footnote
288 \if@FNLN@sw@ \else %% from elsewhere
289 #1%
290 \FNLN@foot@cache
291 \let \FNLN@restore@cache \FNLN@main@cache
292 \fi
![Page 21: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/21.jpg)
2 IMPLEMENTATION 21
293 \fi
294 \c@linenumber #2\relax\testNumberedPage
295 \thelinenumber
296 \FNLN@restore@cache
297 }}
298 \let \FNLN@restore@cache \relax
\getpagewiselinenumber doesn’t need any 〈choice〉—we assume that the la-bel was written in the default pagewise mode (but it is difficult, though, \relaxis essential!):
299 % \renewcommand* \getpagewiselinenumber {\getwiselinenumber\relax} %!!
2010/12/31, a compatibility problem with ednotes’ \newlabel mechanismshows up. ednotes “undefines” \getpagewiselinenumber and restores it only\AtBeginDocument. We must ensure that ednotes will not override our newversion of \getpagewiselinenumber. (TODO in my view another motivationto write “ready” numbers without \getpagewiselinenumbers directly.)
We might assume that ednotes (if at all) is loaded directly and loads lineno.sty(that is the usual and recommended way of using ednotes) and that this willhappen before fnlineno.sty is loaded. But now that we have spent some timeunderstanding the situation, we can deal with the case as well that lineno.styis loaded first, then fnlineno.sty is loaded, and then ednotes. (I have assumedearlier that fnlineno.sty is loaded after lineno.sty . . .)
300 \AtBeginDocument{%
301 \def \getpagewiselinenumber {\getwiselinenumber\relax}% sic!
302 \let \@EN@getpagewiselno \getpagewiselinenumber}
For \thePagewiseLineNumber , 〈trans〉 is \getpagewiselinenumber:
303 \renewcommand* \thePagewiseLineNumber {%
304 \theWiseLineNumber\getpagewiselinenumber}
\getfootnotelinenumber{〈integer〉} considers 〈integer〉 the absolute numberof a footnote line. The 〈choice〉 therefore is \setgetfootnotelinenumbers:
305 \newcommand* \getfootnotelinenumber {%
306 \getwiselinenumber\setgetfootnotelinenumbers}
Finally, \theFootnoteLineNumber is how \linelabel refers to a footnote line.\theWiseLineNumber is called with 〈trans〉 being \getfootnotelinenumber:
307 \newcommand* \theFootnoteLineNumber {%
308 \theWiseLineNumber\getfootnotelinenumber}
2.7 Leaving the Package File
309 \endinput
![Page 22: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/22.jpg)
3 ACKNOWLEDGEMENTS 22
3 Acknowledgements
On the texhax mailing list, Boris Veytsman recommended using Victor Eijk-hout’s TEX by Topic to me, and Andrej Lapshin pointed me to David Salomon’swork on output routines (TUGboat 1990 and 1994, also available as a book, asUlrich Dirr tells me). It helped me a lot to read about output routines inthese works, beyond the TEXbook. The abbreviations ‘OTR’ and ‘MVL’ areSalomon’s.—And recall Christian’s work and support by the DFG named atthe start of the package file.—And . . . the ideas of how to implement (i) attach-ing line numbers, (ii) \linelabel, and (iii) numbering lines “pagewise”—soflexibly, compatibly with many other LATEX packages, still are Stephan’s . . .
4 VERSION HISTORY
310 v0.1 2010/12/08 very first, \linelabel works in footnote
311 SENT TO Christian, problems with "long" footnotes
312
313 v0.2 2010/12/08 corr. "manifoot"
314 2010/12/09 moving doc. from .tex to here,
315 different doc. sectioning;
316 \@footnotetext modified (user feature!);
317 \@doclearpage NOT modified!; \if@FNLN@placing@
318 2010/12/10 ignore dummy footnote split;
319 \FNLNpar, \AutoPars, \ExplicitPars,
320 more on limitations
321 2010/12/11 more trying, almost anew ...
322 JUST STORED
323
324 v0.3 2010/12/12 new approach, removed much before proceeding
325 2010/12/13 -- this was putting \box\footins onto MVL,
326 bad with those penalties
327 JUST STORED
328
329 v0.4 2010/12/14 another new approach:
330 typeset footnote on MVL immediately --
331 described strategy
332 2010/12/15 ... continued, choice of hooking into \output
333 (...swap...)
334 2010/12/16 ... continued; rearranged sections ...
335 \FNLN@@fntext vs. ...ltx...
336 2010/12/17 success with \pagegoal ...; \GStoreReg etc.;
337 ...@fntext shortened
338 2010/12/18 another two limitations: \pagebreak in fn.,
339 guessed/tested; another note to <register>;
340 ack. Christian; directed -> organized!?
341 SENT TO Christian/Stephan
342
343 v0.41 2010/12/19 support of \pagebreak with \if@FNLN@sw@ etc.;
![Page 23: fnlineno.sty Numbering Footnote Linesctan.math.utah.edu/.../latex/contrib/lineno/fnlineno.pdf · 2011. 2. 16. · fnlineno.sty extends lineno.sty1 (created by Stephan I. B ottcher)](https://reader036.vdocuments.site/reader036/viewer/2022071610/61493355080bfa6260147532/html5/thumbnails/23.jpg)
4 VERSION HISTORY 23
344 TODO on lists of <register>s
345 2010/12/20 debugging: \if...true; \setbox...ft;
346 \@finalstrut in vmode exported to finstrut.sty;
347 notes on how v0.41 still fails with \pagebreak
348 2010/12/21 additional notes on *two* \pagebreak’s
349
350 v0.5 2010/12/21 restructuring doc., check@latex@ -> check@,
351 own account of lineno’s pagewise mode
352 2010/12/22 ... continued ...
353 2010/12/23 ... continued ...
354 2010/12/24 ... continued ...
355 2010/12/25 moved this to pwlineno, replaced ...
356 more on \FNLN@typeset, + \setfootnotelinenumbers
357 2010/12/26 new summary of implementation,
358 rearranged code sections; logging settled
359 v0.51 2010/12/27 "build" settled, typesetting, logging reformated;
360 ack.s: "recall"; all settings global,
361 "public" works
362 JUST STORED, MARGINAL NUMBERS OK,
363 \linelabel in footnote broken
364 [2010/12/28]
365 v0.52 2010/12/28 own label and vadjust lists for footnotes;
366 local settings for referencing,
367 tool and care for global changes (...Cache)
368 (TODO write ready in .aux? needs another run)
369 \linelabel’s ok, MARGINAL NOTES MAIN BROKEN
370 v0.53 2010/12/28 debugging; OK; minor doc. modifications;
371 less "limitations"; \\[\smallskipamount]
372 TO CHRISTIAN 2010-12-29
373 v0.54 2010/12/31 typo options; \FNLN@text without arg,
374 \getpagewiselinenumber with ednotes
375 2011/01/01 \FNLN@cache, \FNLN@@cache initialized;
376 doc. "Typesetting Stage" qualification
377 2011/01/02 that qualification was wrong
378 2011/01/03 samepage@hook
379 TO CHRISTIAN SAME DAY
380 v0.55 2011/01/04 samepage@hook emptied here as well;
381 2011/01/06 edited version history
382 2011/01/07 note on \if@FNLN@sw@ with v0.5;
383 finally without support for samepage@hook!
384 note on \testLastNumberedPage
385 PART OF EDFN RELEASE r0.5 (together with edfnotes v0.2)
386 v0.55a 2011/02/09 corr. owner; "Limitations" updated; \pagebreak
387