Debian Codegraph @

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

raw
1 %%
2 %% This is file `lwarp-skmath.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% lwarp.dtx (with options: `skmath')
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{skmath}[2019/10/15]
20 \begin{warpMathJax}
21 \ExplSyntaxOn
22 \bool_if:NT\g__skmath_define_common_sets_bool{
23 \CustomizeMathJax{\newcommand{\N}{\mathbb{N}}}
24 \CustomizeMathJax{\newcommand{\Z}{\mathbb{Z}}}
25 \CustomizeMathJax{\newcommand{\Q}{\mathbb{Q}}}
26 \CustomizeMathJax{\newcommand{\R}{\mathbb{R}}}
27 \CustomizeMathJax{\newcommand{\C}{\mathbb{C}}}
28 }
29 \cs_gset_nopar:Npn\LWR__skmath_imaginary_unit:n#1{{#1}}
30 \cs_gset_nopar:Npn\LWR__skmath_natural_log_e:{{e}}
31 \cs_gset_nopar:Npn\LWR__skmath_integral_d:{{d}}
32 \cs_gset_nopar:Npn\LWR__skmath_total_derivative_d:{{d}}
33 \cs_if_eq:NNTF \__skmath_imaginary_unit:n \LWR__skmath_imaginary_unit:n
34 {
35 \CustomizeMathJax{\newcommand{ii}{\mathit{i}}}
36 \CustomizeMathJax{\newcommand{jj}{\mathit{j}}}
37 }
38 {
39 \CustomizeMathJax{\newcommand{ii}{\mathrm{i}}}
40 \CustomizeMathJax{\newcommand{jj}{\mathrm{j}}}
41 }
42 \cs_if_eq:NNTF \__skmath_natural_log_e: \LWR__skmath_natural_log_e:
43 { \CustomizeMathJax{\newcommand{\ee}{\mathit{e}}} }
44 { \CustomizeMathJax{\newcommand{\ee}{\mathrm{e}}} }
45 \cs_if_eq:NNTF \__skmath_integral_d: \LWR__skmath_integral_d:
46 { \CustomizeMathJax{\newcommand{\d}{\mathit{d}}} }
47 { \CustomizeMathJax{\newcommand{\d}{\mathrm{d}}} }
48 \CustomizeMathJax{\def\LWRskmathEND{}}
49 \CustomizeMathJax{\def\LWRskmathpdstarsub#1#2,#3,#4,#5,#6\LWRskmathEND{
50 #1_{#2#3#4#5}%
51 }}
52
53 \CustomizeMathJax{\newcommand{\LWRskmathpdstar}[2]{%
54 \LWRskmathpdstarsub{#1}#2,,,,\LWRskmathEND%
55 }}
56 \CustomizeMathJax{\def\LWRskmathpdnumerator#1^#2^#3\LWRskmathEND{%
57 \ifblank{#1}{}{
58 \ifblank{#2}{\LWRskmathpdplus\LWRskmathpdone}{\LWRskmathpdplus#2}
59 }
60 }}
61 \CustomizeMathJax{\def\LWRskmathpddenominator#1^#2^#3\LWRskmathEND{%
62 \ifblank{#1}{}{%
63 \ifblank{#2}%
64 {\partial{#1}}%
65 {\partial{#1}^{#2}}%
66 }%
67 }}
68 \CustomizeMathJax{\newcommand{\LWRskmathdonumerator}[5]{%
69 \partial^{%
70 \def\LWRskmathpdplus{}%
71 \LWRskmathpdnumerator#2^{}^{}\LWRskmathEND%
72 \def\LWRskmathpdplus{+}%
73 \def\LWRskmathpdone{1}%
74 \LWRskmathpdnumerator#3^{}^{}\LWRskmathEND%
75 \LWRskmathpdnumerator#4^{}^{}\LWRskmathEND%
76 \LWRskmathpdnumerator#5^{}^{}\LWRskmathEND%
77 }%
78 {#1}%
79 }}
80
81 \CustomizeMathJax{\newcommand{\LWRskmathdodenominator}[4]{%
82 \LWRskmathpddenominator#1^{}^{}^{}\LWRskmathEND%
83 \ifblank{#2}{}{\,}%
84 \LWRskmathpddenominator#2^{}^{}^{}\LWRskmathEND%
85 \ifblank{#3}{}{\,}%
86 \LWRskmathpddenominator#3^{}^{}^{}\LWRskmathEND%
87 \ifblank{#4}{}{\,}%
88 \LWRskmathpddenominator#4^{}^{}^{}\LWRskmathEND%
89 }}
90 \CustomizeMathJax{\def\LWRskmathpdnostarsub#1#2,#3,#4,#5,#6\LWRskmathEND{
91 \ifblank{#3}{\def\LWRskmathpdone{}}{\def\LWRskmathpdone{1}}
92 \frac%
93 {\LWRskmathdonumerator{#1}{#2}{#3}{#4}{#5}}%
94 {\LWRskmathdodenominator{#2}{#3}{#4}{#5}}%
95 }}
96
97 \CustomizeMathJax{\newcommand{\LWRskmathpdnostar}[2]{%
98 \LWRskmathpdnostarsub{#1}#2,,,,,,\LWRskmathEND%
99 }}
100 \CustomizeMathJax{\newcommand{\pd}{\ifstar\LWRskmathpdstar\LWRskmathpdnostar}}
101 \cs_if_eq:NNTF \__skmath_total_derivative_d: \LWR__skmath_total_derivative_d:
102 { \CustomizeMathJax{\newcommand{\LWRskmathtd}{\mathit{d}}} }
103 { \CustomizeMathJax{\newcommand{\LWRskmathtd}{\mathrm{d}}} }
104 \CustomizeMathJax{\def\LWRskmathtdsub#1#2^#3\LWRskmathEND{%
105 \frac
106 {\LWRskmathtd^{#3}{#1}}
107 {\LWRskmathtd{#2}^{#3}}
108 }}
109
110 \CustomizeMathJax{\newcommand{\td}[2]{%
111 \LWRskmathtdsub{#1}#2^{}\LWRskmathEND%
112 }}
113 \CustomizeMathJax{\newcommand{\E}[1]{%
114 \operatorname{E}\left[#1\right]%
115 }}
116 \CustomizeMathJax{\let\given\mid}
117
118 \CustomizeMathJax{\newcommand{\P}[1]{%
119 \operatorname{P}%
120 \left(#1\right)%
121 }}
122 \CustomizeMathJax{\newcommand{\var}[1]{%
123 \operatorname{Var}\left(#1\right)%
124 }}
125
126 \CustomizeMathJax{\newcommand{\cov}[2]{%
127 \operatorname{Cov}\left(#1,#2\right)%
128 }}
129 \CustomizeMathJax{\newcommand{\LWRskmathtrigtwo}[2][]{%
130 \ifblank{#1}{}{^{#1}}%
131 \ifblank{#2}{}{\left(#2\right)}%
132 }}
133
134 \CustomizeMathJax{\newcommand{\LWRskmathtrig}[1]{%
135 \operatorname{#1}%
136 \LWRskmathtrigtwo%
137 }}
138 \CustomizeMathJax{\renewcommand{\sin}{\LWRskmathtrig{sin}}}
139 \CustomizeMathJax{\renewcommand{\arcsin}{\LWRskmathtrig{arcsin}}}
140
141 \CustomizeMathJax{\renewcommand{\cos}{\LWRskmathtrig{cos}}}
142 \CustomizeMathJax{\renewcommand{\arccos}{\LWRskmathtrig{arccos}}}
143
144 \CustomizeMathJax{\renewcommand{\tan}{\LWRskmathtrig{tan}}}
145 \CustomizeMathJax{\renewcommand{\arctan}{\LWRskmathtrig{arctan}}}
146
147 \CustomizeMathJax{\renewcommand{\cot}{\LWRskmathtrig{cot}}}
148
149 \CustomizeMathJax{\renewcommand{\sinh}{\LWRskmathtrig{sinh}}}
150 \CustomizeMathJax{\renewcommand{\cosh}{\LWRskmathtrig{cosh}}}
151 \CustomizeMathJax{\renewcommand{\tanh}{\LWRskmathtrig{tanh}}}
152 \CustomizeMathJax{\newcommand{\LWRskmathlogtwo}[2][]{%
153 \ifblank{#1}{}{_{#1}}%
154 \ifblank{#2}{}{\left(#2\right)}%
155 }}
156
157 \CustomizeMathJax{\newcommand{\LWRskmathlog}[1]{%
158 \operatorname{#1}%
159 \LWRskmathlogtwo%
160 }}
161 \CustomizeMathJax{\renewcommand{\ln}{\LWRskmathlog{ln}}}
162 \CustomizeMathJax{\renewcommand{\log}{\LWRskmathlog{log}}}
163 \CustomizeMathJax{\newcommand{\LWRskmathexpparens}[1]{%
164 \operatorname{exp}%
165 \ifblank{#1}{}{\left(#1\right)}%
166 }}
167 \CustomizeMathJax{\newcommand{\LWRskmathexpnostar}[1]{%
168 \mathchoice
169 {\ee^{#1}}
170 {\LWRskmathexpparens{#1}}
171 {\LWRskmathexpparens{#1}}
172 {\LWRskmathexpparens{#1}}
173 }}
174
175 \CustomizeMathJax{\renewcommand{\exp}{\ifstar\LWRskmathexpparens\LWRskmathexpnostar}}
176 \CustomizeMathJax{\newcommand{\LWRskmathminstar}[2][]{%
177 \operatorname{\LWRskmathminname}%
178 \ifblank{#1}{}{%
179 _{\mathchoice{\mathclap{#1}}{#1}{#1}{#1}}
180 }%
181 \ifblank{#2}{}{#2}%
182 }}
183 \CustomizeMathJax{\newcommand{\LWRskmathminnostar}[2][]{%
184 \ifblank{#1}%
185 {\operatorname{\LWRskmathminname}}%
186 {%
187 \underset%
188 {\mathchoice{\mathclap{#1}}{#1}{#1}{#1}}%
189 {\operatorname{\LWRskmathminname}}%
190 }%
191 \ifblank{#2}{}{\left\{#2\right\}}%
192 }}
193 \CustomizeMathJax{\newcommand{\LWRskmathmin}[1]{%
194 \def\LWRskmathminname{#1}%
195 \ifstar\LWRskmathminstar\LWRskmathminnostar%
196 }}
197 \CustomizeMathJax{\renewcommand{\min}{\LWRskmathmin{min}}}
198 \CustomizeMathJax{\renewcommand{\argmin}{\arg\LWRskmathmin{min}}}
199
200 \CustomizeMathJax{\renewcommand{\max}{\LWRskmathmin{max}}}
201 \CustomizeMathJax{\renewcommand{\argmax}{\arg\LWRskmathmin{max}}}
202 \CustomizeMathJax{\renewcommand{\sup}{\LWRskmathmin{sup}}}
203 \CustomizeMathJax{\renewcommand{\inf}{\LWRskmathmin{inf}}}
204 \CustomizeMathJax{\let\bar\overline}
205
206 \CustomizeMathJax{\let\vec\boldsymbol}
207 \CustomizeMathJax{\let\LWRskmathRe\Re}
208 \CustomizeMathJax{\let\LWRskmathIm\Im}
209 \bool_if:NTF\g__skmath_iso_complex_parts_bool{
210 \CustomizeMathJax{\renewcommand{\Re}[1]{%
211 \LWRskmathRe%
212 \ifblank{#1}{}{\left(#1\right)}%
213 }}
214 \CustomizeMathJax{\renewcommand{\Im}[1]{%
215 \LWRskmathIm%
216 \ifblank{#1}{}{\left(#1\right)}%
217 }}
218 }{
219 \CustomizeMathJax{\renewcommand{\Re}[1]{%
220 \operatorname{Re}%
221 \ifblank{#1}{}{#1}%
222 }}
223 \CustomizeMathJax{\renewcommand{\Im}[1]{%
224 \operatorname{Im}%
225 \ifblank{#1}{}{#1}%
226 }}
227 }
228
229 \ExplSyntaxOff
230 \end{warpMathJax}
231 \endinput
232 %%
233 %% End of file `lwarp-skmath.sty'.