| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 2023 by Naoki Pross <[email protected]> |
| 4 |
% ------------------------------------------------------- |
| 5 |
% |
| 6 |
% OSTStud.dtx is licensed under a Creative Commons |
| 7 |
% Attribution-ShareAlike 4.0 International License. |
| 8 |
% |
| 9 |
% You should have received a copy of the license along |
| 10 |
% with this work. If not, see |
| 11 |
% <http://creativecommons.org/licenses/by-sa/4.0/>. |
| 12 |
% |
| 13 |
% \fi |
| 14 |
% |
| 15 |
% \iffalse |
| 16 |
%<*driver> |
| 17 |
\ProvidesFile{oststud.dtx} |
| 18 |
%</driver> |
| 19 |
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01] |
| 20 |
%<package>\ProvidesPackage{oststud} |
| 21 |
%<*package> |
| 22 |
[2023/05/20 v0.4 OST Student's package] |
| 23 |
%</package> |
| 24 |
% |
| 25 |
%<*driver> |
| 26 |
\documentclass{ltxdoc} |
| 27 |
|
| 28 |
\usepackage{oststud} |
| 29 |
\usepackage{enumitem} |
| 30 |
\usepackage{esint} |
| 31 |
\usepackage{tikz} |
| 32 |
\usepackage{framed} |
| 33 |
\usepackage[ |
| 34 |
type={CC}, |
| 35 |
modifier={by-sa}, |
| 36 |
version={4.0}, |
| 37 |
]{doclicense} |
| 38 |
|
| 39 |
|
| 40 |
\EnableCrossrefs |
| 41 |
\CodelineIndex |
| 42 |
\RecordChanges |
| 43 |
\begin{document} |
| 44 |
\DocInput{oststud.dtx} |
| 45 |
\PrintChanges |
| 46 |
\PrintIndex |
| 47 |
\end{document} |
| 48 |
%</driver> |
| 49 |
% \fi |
| 50 |
% |
| 51 |
% \changes{v0.1}{2022/11/18}{Initial version} |
| 52 |
% \changes{v0.2}{2022/11/22}{Port features of \texttt{hsrstud}} |
| 53 |
% \changes{v0.3}{2023/04/18}{Cleanup for CTAN upload} |
| 54 |
% \changes{v0.4}{2023/05/20}{Fix probability operators and improve documentation} |
| 55 |
% |
| 56 |
% \GetFileInfo{oststud.dtx} |
| 57 |
% |
| 58 |
% \DoNotIndex{\newcommand,\newenvironment,\fi,\else} |
| 59 |
% |
| 60 |
% \title{ |
| 61 |
% \texttt{\textcolor{OSTBlackberry}{ost}stud} --- |
| 62 |
% OST-Stud Style and Macros\thanks{ |
| 63 |
% This document corresponds to \textsf{oststud}~\fileversion, last |
| 64 |
% revised \filedate. |
| 65 |
% } |
| 66 |
% } |
| 67 |
% \author{Naoki Sean Pross \texttt{<[email protected]>}} |
| 68 |
% \date{Released \filedate} |
| 69 |
% |
| 70 |
% \maketitle |
| 71 |
% \tableofcontents |
| 72 |
% |
| 73 |
% \section*{License} |
| 74 |
% \doclicenseThis |
| 75 |
% |
| 76 |
% \section{Purpose of this Package} |
| 77 |
% |
| 78 |
% This package is made for the OST Studenten organization to provide an easy to |
| 79 |
% use interface that gives a more consistent look and feel to the works |
| 80 |
% produced by its members. This package is the successor after the fusion of |
| 81 |
% the old |hsrstud| package. |
| 82 |
% |
| 83 |
% \section{Package Options} |
| 84 |
% \begin{description}[align=right] |
| 85 |
% \item[|dontrenew|] Do not renew existing \LaTeX{} commands and |
| 86 |
% environments. This is useful when the package is loaded on a document |
| 87 |
% that is already partially written. |
| 88 |
% \item[|textvecdiff|] Disables the ``Nabla'' or ``Del'' notation for vector |
| 89 |
% derivatives. Instead the symbols \(\vec{\nabla}, \vec{\nabla}\dotp, |
| 90 |
% \vec{\nabla}\crossp, \nabla^2, \vec{\nabla}^2\) are be replaced with |
| 91 |
% grad, div, curl and div grad. |
| 92 |
% \item[|bfemph|] Change the behaviour of |\emph| to use a bold font for |
| 93 |
% emphasis (instead of italics). This option cannot be used together |
| 94 |
% with the |dontrenew| option. |
| 95 |
% \item[|bbprobability|] Use blackboard symbols $\mathbb{P}$, $\mathbb{E}$ |
| 96 |
% and $\mathbb{V}$ instead of Pr, E and Var for the probability, |
| 97 |
% expectation and variance respectively. |
| 98 |
% \item[|scrtransforms|] \textit{Work in progress.} |
| 99 |
% \end{description} |
| 100 |
% |
| 101 |
% \section{Usage} |
| 102 |
% |
| 103 |
% \subsection{Vectors and Vector Calculus} |
| 104 |
% |
| 105 |
% \DescribeMacro{\vec} |
| 106 |
% \DescribeMacro{\uvec} |
| 107 |
% In the physics used by electrical engineers it is common to use lowercase |
| 108 |
% bold letters for vectors (with the exception of electromagnetic fields |
| 109 |
% $\vec{E},\vec{B},\vec{A},\ldots$). If the |dontrenew| option is set a new |
| 110 |
% macro |\bvec| (bold |\vec|) that takes a \marg{symbol} defines the bold |
| 111 |
% vector notation. Otherwise the default vector notation with the tiny ugly |
| 112 |
% arrow ($\oldvec{u}$) is replaced by bold and the arrow notation saved in |
| 113 |
% |\oldvec|. In vector calculus it is common to denote unit vectors by putting |
| 114 |
% a hat, so there is a macro |\uvec| that does just that: |
| 115 |
% ^^A \begin{leftbar} |
| 116 |
% ^^A |\uvec{u} = \vec{u}/u| |
| 117 |
% ^^A \end{leftbar} |
| 118 |
% \[ |
| 119 |
% \uvec{u} = \vec{u}/u. |
| 120 |
% \] |
| 121 |
% |
| 122 |
% \DescribeMacro{\dotp} |
| 123 |
% \DescribeMacro{\crossp} |
| 124 |
% To differentiate the dot and cross products (between vectors) from normal |
| 125 |
% product between scalars ($a \cdot b$ and $a \times b$), the macros |\dotp| |
| 126 |
% and |\crossp| provide a bold variant: |
| 127 |
% \begin{leftbar} |
| 128 |
% |\vec{u} \dotp \vec{v}, \vec{u} \crossp \vec{v}| |
| 129 |
% \end{leftbar} |
| 130 |
% \[ |
| 131 |
% \vec{u} \dotp \vec{v}, \qquad |
| 132 |
% \vec{u} \crossp \vec{v}. |
| 133 |
% \] |
| 134 |
% |
| 135 |
% \DescribeMacro{\grad} |
| 136 |
% \DescribeMacro{\div} |
| 137 |
% \DescribeMacro{\curl} |
| 138 |
% The macros |\grad|, |\div| and |\curl| provide symbols for the gradient, |
| 139 |
% divergence and curl operators used in vector calculus. If the option |
| 140 |
% |textvecdiff| is set, they symbols are written as words, otherwise they will |
| 141 |
% he written (ab)using the Nabla symbol, i.e. by pretending that the symbol |
| 142 |
% $\vec{\nabla}$ is a ``vector'' (sometime referred to as ``del'') of partial |
| 143 |
% derivates: $\vec{\nabla} = (\partial_x, \partial_y, \partial_z)^\mathsf{T}$. |
| 144 |
% Unless the option |dontrenew| is set, the division symbol is replaced by the |
| 145 |
% divergence and the symbol $\divsymb$ is saved in |\divsymb|. For a scalar |
| 146 |
% field $\phi$ or a vector field $\vec{F}$ the notation (in order) of the |
| 147 |
% gradient, divergence and curl appear as follows: |
| 148 |
% \begin{leftbar} |
| 149 |
% |\grad \phi, \div \vec{F}, \curl \vec{F}| |
| 150 |
% \end{leftbar} |
| 151 |
% \[ |
| 152 |
% \grad \phi, \quad |
| 153 |
% \div \vec{F}, \quad |
| 154 |
% \curl \vec{F}. |
| 155 |
% \] |
| 156 |
% |
| 157 |
% \DescribeMacro{\laplacian} |
| 158 |
% \DescribeMacro{\vlaplacian} |
| 159 |
% Continuing with the (ab)use of the ``Nabla'' or ``Del'' notation, the |
| 160 |
% there is a macro |\laplacian| for the Laplacian operator |
| 161 |
% \begin{leftbar} |
| 162 |
% |\laplacian \equiv \div \grad \equiv \sum_i \partial^2_i| |
| 163 |
% \end{leftbar} |
| 164 |
% \[ |
| 165 |
% \laplacian \equiv \div \grad \equiv \sum_i \partial^2_i. |
| 166 |
% \] |
| 167 |
% Notice that the Nabla symbol is not bold, that is because the Laplacian |
| 168 |
% operator results in a scalar value. Though, sometimes in electrodynamics the |
| 169 |
% vector Laplacian is used (which applies the Laplacian operator to each |
| 170 |
% component). To differentiate the two there is a macro |\vlaplacian| which |
| 171 |
% uses the bold nabla symbol: $\vlaplacian$. If the option |dontrenew| is set |
| 172 |
% both symbols are replaced by div grad. |
| 173 |
% |
| 174 |
% \subsection{Linear Algebra} |
| 175 |
% |
| 176 |
% \DescribeMacro{\mx} |
| 177 |
% Similarly to vectors it is common to write matrices as uppercase bold |
| 178 |
% letters, thus the |\mx| macro takes a \marg{symbol} and typesets it as |
| 179 |
% upright bold. |
| 180 |
% |
| 181 |
% \DescribeMacro{\mt} |
| 182 |
% \DescribeMacro{\mh} |
| 183 |
% The ``normal'' and Hermitian (complex conjugate) transpose of a matrix |
| 184 |
% $\mx{F}$ are denoted by a superscript sans-serif T or H respectively |
| 185 |
% ($\mt{\mx{F}}$ resp. $\mh{\mx{F}}$). The |\mt| and |\mh| macros (matrix |
| 186 |
% transpose and Hermitian transpose) provide this notation; They both take a |
| 187 |
% \marg{symbol}. In abstract vector spaces the Hermitian transpose becomes the |
| 188 |
% adjoint, for which it is common to use a superscript dagger (adjoint of |
| 189 |
% $\mathcal{Q}$ is $\mathcal{Q}^\dagger$), but since it does not come up very |
| 190 |
% often this package does \emph{not} provide a macro for the adjoint. |
| 191 |
% |
| 192 |
% \DescribeMacro{\minv} |
| 193 |
% Another common matrix operation that is annoying to write is the matrix |
| 194 |
% inverse, which is usually written as a superscript -1. The |\minv| command |
| 195 |
% takes a \marg{matrix} and adds the -1 superscript. |
| 196 |
% |
| 197 |
% Using all of the above we can typeset the matrix form of the linear least |
| 198 |
% squares approximation by writing |
| 199 |
% \begin{leftbar} |
| 200 |
% |\vec{a} = \minv{(\mt{\mx{Q}} \mx{Q})} \mt{\mx{Q}}\vec{y}| |
| 201 |
% \end{leftbar} |
| 202 |
% \noindent which results in the following: |
| 203 |
% \[ |
| 204 |
% \vec{a} = \minv{(\mt{\mx{Q}} \mx{Q})} \mt{\mx{Q}}\vec{y} |
| 205 |
% \iff |
| 206 |
% \argmin_{(a_1,a_2)} \left(\sum_{i=0}^n y_i - a_1 x_i + a_2\right). |
| 207 |
% \] |
| 208 |
% |
| 209 |
% \DescribeMacro{\tr} |
| 210 |
% This package also provides a macro for the trace of a matrix. |
| 211 |
% |
| 212 |
% \subsection{Mathematical Programming} |
| 213 |
% |
| 214 |
% \DescribeMacro{\argmin} |
| 215 |
% \DescribeMacro{\argmax} |
| 216 |
% ^^A TODO: write section |
| 217 |
% \textit{Work in progress.} |
| 218 |
% |
| 219 |
% \subsection{Complex Numbers} |
| 220 |
% |
| 221 |
% \DescribeMacro{\Re} |
| 222 |
% \DescribeMacro{\Im} |
| 223 |
% AMS maths's default notation for the real and imaginary parts of a complex |
| 224 |
% number use the Fraktur font capital letters $\mathfrak{R}$ and |
| 225 |
% $\mathfrak{I}$. However, in engineering it is more common to see the notation |
| 226 |
% $\Re{z}$ and $\Im{z}$, thus, unless the |dontrenew| option is set this |
| 227 |
% package replaces the notation with the former symbols. Both of the macros |
| 228 |
% were also modified to take an argument \marg{expression}, to surround the |
| 229 |
% expression with opening and closing curly brackets. |
| 230 |
% |
| 231 |
% \subsection{Probability Operators} |
| 232 |
% |
| 233 |
% \DescribeMacro{\Pr} |
| 234 |
% \DescribeMacro{\E} |
| 235 |
% \DescribeMacro{\Var} |
| 236 |
% Since according to quantum mechanics it seems that ultimately the universe |
| 237 |
% can only be described using probabilities there are the operators |\Pr|, |\E| |
| 238 |
% and |\Var| for the probability, expectation and variance respectively. If the |
| 239 |
% |dontrenew| option is set, the probability is defined in the csname |\P|. |
| 240 |
% |
| 241 |
% All three operators take an argument \marg{expression} which is automatically |
| 242 |
% surrounded using curly braces. If the expression contains multiple random |
| 243 |
% variables, to disambiguate with respect to which variable the operation is |
| 244 |
% being taken it is possible to specify an optional argument \oarg{rv}. An |
| 245 |
% example: |
| 246 |
% \begin{leftbar} |
| 247 |
% |\E[x]{g(x)} = \int_\mathcal{X} g(\bar{x}) p_x(\bar{x}) \, d\bar{x}| |
| 248 |
% \end{leftbar} |
| 249 |
% \[ |
| 250 |
% \E[x]{g(x)} = \int_\mathcal{X} g(\bar{x}) p_x(\bar{x}) \, d\bar{x}. |
| 251 |
% \] |
| 252 |
% |
| 253 |
% Because some people like to use the blackboard font for the probability |
| 254 |
% operators (such as in the machine learning community), there is an option |
| 255 |
% |bbprobability| that changes the look of the three operators to $\mathbb{P}$, |
| 256 |
% $\mathbb{E}$ and $\mathbb{V}$. |
| 257 |
% |
| 258 |
% \subsection{Transformation Operators} |
| 259 |
% |
| 260 |
% \DescribeMacro{\corresponds} |
| 261 |
% \DescribeMacro{\rcorresponds} |
| 262 |
% When working with transformations it is common to use the ``correspondence |
| 263 |
% symbol'' show below for example with the Laplace transformation: |
| 264 |
% \begin{leftbar} |
| 265 |
% |\laplace\{f(t)\} = F(s) \corresponds f(t) \rcorresponds F(s)| |
| 266 |
% \end{leftbar} |
| 267 |
% \[ |
| 268 |
% \laplace\{f(t)\} = F(s) \corresponds f(t) \rcorresponds F(s) |
| 269 |
% \] |
| 270 |
% |
| 271 |
% \DescribeMacro{\fourier} |
| 272 |
% \DescribeMacro{\ifourier} |
| 273 |
% \DescribeMacro{\laplace} |
| 274 |
% \DescribeMacro{\ilaplace} |
| 275 |
% \DescribeMacro{\ztransf} |
| 276 |
% \DescribeMacro{\iztransf} |
| 277 |
% \DescribeMacro{\hilbert} |
| 278 |
% As shown in the example above the for the Laplace transform operator symbol |
| 279 |
% there is a macro |\laplace|. Similar operators are also defined for other |
| 280 |
% transformations and their inverses. Here is their usual definition: |
| 281 |
% \begin{align*} |
| 282 |
% \fourier\left\{f(t)\right\}(\omega) |
| 283 |
% &= \frac{1}{\sqrt{2\pi}} \int_\mathbb{R} f(t) e^{-i\omega t} \, dt, & |
| 284 |
% \ifourier\left\{F(\omega)\right\}(t) |
| 285 |
% &= \frac{1}{\sqrt{2\pi}} \int_\mathbb{R} F(\omega) e^{i\omega t} \, d\omega, \\ |
| 286 |
% \laplace\left\{f(t)\right\}(s) |
| 287 |
% &= \int_\mathbb{R^+} f(t) e^{-st} \, dt, & |
| 288 |
% \ilaplace\left\{F(s)\right\}(t) |
| 289 |
% &= \frac{1}{2\pi i}\int_{\gamma + i\mathbb{R}} F(s) e^{st} \, ds, \\ |
| 290 |
% \ztransf \left\{f_k\right\}(z) |
| 291 |
% &= \sum_{k \in \mathbb{Z}^+} f_k z^{-k}, & |
| 292 |
% \iztransf \left\{F(z)\right\}(k) |
| 293 |
% &= \frac{1}{2\pi i} \ointctrclockwise_C F(z) z^{k-1} \, dz, \\ |
| 294 |
% \hilbert \left\{ f(t) \right\}(\tau) |
| 295 |
% &= \mathrm{P.V.} \frac{1}{\pi} \int_\mathbb{R} \frac{f(t)}{\tau - t} \, dt, |
| 296 |
% \end{align*} |
| 297 |
% in order they are the Fourier transform (|\fourier|, |\ifourier|), the |
| 298 |
% Laplace transform (|\laplace|, |\ilaplace|), the Z-transform (|\ztransf|, |
| 299 |
% |\iztransf|), and the Hilbert transform (|\hilbert|). The Hilbert has no |
| 300 |
% inverse since $-\hilbert \hilbert f(t) = f(t)$, tough of course one could |
| 301 |
% write |\hilbert^{-1}| to get $\hilbert^{-1}$. |
| 302 |
% |
| 303 |
% \subsection{References} |
| 304 |
% |
| 305 |
% ^^A TODO: write section |
| 306 |
% \textit{Work in progress.} |
| 307 |
% |
| 308 |
% ^^A \DescribeMacro{\skriptum} |
| 309 |
% ^^A \DescribeMacro{\sref} |
| 310 |
% |
| 311 |
% ^^A \DescribeMacro{\textbook} |
| 312 |
% ^^A \DescribeMacro{\bref} |
| 313 |
% |
| 314 |
% \subsection{OST Colors} |
| 315 |
% |
| 316 |
% The official OST color palette provides the following ``primary'' or |
| 317 |
% ``accent'' colors. |
| 318 |
% \begin{center} |
| 319 |
% \begin{tikzpicture} |
| 320 |
% \begin{scope} |
| 321 |
% \foreach [count=\i] \c in {Black,Gray,Blackberry,Raspberry} { |
| 322 |
% \node[ |
| 323 |
% thick, draw=white, fill={OST\c}, |
| 324 |
% minimum width=3cm, minimum height=1cm, |
| 325 |
% ] (\c) at ({3.2cm*\i},0) {\texttt{OST\c}}; |
| 326 |
% } |
| 327 |
% ^^A Because you can't see black on black |
| 328 |
% \node[text=white] at (Black) {\texttt{OSTBlack}}; |
| 329 |
% \end{scope} |
| 330 |
% \end{tikzpicture} |
| 331 |
% \end{center} |
| 332 |
% And then there are the other ``design colors''. |
| 333 |
% \begin{center} |
| 334 |
% \begin{tikzpicture} |
| 335 |
% \begin{scope}[yshift=-2cm] |
| 336 |
% \foreach [count=\i] \c in {Orange,Red,Purple,Blue,Green} { |
| 337 |
% \foreach [count=\j] \s in {Dark,{},Light}{ |
| 338 |
% \node[ |
| 339 |
% thick, draw=white, fill={OST\s\c}, |
| 340 |
% minimum width=3cm, minimum height=1cm, |
| 341 |
% ] (\c\s) at ({3.2cm*\j},{-1.2cm*\i}) {\texttt{OST\s\c}}; |
| 342 |
% } |
| 343 |
% } |
| 344 |
% \end{scope} |
| 345 |
% \end{tikzpicture} |
| 346 |
% \end{center} |
| 347 |
% |
| 348 |
% \subsection{Sane Defaults} |
| 349 |
% |
| 350 |
% ^^A TODO: write section |
| 351 |
% \textit{Work in progress.} |
| 352 |
% |
| 353 |
% ^^A This macros separates the documentation from the implementation |
| 354 |
% \StopEventually{} |
| 355 |
% |
| 356 |
% \section{Implementation} |
| 357 |
% |
| 358 |
% \subsection{Dependencies and Parse Options} |
| 359 |
% |
| 360 |
% First, we have the dependencies necessary for typesetting. |
| 361 |
% \begin{macrocode} |
| 362 |
\RequirePackage{xcolor} |
| 363 |
\RequirePackage{amsmath} |
| 364 |
\RequirePackage{amssymb} |
| 365 |
\RequirePackage{bm} |
| 366 |
% \end{macrocode} |
| 367 |
% This package also sets sane defaults to the following packages. |
| 368 |
% \begin{macrocode} |
| 369 |
\RequirePackage{hyperref} |
| 370 |
\RequirePackage{listings} |
| 371 |
% \end{macrocode} |
| 372 |
% Then we create the options for the package. |
| 373 |
% \begin{macrocode} |
| 374 |
\SetupKeyvalOptions{ |
| 375 |
family=ost, |
| 376 |
prefix=ost@ |
| 377 |
} |
| 378 |
\DeclareBoolOption[false]{dontrenew} |
| 379 |
\DeclareBoolOption[false]{textvecdiff} |
| 380 |
\DeclareBoolOption[false]{bfemph} |
| 381 |
\DeclareBoolOption[false]{bbprobability} |
| 382 |
% \DeclareBoolOption[false]{scrtransforms} |
| 383 |
\ProcessLocalKeyvalOptions* |
| 384 |
% \end{macrocode} |
| 385 |
% |
| 386 |
% \subsection{Bold emphasis} |
| 387 |
% |
| 388 |
% \begin{macro}{\emph} |
| 389 |
% Change the behaviour of |\emph|. |
| 390 |
% \begin{macrocode} |
| 391 |
\ifost@bfemph |
| 392 |
\ifost@dontrenew |
| 393 |
\PackageError{The options \noexpand\dontrenew and \noexpand\bfemph cannot be used at the same time!} |
| 394 |
\fi |
| 395 |
\long\expandafter\def\csname em \endcsname{% |
| 396 |
\@nomath\em |
| 397 |
\if b\expandafter\@car\f@series\@nil |
| 398 |
\itshape\else\bfseries\fi |
| 399 |
} |
| 400 |
\fi |
| 401 |
% \end{macrocode} |
| 402 |
% \end{macro} |
| 403 |
% |
| 404 |
% \subsection{Vectors and Vector Calculus} |
| 405 |
% |
| 406 |
% \begin{macro}{\vec} |
| 407 |
% Set up bold notation for vectors. |
| 408 |
% \begin{macrocode} |
| 409 |
\newcommand{\ost@vec}[1]{\mathbf{\bm{#1}}} |
| 410 |
\ifost@dontrenew |
| 411 |
\newcommand{\bvec}[1]{\ost@vec{#1}} |
| 412 |
\else |
| 413 |
\let\oldvec\vec |
| 414 |
\renewcommand{\vec}[1]{\ost@vec{#1}} |
| 415 |
\fi |
| 416 |
% \end{macrocode} |
| 417 |
% \end{macro} |
| 418 |
% |
| 419 |
% \begin{macro}{\uvec} |
| 420 |
% In vector calculus unit vectors are usually denoted by a hat. |
| 421 |
% \begin{macrocode} |
| 422 |
\newcommand{\uvec}[1]{\vec{\hat{#1}}} |
| 423 |
% \end{macrocode} |
| 424 |
% \end{macro} |
| 425 |
% |
| 426 |
% \begin{macro}{\dotp,\crossp} |
| 427 |
% To differentiate them from |\cdot| and |\times| which are for scalars. |
| 428 |
% \begin{macrocode} |
| 429 |
\DeclareMathOperator{\dotp}{\boldsymbol\cdot} |
| 430 |
\DeclareMathOperator{\crossp}{\boldsymbol\times} |
| 431 |
% \end{macrocode} |
| 432 |
% \end{macro} |
| 433 |
% |
| 434 |
% \begin{macro}{\grad} |
| 435 |
% Gradient of a vector valued scalar functon. |
| 436 |
% \begin{macrocode} |
| 437 |
\ifost@textvecdiff |
| 438 |
\DeclareMathOperator{\grad}{grad} |
| 439 |
\else |
| 440 |
\DeclareMathOperator{\grad}{\vec{\nabla}} |
| 441 |
\fi |
| 442 |
% \end{macrocode} |
| 443 |
% \end{macro} |
| 444 |
% |
| 445 |
% \begin{macro}{\div} |
| 446 |
% Divergence operator. If the option |dontrenew| is a new macro |\divg| is |
| 447 |
% defined. Otherwise |\div| is renamed to |\divsymb|. |
| 448 |
% \begin{macrocode} |
| 449 |
\ifost@textvecdiff |
| 450 |
\DeclareMathOperator{\ost@div}{div} |
| 451 |
\else |
| 452 |
\DeclareMathOperator{\ost@div}{\vec{\nabla}\dotp} |
| 453 |
\fi |
| 454 |
\ifost@dontrenew |
| 455 |
\DeclareMathOperator{\divg}{\ost@div} |
| 456 |
\else |
| 457 |
\let\divsymb\div |
| 458 |
\renewcommand{\div}{\ost@div} |
| 459 |
\fi |
| 460 |
% \end{macrocode} |
| 461 |
% \end{macro} |
| 462 |
% |
| 463 |
% \begin{macro}{\curl} |
| 464 |
% Curl of a vector field. |
| 465 |
% \begin{macrocode} |
| 466 |
\ifost@textvecdiff |
| 467 |
\DeclareMathOperator{\curl}{curl} |
| 468 |
\else |
| 469 |
\DeclareMathOperator{\curl}{\vec{\nabla}\crossp} |
| 470 |
\fi |
| 471 |
% \end{macrocode} |
| 472 |
% \end{macro} |
| 473 |
% |
| 474 |
% \begin{macro}{\laplacian,\vlaplacian} |
| 475 |
% Laplacian of a scalar and vector field. |
| 476 |
% \begin{macrocode} |
| 477 |
\ifost@textvecdiff |
| 478 |
\DeclareMathOperator{\laplacian}{\div\grad} |
| 479 |
\DeclareMathOperator{\vlaplacian}{\div\grad} |
| 480 |
\else |
| 481 |
\DeclareMathOperator{\laplacian}{\nabla^2} |
| 482 |
\DeclareMathOperator{\vlaplacian}{\vec{\nabla}^2} |
| 483 |
\fi |
| 484 |
% \end{macrocode} |
| 485 |
% \end{macro} |
| 486 |
% |
| 487 |
% \subsection{Linear Algebra} |
| 488 |
% |
| 489 |
% \begin{macro}{\mx} |
| 490 |
% Notation for matrices as bold (uppercase) letters. |
| 491 |
% \begin{macrocode} |
| 492 |
\newcommand{\mx}[1]{\mathbf{\bm{#1}}} |
| 493 |
% \end{macrocode} |
| 494 |
% \end{macro} |
| 495 |
% |
| 496 |
% \begin{macro}{\mt,\mh} |
| 497 |
% Normal and Hermitian (conjugate) transpose of a matrix. |
| 498 |
% \begin{macrocode} |
| 499 |
\newcommand{\mt}[1]{{#1}^\mathsf{T}} |
| 500 |
\newcommand{\mh}[1]{{#1}^\mathsf{H}} |
| 501 |
% \end{macrocode} |
| 502 |
% \end{macro} |
| 503 |
% |
| 504 |
% \begin{macro}{\minv} |
| 505 |
% Matrix inverse. |
| 506 |
% \begin{macrocode} |
| 507 |
\newcommand{\minv}[1]{{#1}^{-1}} |
| 508 |
% \end{macrocode} |
| 509 |
% \end{macro} |
| 510 |
% |
| 511 |
% \begin{macro}{\tr} |
| 512 |
% Trace of a matrix. |
| 513 |
% \begin{macrocode} |
| 514 |
\DeclareMathOperator{\tr}{tr} |
| 515 |
% \end{macrocode} |
| 516 |
% \end{macro} |
| 517 |
% |
| 518 |
% \subsection{Mathematical Programming} |
| 519 |
% \begin{macro}{\argmin,\argmax} |
| 520 |
% \begin{macrocode} |
| 521 |
\DeclareMathOperator*{\argmax}{arg\,max} |
| 522 |
\DeclareMathOperator*{\argmin}{arg\,min} |
| 523 |
% \end{macrocode} |
| 524 |
% \end{macro} |
| 525 |
% |
| 526 |
% \subsection{Complex Numbers} |
| 527 |
% |
| 528 |
% \begin{macro}{\Re,\Im} |
| 529 |
% Replace the real and imaginary operators to look ``normal'', that is not |
| 530 |
% using the Fraktur fonts. |
| 531 |
% \begin{macrocode} |
| 532 |
\ifost@dontrenew\else |
| 533 |
\let\oldRe\Re \let\oldIm\Im |
| 534 |
\renewcommand{\Re}[1]{\mathrm{Re} \left\{#1\right\}} |
| 535 |
\renewcommand{\Im}[1]{\mathrm{Im} \left\{#1\right\}} |
| 536 |
\fi |
| 537 |
% \end{macrocode} |
| 538 |
% \end{macro} |
| 539 |
% |
| 540 |
% \subsection{Probability Operators} |
| 541 |
% |
| 542 |
% \begin{macro}{\E} |
| 543 |
% Expectation of a random variable. |
| 544 |
% \begin{macrocode} |
| 545 |
\ifost@bbprobability |
| 546 |
\DeclareMathOperator*{\ost@expectation}{\mathbb{E}} |
| 547 |
\else |
| 548 |
\DeclareMathOperator*{\ost@expectation}{E} |
| 549 |
\fi |
| 550 |
\newcommand*{\E}[2][]{\ost@expectation_{#1}\left\{#2\right\}} |
| 551 |
% \end{macrocode} |
| 552 |
% \end{macro} |
| 553 |
% |
| 554 |
% \begin{macro}{\Var} |
| 555 |
% Variance of a random variable. |
| 556 |
% \begin{macrocode} |
| 557 |
\ifost@bbprobability |
| 558 |
\DeclareMathOperator*{\ost@variance}{\mathbb{V}} |
| 559 |
\else |
| 560 |
\DeclareMathOperator*{\ost@variance}{Var} |
| 561 |
\fi |
| 562 |
\newcommand*{\Var}[2][]{\ost@variance_{#1}\left\{#2\right\}} |
| 563 |
% \end{macrocode} |
| 564 |
% \end{macro} |
| 565 |
% |
| 566 |
% \begin{macro}{\Pr} |
| 567 |
% Probability operator. |
| 568 |
% \begin{macrocode} |
| 569 |
\ifost@bbprobability |
| 570 |
\DeclareMathOperator*{\ost@probability}{\mathbb{P}} |
| 571 |
\else |
| 572 |
\DeclareMathOperator*{\ost@probability}{Pr} |
| 573 |
\fi |
| 574 |
\ifost@dontrenew |
| 575 |
\newcommand*{\P}[2][]{\ost@probabiliy_{#1}\left\{#2\right\}} |
| 576 |
\else |
| 577 |
\renewcommand*{\P}[2][]{\ost@probabiliy_{#1}\left\{#2\right\}} |
| 578 |
\fi |
| 579 |
% \end{macrocode} |
| 580 |
% \end{macro} |
| 581 |
% |
| 582 |
% \subsection{Transformation Operators} |
| 583 |
% |
| 584 |
% \begin{macro}{\fourier,\ifourier} |
| 585 |
% Fourier transform and its inverse. |
| 586 |
% \begin{macrocode} |
| 587 |
\DeclareMathOperator{\fourier}{\mathcal{F}} |
| 588 |
\DeclareMathOperator{\ifourier}{\mathcal{F}^{-1}} |
| 589 |
% \end{macrocode} |
| 590 |
% \end{macro} |
| 591 |
% |
| 592 |
% \begin{macro}{\laplace,\ilaplace} |
| 593 |
% Laplace transform and its inverse. |
| 594 |
% \begin{macrocode} |
| 595 |
\DeclareMathOperator{\laplace}{\mathcal{L}} |
| 596 |
\DeclareMathOperator{\ilaplace}{\mathcal{L}^{-1}} |
| 597 |
% \end{macrocode} |
| 598 |
% \end{macro} |
| 599 |
% |
| 600 |
% \begin{macro}{\ztransf,\iztransf} |
| 601 |
% Z-transform and its inverse. |
| 602 |
% \begin{macrocode} |
| 603 |
\DeclareMathOperator{\ztransf}{\mathcal{Z}} |
| 604 |
\DeclareMathOperator{\iztransf}{\mathcal{Z}^{-1}} |
| 605 |
% \end{macrocode} |
| 606 |
% \end{macro} |
| 607 |
% |
| 608 |
% \begin{macro}{\hilbert} |
| 609 |
% Hilbert transform. |
| 610 |
% \begin{macrocode} |
| 611 |
\DeclareMathOperator{\hilbert}{\mathcal{H}} |
| 612 |
% \end{macrocode} |
| 613 |
% \end{macro} |
| 614 |
% |
| 615 |
% \begin{macro}{\corresponds,\rcorresponds} |
| 616 |
% Correspondence symbols. |
| 617 |
% \begin{macrocode} |
| 618 |
\newcommand{\corresponds}{% |
| 619 |
\mbox{\setlength{\unitlength}{0.1em}% |
| 620 |
\begin{picture}(20,10)% |
| 621 |
\put(5,3){\circle{4}}% |
| 622 |
\put(7,3){\line(1,0){7}}% |
| 623 |
\put(16,3){\circle*{4}}% |
| 624 |
\end{picture}}} |
| 625 |
\newcommand{\rcorresponds}{% |
| 626 |
\mbox{\setlength{\unitlength}{0.1em}% |
| 627 |
\begin{picture}(20,10)% |
| 628 |
\put(5,3){\circle*{4}}% |
| 629 |
\put(7,3){\line(1,0){7}}% |
| 630 |
\put(16,3){\circle{4}}% |
| 631 |
\end{picture}}} |
| 632 |
% \end{macrocode} |
| 633 |
% \end{macro} |
| 634 |
% |
| 635 |
% \subsection{References} |
| 636 |
% |
| 637 |
% \begin{macro}{\skriptum,\sref} |
| 638 |
% Reference material in the skriptum (lecture notes) of the course. |
| 639 |
% \begin{macrocode} |
| 640 |
\newcommand{\ost@skriptum}{\PackageWarning{No \noexpand\skriptum given}} |
| 641 |
\newcommand{\skriptum}[1]{\gdef\ost@skriptum{#1}} |
| 642 |
\newcommand{\sref}[1]{% |
| 643 |
\texttt{\textcolor{OSTBlackberry}{#1}}\nocite{\ost@skriptum}} |
| 644 |
% \end{macrocode} |
| 645 |
% \end{macro} |
| 646 |
% |
| 647 |
% \begin{macro}{\textbook,\bref} |
| 648 |
% Reference material in the textbook of the course. |
| 649 |
% \begin{macrocode} |
| 650 |
\newcommand{\ost@textbook}{\PackageWarning{No \noexpand\textbook given}} |
| 651 |
\newcommand{\textbook}[1]{\gdef\ost@textbook{#1}} |
| 652 |
\newcommand{\bref}[1]{% |
| 653 |
\texttt{\textcolor{OSTRaspberry}{#1}}\nocite{\ost@textbook}} |
| 654 |
% \end{macrocode} |
| 655 |
% \end{macro} |
| 656 |
% |
| 657 |
% \subsection{OST Colors} |
| 658 |
% |
| 659 |
% Define the colors according to the OST corporate design. The code was kindly |
| 660 |
% stolen from H. Badertscher's \texttt{OSTColors.sty} |
| 661 |
% \cite{hbadertscher-ostcolors}. First there are the ``primary colors''. |
| 662 |
% \begin{macrocode} |
| 663 |
\definecolor{OSTBlack}{RGB}{25,25,25} |
| 664 |
\definecolor{OSTGray}{RGB}{198,198,198} |
| 665 |
\definecolor{OSTBlackberry}{RGB}{140,25,95} |
| 666 |
\definecolor{OSTRaspberry}{RGB}{215,40,100} |
| 667 |
% \end{macrocode} |
| 668 |
% Then the ``design colors''. |
| 669 |
% \begin{macrocode} |
| 670 |
\definecolor{OSTPurple}{RGB}{149,96,164} |
| 671 |
\definecolor{OSTDarkPurple}{RGB}{107,56,129} |
| 672 |
\definecolor{OSTLightPurple}{RGB}{208,169,208} |
| 673 |
% \end{macrocode} |
| 674 |
% \begin{macrocode} |
| 675 |
\definecolor{OSTGreen}{RGB}{29,175,142} |
| 676 |
\definecolor{OSTDarkGreen}{RGB}{0,126,107} |
| 677 |
\definecolor{OSTLightGreen}{RGB}{167,213,194} |
| 678 |
% \end{macrocode} |
| 679 |
% \begin{macrocode} |
| 680 |
\definecolor{OSTRed}{RGB}{232,78,15} |
| 681 |
\definecolor{OSTDarkRed}{RGB}{195,46,21} |
| 682 |
\definecolor{OSTLightRed}{RGB}{243,154,139} |
| 683 |
% \end{macrocode} |
| 684 |
% \begin{macrocode} |
| 685 |
\definecolor{OSTBlue}{RGB}{0,134,205} |
| 686 |
\definecolor{OSTDarkBlue}{RGB}{0,115,176} |
| 687 |
\definecolor{OSTLightBlue}{RGB}{95,191,237} |
| 688 |
% \end{macrocode} |
| 689 |
% \begin{macrocode} |
| 690 |
\definecolor{OSTOrange}{RGB}{251,186,0} |
| 691 |
\definecolor{OSTDarkOrange}{RGB}{209,143,0} |
| 692 |
\definecolor{OSTLightOrange}{RGB}{253,214,175} |
| 693 |
% \end{macrocode} |
| 694 |
% |
| 695 |
% \subsection{Sane Defaults} |
| 696 |
% |
| 697 |
% First, set up |hyperref| to not look hideous. |
| 698 |
% \begin{macrocode} |
| 699 |
\hypersetup{ |
| 700 |
colorlinks=true, |
| 701 |
linkcolor=OSTBlack, |
| 702 |
citecolor=OSTBlackberry, |
| 703 |
filecolor=OSTBlack, |
| 704 |
urlcolor=OSTDarkBlue, |
| 705 |
} |
| 706 |
% \end{macrocode} |
| 707 |
% Then create a listings style. |
| 708 |
% \begin{macrocode} |
| 709 |
\lstdefinestyle{ost-base}{ |
| 710 |
belowcaptionskip=\baselineskip, |
| 711 |
breaklines=true, |
| 712 |
frame=none, |
| 713 |
inputencoding=utf8, |
| 714 |
% margin |
| 715 |
xleftmargin=\parindent, |
| 716 |
% numbers |
| 717 |
numbers=left, |
| 718 |
numbersep=5pt, |
| 719 |
numberstyle=\ttfamily\footnotesize\color{OSTGray}, |
| 720 |
% background |
| 721 |
backgroundcolor=\color{white}, |
| 722 |
showstringspaces=false, |
| 723 |
% default language |
| 724 |
language=TeX, |
| 725 |
% break long lines, and show an arrow where the line was broken |
| 726 |
breaklines=true, |
| 727 |
postbreak=\mbox{\textcolor{OSTDarkBlue}{$\hookrightarrow$}\space}, |
| 728 |
% font |
| 729 |
basicstyle=\ttfamily\small, |
| 730 |
identifierstyle=\color{OSTBlack}, |
| 731 |
keywordstyle=\color{OSTBlue}, |
| 732 |
commentstyle=\color{OSTGray}, |
| 733 |
stringstyle=\color{OSTBlackberry}, |
| 734 |
} |
| 735 |
% \end{macrocode} |
| 736 |
% Then we set this style to be default. |
| 737 |
% \begin{macrocode} |
| 738 |
\lstset{style=ost-base, escapechar=`} |
| 739 |
% \end{macrocode} |
| 740 |
% |
| 741 |
% ^^A\begin{thebibliography}{1} |
| 742 |
% ^^A\bibitem[hbadertscher-ostcolors] OST Colorscheme. |
| 743 |
% ^^A\url{https://github.com/HBadertscher/OSTReport/blob/master/header/OSTColors.sty} |
| 744 |
% ^^A\end{thebibliography} |
| 745 |
% \Finale |
| 746 |
\endinput |
| 747 |
% vim:ts=4 sw=4 et spell spelllang=en ft=tex: |