-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtexStandardCommands.tex
169 lines (126 loc) · 5.57 KB
/
texStandardCommands.tex
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
% Packages
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{cancel}
\usepackage{mathtools}
% units!
\usepackage{siunitx}
% custom formulas
\usepackage[thinc]{esdiff}
% more featureful derivative package
\usepackage{derivative}
\usepackage{esint}
%youre an ece harry
\usepackage{steinmetz}
%fix me some spacing problems
\usepackage{mleftright} % could use this everywhere, but idk that i want to
% fancy matricies
%\usepackage{nicematrix} % turns out to be pretty hefty!
\usepackage{arydshln} %must be loaded late in process
\newcommand{\iphasor}{{\underline I}}
\newcommand{\vphasor}{{\underline V}}
% units plz
\newcommand{\mSec}{\unit{\m\per\s}}
\newcommand{\mSecSq}{\unit{\m\per\s\squared}}
\newcommand{\radSec}{\unit{\radian\per\s}}
\newcommand{\radSecSq}{\unit{\radian\per\s\squared}}
\sisetup{
per-mode=fraction
}
% make matrix fast
\newcommand{\dAugMatrix}[1]{\mleft[\begin{array}{cc:c} #1 \end{array}\mright]}
\newcommand{\tAugMatrix}[1]{\mleft[\begin{array}{ccc:c} #1 \end{array}\mright]}
\newcommand{\qAugMatrix}[1]{\mleft[\begin{array}{cccc:c} #1 \end{array}\mright]}
\newcommand{\sAugMatrix}[2]{\mleft[\begin{array}{c:c} \bold #1 & \vec #2 \end{array}\mright]}
\newcommand{\colspace}[1]{\text C \mleft ( \bold {#1} \mright)}
\newcommand{\nullspace}[1]{\text N \mleft( \bold {#1} \mright)}
\newcommand{\fastMatrix}[1]{\mleft[\begin{array} #1 \end{array}\mright]}
% SHHHH i know this is bad practice having two similar names
% update: i have forgotten which did which... i beleive the 2nd one specifies wrapping details?
\newcommand{\fastmatrix}[2]{\mleft[\begin{array} {#1} #2 \end{array}\mright]}
% paren thesis
\newcommand{\paren}[1]{\mleft (#1 \mright )}
\newcommand{\abs}[1]{\mleft |#1 \mright |}
% row speed
\newcommand{\sfastrow}[6]{#1 & #2 & #3 & #4 & #5 & #6}
\newcommand{\ffastrow}[5]{#1 & #2 & #3 & #4 & #5}
\newcommand{\qfastrow}[4]{#1 & #2 & #3 & #4}
\newcommand{\tfastrow}[3]{#1 & #2 & #3 }
\newcommand{\dfastrow}[2]{#1 & #2 }
% for second lines
\newcommand{\srow}[6]{\\#1 & #2 & #3 & #4 & #5 & #6}
\newcommand{\frow}[5]{\\#1 & #2 & #3 & #4 & #5}
\newcommand{\qrow}[4]{\\#1 & #2 & #3 & #4}
\newcommand{\trow}[3]{\\#1 & #2 & #3 }
\newcommand{\drow}[2]{\\#1 & #2 }
% Some conveniences for me
\newcommand{\Laplace}[1]{\mathscr{L}\mleft[#1\mright]}
\newcommand{\InvLaplace}[1]{\mathscr{L}^{-1}\mleft[#1\mright]}
\newcommand{\mmf}{{\mathcal{F}}}
\newcommand{\reluc}{{\mathcal{R}}}
\newcommand{\real}{\mathbb{R}} % real symbol
% vectors
\newcommand{\fvector}[5]{\begin{bmatrix} #1 \\ #2 \\#3 \\#4\\ #5 \end{bmatrix}}
\newcommand{\qvector}[4]{\begin{bmatrix} #1 \\ #2 \\#3 \\#4 \end{bmatrix}}
\newcommand{\tvector}[3]{\begin{bmatrix} #1 \\ #2 \\#3\end{bmatrix}}
\newcommand{\dvector}[2]{\begin{bmatrix} #1 \\ #2 \end{bmatrix}}
\newcommand{\qrowvec}[4]{\fastmatrix {cccc}{#1 & #2 & #3 & #4}}
\newcommand{\trowvec}[3]{\fastmatrix {ccc}{#1 & #2 & #3 }}
\newcommand{\drowvec}[2]{\fastmatrix {cc}{#1 & #2 }}
% matricies
\newcommand{\tmatrix}[9]{\begin{bmatrix} #1 & #2 & #3 \\ #4 & #5 & #6 \\ #7 & #8 & #9\end{bmatrix}}
\newcommand{\dmatrix}[4]{\begin{bmatrix} #1 \\ #3 & #4\end{bmatrix}}
% col major order TODO
\newcommand{\tcmatrix}[9]{\begin{bmatrix} #1 & #2 & #3 \\ #4 & #5 & #6 \\ #7 & #8 & #9 \end{bmatrix}}
\newcommand{\dcmatrix}[4]{\begin{bmatrix} #1 \\ #3 & #4 \end{bmatrix}}
% little naught convention
\newcommand{\naught}[1]{{#1_0}}
% subscript commands (can be easier to write, and include grouping)
\newcommand{\ds}[3]{{{#1}_{{#2}_{#3}}}}
\newcommand{\ts}[4]{{{#1_{#2_#3}}_#4}}
\newcommand{\ssv}[2]{{{\vec {#1}_{#2}}}} %vector sub
\newcommand{\dsv}[3]{{{\vec {#1}_{{#2}_{#3}}}}}
\newcommand{\ssp}[3]{{{{#1}_{#2}}^{#3}}} %subscript with power
\newcommand{\dsp}[4]{{{\ds {#1}{#2}{#3}}^#4}}
\newcommand{\dse}[3]{{{#1}_{#2#3}}} % subscript with both being equal (ie, 2 chars)
% with respect to
\newcommand{\wrt}[3]{{#1_{#2/#3}}}
\newcommand{\vwrt}[3]{{{}\vec #1_{#2/#3}}}
% inverty boi
\newcommand{\inv}[1]{{1 \over {#1}}}
\newcommand{\piover}[1]{{\pi \over #1}}
% grouping negative command
\newcommand{\n}[1]{{-#1}}
\newcommand{\dc}[2]{{#1#2}}
% function commands, wrap things up in some nice parenthesis
\newcommand{\spanf}[1]{\text{span}\mleft ( \mleft \{ #1 \mright \} \mright) }
\newcommand{\detf}[1]{\mleft | \bold {#1} \mright |}
\newcommand{\sinf}[1]{{\sin \paren{#1}}}
\newcommand{\cosf}[1]{{\cos \paren{#1}}}
\newcommand{\tanf}[1]{{\tan \paren{#1}}}
\newcommand{\atanf}[1]{{\tan^\n1 \paren{#1}}}
\newcommand{\acosf}[1]{{\cos^\n1 \paren{#1}}}
\newcommand{\asinf}[1]{{\sin^\n1 \paren{#1}}}
\newcommand{\rectf}[1]{{~\text{rect} \paren{#1}}}
\newcommand{\sincf}[1]{{~\text{sinc} \paren{#1}}}
\newcommand{\sumf}[2]{\sum_{n=#1}^{#2}}
\newcommand{\intf}[2]{\int_{#1}^{#2}}
\newcommand{\intfn}[2]{\intf {-#1} {#2}}
% vector of x (numberd subscripts)
\newcommand{\qvectorx}[1]{\qvector {#1_1} {#1_2} {#1_3} {#1_4}}
\newcommand{\tvectorx}[1]{\tvector {#1_1} {#1_2} {#1_3}}
\newcommand{\dvectorx}[1]{\dvector {#1_1} {#1_2}}
% NOTE: \newcommand{\tvectorx}[1]{\qvector {#1_1} {#1_2} {#1_3}} was valid
% faster units
\newcommand{\amp}{{\unit\Amp}}
\newcommand{\volt}{{\unit\volt}}
\newcommand{\kohm}{{\unit\kohm}}
\newcommand{\mA}{{\unit\mA}}
\newcommand{\mv}{{\unit\mV}}
% piecewise func
\newcommand{\dpiecewise}[4]{\mleft\{\begin{array}{lr} #1, & \text{if} #2 \\ #3, & \text{ if } #4 \end{array} \mright\}}
\newcommand{\tpiecewise}[6]{\mleft\{\begin{array}{lr} #1, & \text{if} #2 \\ #3, & \text{ if } #4 \\ #5, & \text{if } #6 \end{array} \mright\} }
%heavyweights
\newcommand{\pythag}[2]{{\sqrt {\paren{#1}^2 +\paren{#2}^2}}}
\newcommand{\pfrac}[3]{{\paren{\frac {#1} {#2}}^{#3}}} %parenthesis fraction