-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwmpatch.sty
More file actions
121 lines (106 loc) · 3.14 KB
/
wmpatch.sty
File metadata and controls
121 lines (106 loc) · 3.14 KB
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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{wmpatch}[2016/04/06]
\RequirePackage{xifthen}
\RequirePackage{ifluatex}
\RequirePackage{scrlfile}
\RequirePackage{hopatch}
\RequirePackage{xpatch}
\RequirePackage{etoolbox}
\ifthenelse{\boolean{luatex}}{
\hopatch@AfterPackage{amsmath}{\AtEndPreamble{\RequirePackage{lualatex-math}}}
\hopatch@AfterPackage{mathtools}{\AtEndPreamble{\RequirePackage{lualatex-math}}}
\hopatch@AfterPackage{icomma}{\AtEndPreamble{\RequirePackage{lualatex-math}}}
}
\hopatch@AfterPackage{makecmds}{
\makecommand*\renewlength[2]{\setlength#1{#2}}
\makecommand*\makelength[2]{
\providelength{#1}
\renewlength{#1}{#2}
}
}
\hopatch@AfterPackage{xifthen}{
\newcommand*\OptionSwitch[1]{
\newboolean{#1}
\setboolean{#1}{false}
\DeclareOption{#1}{
\setboolean{#1}{true}
}
\DeclareOption{no-#1}{
\setboolean{#1}{false}
}
}
}
\hopatch@AfterPackage{amsmath}{
\hopatch@AfterPackage{unicode-math}{
\long\def\@declmathop#1#2#3{
\@ifdefinable{#2}{
\DeclareRobustCommand{#2}{\qopname\relax #1{#3}}
}
}
\def\[#1\]{\begin{gather*}#1\end{gather*}}
}
\gdef\[#1\]{\begin{gather*}#1\end{gather*}}
\gdef\bracevspacing{\vphantom{ }}
\makeatletter
\xpatchcmd{\math@cr}{\@ifstar}{\bracevspacing\gdef\bracevspacing{\vphantom{ }}\@ifstar}{}{}
\let\oldvphantom\vphantom
\renewcommand{\vphantom}[1]{{%
\xpatchcmd{\math@cr}{\bracevspacing\gdef\bracevspacing{\vphantom{ }}\@ifstar}{\@ifstar}{}{}
\oldvphantom{#1}
\xpatchcmd{\math@cr}{\@ifstar}{\bracevspacing\gdef\bracevspacing{\vphantom{ }}\@ifstar}{}{}
}}%
\xpretocmd{\substack}{%
\xpatchcmd{\math@cr}{\bracevspacing\gdef\bracevspacing{\vphantom{ }}\@ifstar}{\@ifstar}{}{}%
}{}{}
\xapptocmd{\substack}{%
\xpatchcmd{\math@cr}{\@ifstar}{\bracevspacing\gdef\bracevspacing{\vphantom{ }}\@ifstar}{}{}%
}{}{}
%\def\resetMathstrut@{%
% \setbox\z@\hbox{%
% \mathchardef\@tempa\mathcode`\[\relax%
% \def\@tempb##1"##2##3{\the\textfont"##3\char"}%
% \expandafter\@tempb\meaning\@tempa \relax%
% }%
% \ht\Mathstrutbox@\ht\z@%
% \dp\Mathstrutbox@\dp\z@%
%}
}
\hopatch@AfterPackage{unicode-math}{
\DeclareDocumentCommand{\corresponds}{}{\arceq}
}
\hopatch@AfterPackage{csquotes}{
\DeclareQuoteStyle{double}{\text{\textquotedblleft}}{\text{\textquotedblright}}[0.05em]{\text{\textquoteleft}}{\text{\textquoteright}}
\DeclareQuoteStyle{single}{\text{\textquoteleft}}{\text{\textquoteright}}[0.05em]{\text{\textquotedblleft}}{\text{\textquotedblright}}
}
\hopatch@AfterPackage{polyglossia}{
\AtBeginDocument{
\catcode`"=12
}
}
\hopatch@AfterPackage{enumitem-zref}{
\enitkv@key{enumitem}{name}[]{\zen@namelist{#1}}
\enitkv@key{enumitem}{name*}[]{\zen@starnamelist{#1}}
}
\hopatch@AfterPackage{chemfig}{
\definesubmol\nobond{-[,0.2,,,draw=none]}
}
% TODO: fix - maybe using pkgloader?
\BeforePackage{etextools}{
%\RequirePackage{pdftexcmds}
\@ifundefined{pdfstrcmp}{
\@ifpackageloaded{pdftexcmds}{
\let\pdfstrcmp\pdf@strcmp
}{}
}{}
}
\hopatch@AfterPackage{glossaries-extra}{
\let\glsabbvfont\glsabbrvfont
}
\hopatch@AfterPackage{marginnote}{
\let\oldmarginpar\marginpar
\let\marginpar\marginnote
}
\hopatch@AfterPackage{todonotes}{
\xapptocmd{\todo}{\relax}{}{}
}
\endinput