local_cmmds.tex: Use `Eq.` instead of `Eqn.` in \fref
[thesis.git] / src / local_cmmds.tex
1 % String comparison for \fref
2 \makeatletter
3 \long\def\isequal#1#2{\pdf@strcmp{#1}{#2}}
4 \makeatother
5
6 % An reference index from an unspecified source
7 % usage: \iref{environment}{value}
8 % for example: \iref{equation}{75}
9 \newcommand{\iref}[2]{%
10   \switch%
11   \case{\isequal{#1}{equation}}%
12     ({#2})%
13   \otherwise%
14     {#2}%
15   \endswitch%
16 }
17
18 % A formatted reference from an unspecified source
19 % usage: \fref{environment}{value}
20 % for example: \fref{figure}{75}
21 \newcommand{\fref}[2]{%
22   \switch%
23   \case{\isequal{#1}{equation}}%
24     Eq.~\iref{#1}{#2}%
25   \case{\isequal{#1}{figure}}%
26     Fig.~\iref{#1}{#2}%
27   \otherwise%
28     \PackageError{fref}{
29       \MessageBreak
30       environment value >#2< unknown \MessageBreak
31     }{possible values are: equation. \MessageBreak}%
32   \endswitch%
33 }
34
35 % References to external figures, equations, etc.
36 % usage: \xref{key}{environment}{value}
37 % for example: \xref{roman12}{figure}{75}
38 \newcommand{\xref}[3]{\citet{#1} \fref{#2}{#3}}
39
40 % Fourier Transform to angular momentum space
41 \newcommand{\Four}[1]{\ensuremath{{\mathcal F}\left\{ {#1} \right\}}}
42 % Fourier Transform to frequency space
43 \newcommand{\Fourf}[1]{\ensuremath{{\mathcal F}_f\left\{ {#1} \right\}}}
44
45 % Symbol denoting the Langevin function
46 \newcommand{\Langevin}{\ensuremath{\mathcal{L}}}
47 % Symbol denoting big-O order of #1
48 \newcommand{\order}[1]{\ensuremath{\mathcal{O}\p({#1})}}
49
50 % Integral from #1 to #2 of #4 with respect to #3
51 \newcommand{\integral}[4]{\ensuremath{\int_{#1}^{#2} {#4} \dd{#3}}}
52 % Integral from -infty to +infty of #2 with respect to #1
53 \newcommand{\iInfInf}[2]{\integral{-\infty}{\infty}{#1}{#2}}
54 % Integral from 0 to +infty of #2 with respect to #1
55 % note that the second char in the name is a capital o, not a 0
56 % because ?Latex doesn't allow digits in command names
57 \newcommand{\iOInf}[2]{\integral{0}{\infty}{#1}{#2}}
58 % #3 evaluated at #2 and #1
59 \newcommand{\evaluated}[3]{\ensuremath{\left.{#3}\right|_{#1}^{#2}}}
60 % #2 evaluated at #1
61 \newcommand{\eval}[2]{\ensuremath{\left.{#2}\right|_{#1}}}
62 % evaluated at infty and -infty
63 \newcommand{\eInfInf}[1]{\evaluated{-\infty}{\infty}{#1}}
64 % evaluated at infty and 0
65 \newcommand{\eOInf}[1]{\evaluated{0}{\infty}{#1}}
66
67 % we do a lot of lim t_T -> infty, so macro that out
68 % lim as #1 -> infty
69 \newcommand{\limInf}[1]{\ensuremath{\lim_{{#1}\rightarrow \infty}}}
70 \newcommand{\limT}{\limInf{t_T}}
71 \newcommand{\normLimT}{\limT \frac{1}{t_T}\ } % '\ ' for a normal space
72 % lim as t_T -> infty of integral from -t_T/2 to t_T/2 of #1 with respect to t
73 \newcommand{\iLimT}[1]{\normLimT \integral{-t_T/2}{t_T/2}{t}{#1}}
74
75 \newcommand{\magSq}[1]{\ensuremath{\left|{#1}\right|^2}}
76 \newcommand{\PSD}{\ensuremath{\operatorname{PSD}}}
77
78 % complex conjugate
79 \newcommand{\conj}[1]{\ensuremath{\overline{#1}}}
80
81 % Symbol denoting the contour C
82 \newcommand{\C}{\ensuremath{\mathcal{C}}}
83 % Integral about contour C of #1 with respect to z
84 \newcommand{\iC}[1]{\integral{\C}{}{z}{#1}}
85 \newcommand{\Reals}{\ensuremath{\mathds{R}}}
86 \newcommand{\Imags}{\ensuremath{\mathds{I}}}
87 \newcommand{\Real}{\ensuremath{\operatorname{Re}}}
88 \newcommand{\Imag}{\ensuremath{\operatorname{Im}}}
89 \newcommand{\ResX}[3]{\operatorname{Res}\left({{#1}={#2}},{#3}\right)}
90 \newcommand{\Res}[2]{\ResX{z}{#1}{#2}}
91 \newcommand{\limX}[2]{\lim_{{#1} \rightarrow {#2}}}
92 \newcommand{\limZ}[1]{\limX{z}{#1}}
93 \newcommand{\limZp}{\limZ{z_p}}
94 \newcommand{\CPV}{\ensuremath{\mathds{P}}}
95
96 \newcommand{\supScript}[1]{\ensuremath{^{\text{#1}}}}
97 \newcommand{\st}{\supScript{st}}
98 \newcommand{\nd}{\supScript{nd}}
99 \newcommand{\rd}{\supScript{rd}}
100 \newcommand{\sth}{\supScript{th}} % th, TH already taken
101
102 \newcommand{\colA}[1]{\textcolor{red}{#1}}
103 \newcommand{\colB}[1]{\textcolor{blue}{#1}}
104 \definecolor{purple}{rgb}{0.8, 0, 0.8}
105 \newcommand{\colAB}[1]{\textcolor{purple}{#1}}
106 \newcommand{\colC}[1]{\textcolor{green}{#1}}
107
108 \newcommand{\cf}{\emph{cf.}} % "confer" or "bring together" / "compare"
109 \newcommand{\ie}{\emph{i.e.}} % "id est" or "in other words"
110 \newcommand{\insilico}{\emph{in silico}} % quasi latin for "on a computer"
111 \newcommand{\invitro}{\emph{in vitro}}   % latin for "in glass"
112 \newcommand{\invivo}{\emph{in vivo}}     % latin for "in living organisms"
113
114 \newcommand{\ensuretext}[1]{\ensuremath{\text{#1}}}
115 % Hyeon and Thirumalai equation number #1
116 \newcommand{\HTeq}[1]{\ensuretext{\emph{H\&T eq.\ {#1}}}}
117 \newcommand{\kT}{\ensuremath{k_B T}}
118 \newcommand{\bt}{\ensuremath{\beta}}
119 \newcommand{\fs}{\ensuremath{f^*}}
120 \newcommand{\dx}{\ensuremath{\Delta x(\fs)}}
121 \newcommand{\dxs}[1]{\ensuremath{\Delta x_{#1}(\fs)}} % for subscripting
122 \newcommand{\FO}{\ensuremath{\Delta F_0^\ddagger(\fs)}}
123 \newcommand{\vD}{\ensuremath{\nu_D(\fs)}}
124 \newcommand{\vDs}[1]{\ensuremath{\nu_{D{#1}}(\fs)}}
125 \newcommand{\kexp}{\ensuremath{\vD e^{-\bt \FO}}}
126 \newcommand{\kexps}[1]{\ensuremath{\vDs{#1} e^{-\bt_{#1} \FO_{#1}}}}
127 \newcommand{\kf}{\ensuremath{k(\fs)}}
128 \newcommand{\kfs}[1]{\ensuremath{k_{#1}(\fs)}}
129 %\newcommand{\avg}[1]{\ensuremath{\left\langle {#1} \right\rangle}}
130 \newcommand{\abs}[1]{\ensuremath{\lvert {#1} \rvert}}
131 \newcommand{\logp}[1]{\ensuremath{\log\!\!\left( {#1} \right)}}
132 % \! is a negative thin space to get the paren closer to the log
133 %\renewcommand{\r}{\ensuremath{r_f}}
134 %\newcommand{\rs}[1]{\ensuremath{r_{f{#1}}}}% to avoid double-subscripting
135 \newcommand{\ep}{\varepsilon}
136
137 \newcommand{\species}[1]{\emph{#1}} % \species{Homo sapiens}
138
139 % Chemicals
140 \newcommand{\diNaHPO}{Na\textsubscript{2}HPO\textsubscript{4}}
141 \newcommand{\NadiHPO}{NaH\textsubscript{2}PO\textsubscript{4}}
142
143 % Workaround for inline minted markup
144 %   http://code.google.com/p/minted/issues/detail?id=15
145 % usage: \imint{language}|value|
146 \NewDocumentCommand\imint{mv}{\texttt{#2}}
147
148 % Aliases for citations
149 \defcitealias{calibcant}{calibcant}
150 \defcitealias{comedi}{Comedi}
151 \defcitealias{cygwin}{Cygwin}
152 \defcitealias{cython}{Cython}
153 \defcitealias{epics}{EPICS}
154 \defcitealias{force-robot}{ForceRobot}
155 \defcitealias{gentoo}{Gentoo}
156 \defcitealias{h5config}{h5config}
157 \defcitealias{hdf5}{HDF5}
158 \defcitealias{interix}{Interix}
159 \defcitealias{king10}{sawsim}
160 \defcitealias{labview}{LabVIEW}
161 \defcitealias{picoforce}{PicoForce}
162 \defcitealias{prefix}{Gentoo Prefix}
163 \defcitealias{punias}{PUNIAS}
164 \defcitealias{pyafm}{pyafm}
165 \defcitealias{pycomedi}{pycomedi}
166 \defcitealias{pymodbus}{pymodbus}
167 \defcitealias{pymol}{PyMol}
168 \defcitealias{pypid}{pypid}
169 \defcitealias{pypiezo}{pypiezo}
170 \defcitealias{python}{Python}
171 \defcitealias{sandal09}{Hooke}
172 \defcitealias{stepper}{stepper}
173 \defcitealias{beazley96}{SWIG}
174 \defcitealias{unfold-protein}{unfold-protein}
175 \defcitealias{wavemetrics-igor}{IGOR Pro}
176 \defcitealias{xcode}{Xcode}
177 \defcitealias{yaml}{YAML}
178
179 \newcommand{\Comedi}{\citetalias{comedi}}
180 \newcommand{\Hooke}{\citetalias{sandal09}}
181 \newcommand{\calibcant}{\citetalias{calibcant}}
182 \newcommand{\hFconfig}{\citetalias{h5config}}
183 \newcommand{\pyafm}{\citetalias{pyafm}}
184 \newcommand{\pypid}{\citetalias{pypid}}
185 \newcommand{\pypiezo}{\citetalias{pypiezo}}
186 \newcommand{\pycomedi}{\citetalias{pycomedi}}
187 \newcommand{\pysawsim}{\texttt{pysawsim}}
188 \newcommand{\sawsim}{\citetalias{king10}}
189 \newcommand{\stepper}{\citetalias{stepper}}
190 \newcommand{\unfoldprotein}{\citetalias{unfold-protein}}