-
Notifications
You must be signed in to change notification settings - Fork 0
/
gWmaths.def
336 lines (278 loc) · 16 KB
/
gWmaths.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
\NeedsTeXFormat{LaTeX2e}[2020/10/01]%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%!TeX program = pdflatexmk
%%!TEX encoding = UTF-8
%%!TEX root = gWmaths.dtx
%!TEX parameter = -8bit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProvidesExplFile
{gWpkgs} {2022/06/30} {0.1.0}%
{COVID-19 Quarantine Accessible \TeX* Project: Package Ordering Edition}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\declare@file@substitution{ifxetex.sty}{iftex.sty}
\declare@file@substitution{ifpdf.sty}{iftex.sty}
\declare@file@substitution{ifluatex.sty}{iftex.sty}
%\declare@file@substitution{ifvtex.sty}{iftex.sty}% bunchastuff
%\declare@file@substitution{ifetex.sty}{iftex.sty}% \NeedsETeX
\declare@file@substitution{fink.sty}{currfile.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclarePackageOrdering{ format }{before}{ fontspec, fontenc }[dumping the format must happen before any platform-native fonts are loaded]
\DeclarePackageOrdering{ format }{before}{ cmap, mmap, unicode-math, babel, realscripts }[]
\DeclarePackageOrdering{ format }{after}{ documentclass / before, }[]
\DeclarePackageDependency{markdown}{ keyval,
url,
graphicx,
paralist,
ifthen,
fancyvrb,
csvsimple,
gobble, }[documentation explicitly states dependencies]
\DeclarePackageOrdering{ \gW@documentClass }{before}{ hyperref, amsmath, babel, bookmark, nameref, hyperxmp, backref, geometry, parskip, fontspec }[lots of packages assume some prerequisites set by the class, like page size]
%\DeclarePackageOrdering{ geometry }{after}{ \gW@documentClass }[classes often set page geometry using primitives, but this breaks for \cls{beamer}]%
%\DeclarePackageOrdering{ fontspec }{after}{ \gW@documentClass }[\pkg{fontspec} requires classes to have already defined \cs{normalfont}]%
\DeclarePackageDependency{mmap}{cmap}[\pkg{mmap} loads \pkg{cmap} without options immediately...unless \pkg{mmap} decides not to load (\cs{RequirePDFTeX})]
\DeclarePackageOrdering{ csquotes }{after}{ \gW@documentClass }[\pkg{csquotes} redefines \cs{quote}]
\DeclarePackageOrdering{ paralist }{after}{ \gW@documentClass }[\pkg{paralist} redefines several environments]
\DeclarePackageOrdering{ ntheorem }{after}{ \gW@documentClass }[\pkg{ntheorem} redefines several environments]
\DeclarePackageOrdering{ hologo }{after}{ graphics, pgf, }[\pkg{hologo} will use \pkg{graphics} or \pkg{pgf} if already loaded]%
\DeclarePackageDependency{ unicode-math }{ l3keys2e, fontspec, fix-cm, amsmath, }[\pkg{unicode-math} \cs{RequirePackage}s these]%
\DeclarePackageDependency{ backref }{ kvoptions, kvsetkeys, ltxcmds, rerunfilecheck, }[\pkg{backref} \cs{RequirePackages}s these]%
\DeclarePackageOrdering{ backref }{after}{ chicago, hyperref, }[\pkg{backref} checks if these are loaded and modifies it's behavior]%
\DeclarePackageOrdering{ showkeys }{incompatible-warning}{ hyperref }[\pkg{showkeys} renders \cs{label}s and \cs{ref}s, so it steps on \pkg{hyperref}'s toes]
%
%
%\DeclarePackageOrdering{ fontenc }{after}{ documentclass / after }%
\DeclarePackageDependency{ realscripts }{ fontspec }[\pkg{realscripts} \cs{RequirePackage}s \pkg{fontspec}.]
\DeclarePackageDependency*{ pgf }{ pgfrcs, pgfcore, }%
\DeclarePackageDependency{ pgfcore }{ graphicx, pgfsys, keyval, xcolor, }%
\DeclarePackageDependency{ pgfmath }{ pgfrcs, pgfkeys, }%
\DeclarePackageDependency{ xxcolor }{ xcolor }%
\DeclarePackageDependency{ pgffor }{ pgfrcs, pgfkeys, pgfmath, }%
\DeclarePackageDependency{ axessibility }{tagpdf}[\pkg{axessibility} \cs{RequirePackage}s \pkg{tagpdf}]
\DeclarePackageDependency{ currfile }{ filehook }
\DeclarePackageDependency{ accessibility }{ xkeyval,
ifthen, }[\cs{RequirePackage}]
\DeclarePackageOrdering{ accessibility }{incompatible-error}{ tagpdf }
\DeclarePackageOrdering{ accessibility }{after}{ pdfcomment,
listings,
hyperref,
caption, subcaption,
tocbibind,
tocloft,
ragged2e,
listings,
etoolbox,
parskip,
setspace,
cmap,
fontenc,
inputenc,
hyphenat,
babel,
color,
xcolor,
natbib,
graphicx,
booktabs,
textcomp,
gensymb,
amsfonts, ambsymb, amsmath,
courier,
helvet,
mathptmx,
geometry,
nag, }[\pkg{accessibility}'s included example document loads these first...]
\DeclarePackageOrdering{titling}{after}{\gW@documentClass}[Assumes title commands already defined]
\DeclarePackageOrdering{titling}{incompatible-error}{beamer}[\cls{beamer} does not define the bits of \cs{maketitle} that \pkg{titling} expects]
\DeclarePackageOrdering{beamer}{voids}{titling}
\DeclarePackageOrdering{ hyperref }{after}{ \gW@documentClass }[Assumes several control sequences already defined]
%\DeclarePackageOrdering{ hyperxmp }{after}{ documentclass / after }
\DeclarePackageDependency{ hyperxmp }{ hyperref }
\RequirePackageAfterPackage{ hyperxmp }{ hyperref }%ARG ARG ARG ARG ARG
%\DeclarePackageOrdering{ hyperxmp }{before}{ hyperref }[In newer kernels, \pkg{hyperxmp} *must* load before any \pkg{hyperref} keys are set...]
%\DeclarePackageOrdering{ hyperxmp }{after}{ babel }%% WHY?!
\DeclarePackageDependency{ hyperxmp }{ kvoptions,
pdfescape,
stringenc,
intcalc,
iftex,
ifmtarg,
etoolbox,
ifthen,
luacode, }[\cs{RequirePackage}]
\DeclarePackageOrdering{ hologo }{after}{ \gW@documentClass }
\DeclarePackageOrdering{ xcolor }{before}{ documentclass / after }
\DeclarePackageOrdering{ graphicx }{before}{ documentclass / after }
\DeclarePackageDependency{ venndiagram }{ graphicx }
\DeclarePackageDependency{ venndiagram }{ tikz,
pgf, }[\cs{RequirePackage}]
\DeclarePackageOrdering{ varioref }{after}{ babel }
\DeclarePackageDependency{ bookmark }{ currfile }[uses if already loaded]
\DeclarePackageDependency{ bookmark }{ hyperref }[loads itself without options early]
\DeclarePackageOrdering{ ntheorem }{after}{ babel,
amsmath,
mathtools,
empheq, }
\DeclarePackageOrdering{ ntheorem }{incompatible-error}{ amsthm }
\PassOptionsToPackageIfPackage{ntheorem}{empheq}{ntheorem}[cope with \pkg{ntheorem}]
\PassOptionsToClassIfPackage{noamsthm}{beamer}{ntheorem}[prevent from loading \pkg{amsthm}, which conflicts with \pkg{ntheorem}]
\PassOptionsToPackageIfPackage{hyperref}{ntheorem}{hyperref}[inform \pkg{ntheorem} that \pkg{hyperref} will be loaded]
\PassOptionsToPackageIfPackage{amsmath}{ntheorem}{amsmath}[cope with `amsmath`]
\DeclarePackageOrdering{ cmap }{after}{ hyperref }
\DeclarePackageOrdering{ cmap }{before}{ fontenc }
\DeclarePackageOrdering{ mmap }{after}{ hyperref }
\DeclarePackageOrdering{ mmap }{before}{ fontenc }
\DeclarePackageOrdering{ fancyhdr }{incompatible-warning}{ accessibility }%
\DeclarePackageOrdering{ fancyhdr }{before}{ hyperref }%
\DeclarePackageDependency{ pdfcomment }{ hyperref }[\cs{RequirePackage}]
\DeclarePackageOrdering{ gitinfo2 }{after}{ xcolor }[uses if loaded]
\DeclarePackageOrdering{ gitinfo2 }{after}{ etoolbox,
xstring,
kvoptions,
eso-pic, }
\DeclarePackageOrdering{ nameref }{after}{ titlesec,
%beamer, % Beamer now disabled NR's patching of Beamer.
varioref,
ifthen,
listings, }
\DeclarePackageDependency{ nameref }{ refcount, gettitlestring, ltxcmds, }[\pkg{nameref} \cs{RequirePackages}s these]%
\DeclarePackageOrdering{ nameref }{after}{ showkeys,
hyperref,
longtable,
titlesec,
amsthm,
ifthen,
varioref,
listings, }[\pkg{nameref} \cs{@ifpackageloaded} and modifies behavior, although mostly this is done via \cs{AtBeginDocument}]
\DeclarePackageOrdering{ doc }{after}{ multicol,
verbatim, }
\DeclarePackageOrdering{ hypdoc }{after}{ doc,
atveryend,
calc,
hyperref, }[\pkg{hypdoc} heavily modifies \pkg{doc}, mostly by implementing \pkg{hyperref}.]
\PassOptionsToPackageIfPackage{hyperindex=false}{hyperref}{hypdoc}[do *not* link page numbers from index...conflict w/ hypdoc...]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclarePackageOrdering{ holtxdoc }{after}{ hypdoc,
hyperref,
pdftexcmds,
ltxcmds,
hologo,
array,
fontspec,
unicode-math, }
\RequirePackageAfterPackageIfPackage{ hypdoc }{ hyperref }{ doc }[if \pkg{doc} is already loaded when \pkg{hyperref} is loaded, then load \pkg{hypdoc}]
\RequirePackageAfterPackageIfPackage{ hypdoc }{ doc }{ hyperref }[if \pkg{hyperref} is already loaded when \pkg{doc} is loaded, then load \pkg{hypdoc}]
%\DeclarePackageDependency*{ fontspec }{ fontenc }[\pkg{fontspec} must be the one to load \pkg{fontenc}] %% \pkg{fontenc} can be loaded repeatedly...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclarePackageOrdering{ inputenc }{before}{ documentclass / after }[\pkg{inputenc} can affect package loading (if a file has non-ascii characters)]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclarePackageOrdering{ fixltx2e }{before}{ documentclass / after }
\DeclarePackageOrdering{ fancyhdr }{before}{ hyperref }
\DeclarePackageOrdering{ fncychap }{before}{ hyperref }
\DeclarePackageOrdering{ float }{before}{ hyperref }
\DeclarePackageOrdering{ hyperref }{before}{ algorithm }
\DeclarePackageOrdering{ amssymb }{before}{ xunicode }
\DeclarePackageOrdering{ amssymb }{before}{ xltxtra }
\DeclarePackageOrdering{ graphicx }{before}{ xltxtra }
\DeclarePackageOrdering{ graphicx }{before}{ fontspec }
\DeclarePackageOrdering{ caption }{before}{ subfig }
\DeclarePackageOrdering{ amsmath }{before}{ wasysym }
\DeclarePackageOrdering{ todonotes }{before}{ program }
\DeclarePackageOrdering{ cleveref }{after}{ algorithm2e,
algorithmicx,
aliascnt,
amsmath,
amsthm,
caption,
hyperref,
IEEEtrantools,
listings,
ntheorem,
subfig,
varioref }
\DeclarePackageOrdering{ cleveref }{before}{ autonum,
hypdvips }
\DeclarePackageOrdering{ varioref }{before}{ hyperref }
\DeclarePackageOrdering{ natbib }{before}{ citeref }
\DeclarePackageOrdering{ babel }{before}{ apacite }[ \pkg{babel}'s \cs{selectlanguage} redefines \cs{refname} and \cs{bibname} ]
\DeclarePackageOrdering{ hyperref }{before}{ apacite }[hyperref redefines citation and reference list commands]
\DeclarePackageOrdering{ hyperref }{before}{ cmap }[hyperref cannot write pdf settings if cmap already wrote to pdf]
% but cmap needs to load before all fonts...?
\DeclarePackageOrdering{ hyperref }{before}{ ellipsis,
amsrefs,
chappg,
dblaccnt,
linguex }
[the hyperref documentation explicitly says to do so]
\DeclarePackageOrdering{ hyperref }{after}{ multind,
natbib,
setspace }
[the hyperref documentation explicitly says to do so]
\DeclarePackageOrdering{ hyperref }{before}{ glossaries }[because otherwise terms won't be clickable hyperlinks]
\DeclareGlobalOptionsIfPackage{hyperref}{hyperref}[many packages like to be told if \pkg{hyperref} is in use]
\DeclarePackageOrdering{ glossaries }{after}{ babel,
olyglossia,
inputenc,
fontenc,
doc }[because {the glossaries documentation explicitly says to do so}]
\DeclarePackageOrdering{ hyperref }{before}{ hypcap }[because {hypcap redefines hyperref's caption command}]
\DeclarePackageOrdering{ babel }{before}{ selnolig }[because {this was recommended by selnolig's author}]
\DeclarePackageOrdering{ fontenc }{after}{ cmap,
mmap }[because {otherwise some fonts may be unprocessed}]
\DeclarePackageOrdering{ listingsutf8 }{after}{ listings }[because {it patches macros defined by listings}]
% ho-tex replacement for listings; it loads listings itself
\DeclarePackageOrdering{ glossaries }{before}{ cleveref }[\pkg{glossaries} loads \pkg{amsmath}, which needs to be loaded before \pkg{cleveref}]
\DeclarePackageOrdering{ refenums }{after}{ hyperref,
cleveref,
csquotes,
ifthen }[it prevents an options clash]
\DeclarePackageOrdering{ babel }{before}{ microtype }[microtype can use the language setting of babel]
\DeclarePackageOrdering{ hyperref }{before}{ uri }[uri uses hyperref's commands if hyperref is loaded]
\DeclarePackageDependency{ uri }{ url }[uri has a RequirePackage on url]
\AddToHook{package/ regexpatch /before}[xpatch]%
{ \UseOneTimeHook{package/ xpatch /before} }
\AddToHook{package/ regexpatch /after}[xpatch]%
{ \disable@package@load{xpatch}{\PackageInfo{regexpatch}{blocked~pkg{xpatch}~from~loading.}}
\UseOneTimeHook{package/ xpatch /after}
}
\DeclarePackageOrdering{ regexpatch }{voids}{ xpatch }[\pkg{regexpatch} is the development version of \pkg{xpatch}]
%
\DeclarePackageOrdering { beamer }{after}{ documentclass / before }[jfc]
\DeclarePackageOrdering { beamer }{before}{ documentclass / after }[jfc]
\DeclarePackageDependency{ beamer }{ beamerbasemodes }[\cls{beamer} \cs{RequirePackage}s \pkg{beamerbasemodes} before *anything* else, which also loads other packages]%
\DeclarePackageOrdering { beamerbasemodes }{after}{ documentclass / before }[jfc]
\DeclarePackageOrdering { beamerbasemodes }{before}{ documentclass / after }[jfc]
\DeclarePackageDependency*{ beamer }{ beamerbaseoptions }[\cls{beamer} \cs{RequirePackage}s \pkg{beamerbaseoptions}, which *purely* \cs{def}s stuff]%
\DeclarePackageOrdering { beamerbaseoptions }{after}{ beamerbasemodes }
\DeclarePackageDependency*{ beamer }{ beamerbaserequires }[\cls{beamer} \cs{RequirePackage}s \pkg{beamerbaserequires} right at the end.]%
\DeclarePackageOrdering { beamerbaserequires }{after}{ beamer }%
\DeclarePackageOrdering { beamerbaserequires }{after}{ beamerbasemodes }[😭]%
\DeclarePackageOrdering { beamerbaserequires }{before}{ documentclass / after }[jfc]
\DeclarePackageDependency{ beamerarticle }{ beamerbasemodes }[\pkg{beamerarticle} \cs{RequirePackages}s \pkg{beamerbasemodes} immediately with no options]
\DeclarePackageDependency{ beamerbasemodes }{ etoolbox, }[\pkg{beamerbasemodes} \cs{RequirePackage}s \pkg{etoolbox}]
\DeclarePackageDependency{ beamer }{ iftex, }[\cls{beamer} \cs{RequirePackage}s these]%
\DeclarePackageDependency{ beamerbaseoptions }{ keyval }[[\pkg{beamerbaseoptions} \cs{RequirePackage}s \pkg{beamerbaseoptions}, which *purely* \cs{def}s stuff]]
\DeclarePackageDependency{ beamer }{ inputenc }[\cls{beamer} \cs{RequirePackages}s \pkg{inputenc}]
\DeclarePackageDependency{ beamer }{ pgfmath }[\cls{beamer} \cs{RequirePackages}s \pkg{pgfmath}]
\DeclarePackageDependency*{ beamer }{ geometry }[\cls{beamer} \cs{RequirePackages}s \pkg{geometry}, but passes in specific \meta{papersize = \cs{beamer@paperwidth},\cs{beamer@paperheight}} \etc.]
\DeclarePackageOrdering { beamerbaseoptions }{before}{ geometry }[\cls{beamer} loads \pkg{geometry} halfway through, well after \pkg{beamerbaseoptions}.]
\DeclarePackageOrdering { beamerbaserequires }{after}{ geometry }[\cls{beamer} loads \pkg{geometry} halfway through, shortly before \pkg{beamerbaserequires}.]
\DeclarePackageOrdering { beamerbasemodes }{before}{ hyperref }
\DeclarePackageOrdering { beamerbaseoptions }{before}{ hyperref }[\cls{beamer} loads \pkg{hyperref} halfway through, well after \pkg{beamerbaseoptions}.]
\DeclarePackageOrdering { beamerbaserequires }{after}{ hyperref }[\cls{beamer} loads \pkg{hyperref} halfway through, shortly before \pkg{beamerbaserequires}.]
\DeclarePackageOrdering { beamer }{before}{ geometry }[hacking this up to make sure it loads after the middle of \cls{beamer}...]
%\beamer@filterclassoptions????
\DeclarePackageDependency{ beamer }{ pgfcore, xxcolor, atbegshi, }[\cls{beamer} \cs{RequirePackages}s \pkg{pgfcore, xxcolor, atbegshi}]
\DeclarePackageDependency*{ beamer }{ hyperref }[\cls{beamer} \cs{RequirePackages}s \pkg{hyperref} \emph{with option implicit=false}]
%beamer@autopdfinfo
%notheorems
%noamsthm
%compress
%leqno / fleqn
%handout
%trans
%ignorenonframetext
%noamssymb
%\PassOptionsToPackage{bookmarks=true, bookmarksopen=true, pdfborder={ 0 0 0}, pdfhighlight={/N}, linkbordercolor={.5 .5 .5}}{hyperref}
%pgf, hyperref, color, xcolor
%`ucs' \POTP[hyperref]{ucs}