Debian Codegraph @

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

raw
1 %%
2 %% This is file `lwarp-parnotes.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% lwarp.dtx (with options: `parnotes')
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 \LWR@ProvidesPackagePass{parnotes}[2019/07/23]
19 \VerifyCommand[lwarp][parnotes]{\PN@parnote@real}
20 {91361D751D6393BA644478FDE4A764DA}
21
22 \long\def\PN@parnote@real#1#2{%
23 \parnotemark{#1}%
24 % Unless this is the first parnote in \PN@text, add a separator first
25 \unless\ifx\PN@text\@empty\g@addto@macro\PN@text{\parnoteintercmd}\fi
26 % Redefine \@currentlabel to the parnote label, so \label works
27 \g@addto@macro\PN@text{%
28 \def\@currentlabel{#1}%
29 \def\cref@currentlabel{% lwarp
30 [parnotemark][\arabic{parnotemark}][]\theparnotemark%
31 }%
32 }%
33 \g@addto@macro\PN@text{%
34 \LWR@textcurrentfont{% lwarp
35 \parnotemark{#1}\nolinebreak\thinspace#2%
36 }%
37 }%
38 }
39
40 \VerifyCommand[lwarp][parnotes]{\PN@parnotes@real}
41 {AF1257823BFCBC31ADDA4AAE1F3F3710}
42
43 \def\PN@parnotes@real{%
44 \ifPN@inparnotes
45 \else
46 \LWR@stoppars%
47 \addtocounter{LWR@spandepth}{1}%
48 % We call \par later, so this avoids recursion with \PN@parnotes@auto
49 \PN@inparnotestrue
50 % Avoid page breaks between a paragraph and its parnotes
51 \begin{BlockClass}(note){footnotes}% lwarp
52 \leavevmode\LWR@orignewline%
53 {%
54 \parnotefmt{\PN@text}%
55 }%
56 \leavevmode\LWR@orignewline%
57 \end{BlockClass}% lwarp
58 \leavevmode\LWR@orignewline%
59 \global\def\PN@text{}%
60 %
61 % These can be enabled or disabled by package options
62 %
63 \PN@disable@indent
64 \PN@reset@optional
65 \PN@inparnotesfalse
66 \addtocounter{LWR@spandepth}{-1}%
67 \fi
68 }
69
70 \newbool{LWR@parnotes@doingauto}
71 \boolfalse{LWR@parnotes@doingauto}
72
73 \VerifyCommand[lwarp][parnotes]{\PN@parnotes@auto}
74 {08CC1722ABA55FA01D64F2B29C919D70}
75
76 \def\PN@parnotes@auto{%
77 \ifbool{LWR@parnotes@doingauto}{
78 \ifx\@currenvir\@PN@autopn
79 \unless\ifPN@inparnotes
80 \unless\ifx\PN@text\@empty
81 \expandafter\PN@parnotes@real
82 \fi
83 \fi
84 \fi
85 }{}%
86 }
87 \renewenvironment{autopn}%
88 {\booltrue{LWR@parnotes@doingauto}}
89 {\PN@parnotes@auto}%
90 \AtBeginDocument{
91 \ifdef{\crefname}{
92 \crefname{parnotemark}{paragraph note}{paragraph notes}
93 \Crefname{parnotemark}{Paragraph note}{Paragraph notes}
94 }{}
95 }
96 \apptocmd{\LWR@nullifyfootnotes}{%
97 \renewcommand{\parnote}[2][]{}%
98 \renewcommand\parnotemark[1]{}%
99 }{}{}
100 \begin{warpMathJax}
101 \providecommand{\parnotename}{parnote}
102 \appto\LWR@syncnotenumbers{%
103 \addtocounter{parnotemark}{-1}% specific to parnotes
104 \LWR@synconenotenumber{LWRparnote}{\theparnotemark}%
105 \addtocounter{parnotemark}{1}% specific to parnotes
106 }
107 \appto\LWR@syncnotenames{\LWR@synconenotename{LWRparnote}{\parnotename}}
108 \CustomizeMathJax{\def\LWRparnote{1}}
109 \CustomizeMathJax{\newcommand{\parnote}[2][\LWRparnote]{{}^{\mathrm{#1}}}}
110 \CustomizeMathJax{\newcommand{\parnotemark}[1][\LWRparnote]{{}^{\mathrm{#1}}}}
111 \end{warpMathJax}
112
113 \endinput
114 %%
115 %% End of file `lwarp-parnotes.sty'.