Debian Codegraph @

texmf-dist/tex/latex/lwarp/lwarp-endnotes.sty

raw
1 %%
2 %% This is file `lwarp-endnotes.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% lwarp.dtx (with options: `endnotes')
8 %% This is a generated file.
9 %% Copyright 2016-2026 Brian Dunn
10 %%
11 %% This work may be distributed and/or modified under the
12 %% conditions of the LaTeX Project Public License, either version 1.3
13 %% of this license or (at your option) any later version.
14 %% The latest version of this license is in
15 %% http://www.latex-project.org/lppl.txt
16 %% and version 1.3 or later is part of all distributions of LaTeX
17 %% version 2005/12/01 or later.
18
19 \LWR@ProvidesPackagePass{endnotes}[2020-01-02]
20 \def\enoteformat{%
21 \leavevmode
22 \makeenmark
23 }
24 \def\LWR@HTML@@makeenmark{\hbox{\LWR@htmlspan{sup}{\normalfont\theenmark}}}
25 \LWR@formatted{@makeenmark}
26
27 \def\makeenmark{\@makeenmark}
28 \apptocmd{\LWR@nullifyfootnotes}{%
29 \renewcommand{\endnote}[2][]{}%
30 \renewcommand{\endnotemark}[1]{}%
31 }{}{}
32 \def\theendnotes{\immediate\closeout\@enotes \global\@enotesopenfalse
33 \begingroup
34 \makeatletter
35 %
36 % The machinery with \@ResetGT and > here ensures that
37 % \@doanenote works properly even if > is an active character
38 % at the point where \theendnotes is invoked. > needs to have
39 % catcode 12 when the arguments of \@doanenote are scanned, so
40 % that the > in the string "macro:->" is matched. The actual
41 % footnote text is not an argument to \@doanenote, but just
42 % follows it in the .ent file; so \@ResetGT can reset the
43 % category code for > that should be used when processing
44 % that text. That resetting takes place within a
45 % \begingroup-\endgroup block set up by \@doanenote and
46 % \@endanenote, so the catcode for > is back to 12 for the
47 % next note.
48 %
49 \edef\@tempa{`\string >}%
50 \ifnum\catcode\@tempa=12%
51 \let\@ResetGT\relax
52 \else
53 \edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}%
54 \@makeother\>%
55 \fi
56 \def\@doanenote##1##2>{\def\@theenmark{##1}\par\begingroup
57 \@ResetGT
58 \def\@currentcounter{endnote}%
59 \edef\@currentlabel{\csname p@endnote\endcsname\@theenmark}%
60 \enoteformat}
61 \def\@endanenote{\par\endgroup}%
62 \enoteheading
63 \enotesize
64 \InputIfFileExists{\jobname.ent}{}{%
65 \PackageWarning{endnotes}{No endnotes found (file \jobname.ent does not exist)\MessageBreak}
66 }%
67 \endgroup}
68 \begin{warpMathJax}
69 \def\endnotename{endnote}
70 \appto\LWR@syncnotenumbers{\LWR@synconenotenumber{LWRendnote}{\theendnote}}
71 \appto\LWR@syncnotenames{\LWR@synconenotename{LWRendnote}{\endnotename}}
72 \CustomizeMathJax{\def\LWRendnote{1}}
73 \CustomizeMathJax{\newcommand{\endnote}[2][\LWRendnote]{{}^{\mathrm{#1}}}}
74 \CustomizeMathJax{\newcommand{\endnotemark}[1][\LWRendnote]{{}^{\mathrm{#1}}}}
75 \end{warpMathJax}
76
77 \endinput
78 %%
79 %% End of file `lwarp-endnotes.sty'.