Debian Codegraph @

texmf-dist/doc/latex/fnpct/fnpct-manual.cls

raw
1 % --------------------------------------------------------------------------
2 % the FNPCT package
3 %
4 % footnotes' interaction with punctuation
5 %
6 % --------------------------------------------------------------------------
7 % Clemens Niederberger
8 % Web: https://github.com/cgnieder/fnpct/
9 % E-Mail: [email protected]
10 % --------------------------------------------------------------------------
11 % Copyright 2012--2022 Clemens Niederberger
12 %
13 % This work may be distributed and/or modified under the
14 % conditions of the LaTeX Project Public License, either version 1.3c
15 % of this license or (at your option) any later version.
16 % The latest version of this license is in
17 % http://www.latex-project.org/lppl.txt
18 % and version 1.3c or later is part of all distributions of LaTeX
19 % version 2008/05/04 or later.
20 %
21 % This work has the LPPL maintenance status `maintained'.
22 %
23 % The Current Maintainer of this work is Clemens Niederberger.
24 % --------------------------------------------------------------------------
25 \RequirePackage[multiple]{fnpct}
26 \ProvidesClass{fnpct-manual}[2022/02/27]
27
28 \LoadClass[load-preamble,add-index]{cnltx-doc}
29 \RequirePackage{imakeidx}
30
31 \setcnltx{
32 package = {fnpct} ,
33 info = {footnotes' interaction with punctuation} ,
34 authors = Clemens Niederberger ,
35 email = [email protected] ,
36 url = https://github.com/cgnieder/fnpct/ ,
37 abstract = {%
38 The \fnpct\ package basically does two things to footnotes: if footnote
39 marks are followed by a punctuation mark the order of footnote and
40 punctuation mark is reversed and the kerning gets adjusted. As a side
41 effect mutiple footnotes and footnote ranges are easily obtained..%
42 },
43 add-cmds = {
44 AdaptNote,
45 AdaptNoteName,
46 AddPunctuation,
47 % kfc,
48 % kfp,
49 multfootnote,
50 MultVariant,
51 setfnpct
52 } ,
53 add-silent-cmds = {
54 @mpfn,
55 anote,
56 anotecontent,
57 arabic,
58 DeclareNewFootnote,
59 endnote,
60 footcite
61 footnoteB,
62 footref,
63 IfBooleanTF,
64 IfNoValueTF,
65 multendnote,
66 multfootcite,
67 multparnote,
68 multsidenote,
69 myfn,
70 newfootnotes,
71 parnote,
72 parnotes,
73 sidenote,
74 theendnotes,
75 thempfootnote
76 } ,
77 makeindex-setup = {options={-s cnltx.ist},columns=3,columnsep=1em} ,
78 index-setup = {othercode=\footnotesize,level=\addsec},
79 quote-author-format = \upshape
80 }
81
82 \RequirePackage{array,booktabs}
83
84 \RequirePackage{endnotes}
85 \RequirePackage{parnotes}
86 \RequirePackage{sepfootnotes}
87
88 \newfootnotes{a}
89
90 \renewcommand\thempfootnote{\arabic{mpfootnote}}
91
92 \DeclareTranslation{english}{cnltx-default}{Initial}
93
94 \protected\def\@versionstar{\raisebox{-.25em}{*}}
95 \newcommand\versionstar{\texorpdfstring{\@versionstar}{*}}
96
97 \newcommand*\TF{\textcolor{red}{\uline{\code{\textcolor{cs}{\textit{TF}}}}}}
98
99 \RequirePackage{fontawesome}
100 \RequirePackage{datetime2}
101 \DTMsetup{useregional=numeric,datesep=/}
102 \newrobustcmd*\fnpct@add@version[2]{%
103 \csdef{ac@ver@#2}{%
104 \DTMdate{#1}%
105 \csgdef{ac@ver@#2used}{}%
106 \csdef{ac@ver@#2}{\DTMdate{#1}}%
107 }%
108 }
109
110 \newrobustcmd*\ac@date[1]{\ifcsdef{ac@ver@#1used}{}{ (\csuse{ac@ver@#1})}}
111 \newrobustcmd*\ac@ifnew[1]{\ifcsstring{c_fnpct_version_tl}{#1}}
112 \newrobustcmd*\ac@NEW{\faStarO\ New}
113
114 \renewrobustcmd*\sinceversion[1]{%
115 \ac@ifnew{#1}%
116 {\cnltx@version@note{\textcolor{red}{\ac@NEW}}}%
117 {\cnltx@version@note{\GetTranslation{cnltx-introduced}~v#1\ac@date{#1}}}%
118 }
119 \renewrobustcmd*\changedversion[1]{%
120 \cnltx@version@note{\GetTranslation{cnltx-changed}~v#1\ac@date{#1}}%
121 }
122
123 \newnote*\sincechanged[2]{%
124 \GetTranslation{cnltx-introduced}~#1\ac@date{#1},
125 changed with ~v#2\ac@date{#2}\ac@ifnew{#2}{ \ac@NEW}{}%
126 }
127
128 \RenewDocumentEnvironment{commands}{}
129 {%
130 \cnltx@set@catcode_{12}%
131 \let\command\cnltx@command
132 \cnltxlist
133 }
134 {\endcnltxlist}
135
136 \RequirePackage{tcolorbox,xsimverb}
137 \tcbuselibrary{skins,breakable}
138 \tcbset{enhanced,enhanced jigsaw}
139
140 \newtcolorbox{bewareofthedog}{
141 colback = red!2!white!98 ,
142 colframe = red ,
143 underlay={%
144 \path[draw=none]
145 (interior.south west)
146 rectangle node[red]{\Huge\bfseries !}
147 ([xshift=-4mm]interior.north west);
148 }%
149 }
150
151 \newtcolorbox{cnltxcode}[1][]{
152 boxrule = 1pt ,
153 colback = cnltxbg ,
154 colframe = cnltx ,
155 arc = 5pt ,
156 beforeafter skip = .5\baselineskip ,%
157 #1%
158 }
159
160 \newcommand*\fnpctman@readoptions[1]{%
161 \catcode`\^^M=13
162 \fnpctman@read@options{#1}%
163 }
164
165 \begingroup
166 \catcode`\^^M=13
167 \gdef\fnpctman@read@options#1#2^^M{%
168 \endgroup
169 \ifblank{#2}{}{\fnpctman@read@options@#2}%
170 #1%
171 \XSIMfilewritestart*{\jobname.tmp}%
172 }%
173 \endgroup
174 \def\fnpctman@read@options@[#1]{\pgfqkeys{/cnltx}{#1}}
175
176 \RenewDocumentEnvironment{sourcecode}{}
177 {%
178 \begingroup
179 \fnpctman@readoptions{%
180 \setlength\cnltx@sidebysidewidth
181 {\dimexpr .45\columnwidth -\lst@xleftmargin -\lst@xrightmargin\relax}%
182 \expanded{%
183 \noexpand\lstset{
184 style=cnltx,
185 \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
186 {linewidth=\cnltx@sidebysidewidth,}{}%
187 \expandonce\cnltx@local@listings@options
188 }%
189 }%
190 \XSIMgobblechars{2}%
191 }%
192 }
193 {%
194 \XSIMfilewritestop
195 \cnltxcode[breakable]%
196 \lstinputlisting[style=cnltx]{\jobname.tmp}%
197 \endcnltxcode
198 }
199
200 \RenewDocumentEnvironment{example}{}
201 {%
202 \begingroup
203 \fnpctman@readoptions{%
204 \setlength\cnltx@sidebysidewidth
205 {\dimexpr .45\columnwidth -\lst@xleftmargin -\lst@xrightmargin\relax}%
206 \expanded{%
207 \noexpand\lstset{
208 style=cnltx,
209 \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
210 {linewidth=\cnltx@sidebysidewidth,}{}%
211 \expandonce\cnltx@local@listings@options
212 }%
213 }%
214 \XSIMgobblechars{2}%
215 }%
216 }
217 {%
218 \XSIMfilewritestop
219 \ifbool{cnltx@sidebyside}
220 {%
221 \cnltxcode
222 \noindent
223 \minipage[c]{\cnltx@sidebysidewidth}%
224 \cnltx@pre@source@hook
225 \lstinputlisting[style=cnltx] {\jobname.tmp}%
226 \cnltx@after@source@hook
227 \endminipage\hfill
228 \minipage[c]{\cnltx@sidebysidewidth}%
229 \cnltx@pre@example@hook
230 \input {\jobname.tmp}%
231 \cnltx@after@example@hook
232 \endminipage
233 }
234 {%
235 \cnltxcode[breakable]%
236 \cnltx@pre@source@hook
237 \lstinputlisting{\jobname.tmp}%
238 \cnltx@after@source@hook
239 \ifbool{cnltx@float}{}{%
240 \tcblower
241 \cnltx@pre@example@hook
242 \input {\jobname.tmp}%
243 \cnltx@after@example@hook
244 }
245 }%
246 \endcnltxcode
247 \ifbool{cnltx@float}{%
248 \cnltx@float@start
249 \ifdefvoid\cnltx@float@caption{}{\caption{\cnltx@float@caption}}%
250 \expandafter\end\expandafter{\cnltx@float@type}%
251 }{}%
252 }
253
254 \RequirePackage[
255 backend=biber,
256 style=cnltx,
257 sortlocale=en_US,
258 indexing=cite]{biblatex}
259 \RequirePackage{csquotes,varioref}
260
261 \defbibheading{bibliography}[\bibname]{\addsec{#1}}
262
263 \RequirePackage[biblatex]{embrac}[2012/06/29]
264 \ChangeEmph{[}[,.02em]{]}[.055em,-.08em]
265 \ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em]
266
267 \NewDocumentCommand\noranges{sm}{%
268 \begin{bewareofthedog}
269 \IfBooleanTF{#1}{\pkg*}{\pkg}{#2} cannot be used together with
270 \keyis{ranges}{true}.
271 \end{bewareofthedog}
272 }
273
274 \RequirePackage{hyperref}
275
276 % additional packages:
277 \RequirePackage{longtable,array,booktabs,enumitem,amssymb}
278
279 % ----------------------------------------------------------------------------
280 \newrobustcmd*\pdfdisable[2]{%
281 \csdef{fnpct@@\cnltx@stripbs#1}##1{#2}%
282 \def#1##1{%
283 \csuse{fnpct_if_star_gobble:nTF}{##1}%
284 {\csuse{fnpct@@\cnltx@stripbs#1}}%
285 {\csuse{fnpct@@\cnltx@stripbs#1}{##1}}%
286 }%
287 }
288
289 \pdfstringdefDisableCommands{%
290 \pdfdisable\template{#1}%
291 \pdfdisable\property{#1}
292 \pdfdisable\cs{\string\\#1}%
293 \pdfdisable\cmd{\string\\#1}%
294 \pdfdisable\option{#1}%
295 \def\oarg#1{[<#1>]}%
296 \def\Oarg#1{[#1]}%
297 \def\marg#1{\{<#1>\}}%
298 \def\Marg#1{\{#1\}}%
299 \def\fnpct{fnpct}%
300 \def\LaTeX{LaTeX}%
301 \def\TeX{TeX}%
302 }
303 % ----------------------------------------------------------------------------
304 \fnpct@add@version{2012-05-22}{0.1}
305 \fnpct@add@version{2012-05-23}{0.1a}
306 \fnpct@add@version{2012-05-26}{0.2}
307 \fnpct@add@version{2012-06-01}{0.2a}
308 \fnpct@add@version{2012-06-07}{0.2b}
309 \fnpct@add@version{2012-06-28}{0.2c}
310 \fnpct@add@version{2012-07-07}{0.2d}
311 \fnpct@add@version{2012-07-24}{0.2e}
312 \fnpct@add@version{2012-08-27}{0.2f}
313 \fnpct@add@version{2012-11-14}{0.2g}
314 \fnpct@add@version{2013-01-18}{0.2h}
315 \fnpct@add@version{2013-01-21}{0.2i}
316 \fnpct@add@version{2013-02-22}{0.2j}
317 \fnpct@add@version{2013-04-07}{0.2k}
318 \fnpct@add@version{2013-04-16}{0.3}
319 \fnpct@add@version{2013-06-14}{0.3a}
320 \fnpct@add@version{2013-12-22}{0.4}
321 \fnpct@add@version{2013-12-23}{0.4a}
322 \fnpct@add@version{2014-03-10}{0.4b}
323 \fnpct@add@version{2015-02-20}{0.4c}
324 \fnpct@add@version{2015-04-23}{0.4d}
325 \fnpct@add@version{2016-03-25}{0.4e}
326 \fnpct@add@version{2019-02-17}{0.4f}
327 \fnpct@add@version{2019-09-30}{0.4g}
328 \fnpct@add@version{2019-10-05}{0.5}
329 \fnpct@add@version{2020-01-12}{0.5a}
330 \fnpct@add@version{2021-01-21}{1.0}
331 \fnpct@add@version{2022-01-04}{1.0a}
332 \fnpct@add@version{2022-01-29}{1.0b}
333 \fnpct@add@version{2022-02-03}{1.1}
334 \fnpct@add@version{2022-02-27}{1.1a}
335
336 \endinput