You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

scientific.sty 10.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. %
  2. % latex package with useful macros for scientific documents
  3. %
  4. % Authors: Emanuel Regnath, Martin Zellner
  5. % Contact: info@latex4ei.de
  6. % Version: 1.1
  7. % License: TBD
  8. %
  9. % © 2011-2019, LaTeX4EI
  10. \NeedsTeXFormat{LaTeX2e}
  11. \ProvidesPackage{scientific}[2015/03/30 Scientific Macros for LaTeX4EI]
  12. % ======================================================================
  13. % Basic
  14. % ======================================================================
  15. % Identify Compiler
  16. \RequirePackage{ifxetex}
  17. \ifxetex%
  18. \relax
  19. \else%
  20. % load following packages if and only if compiler is pdflatex
  21. \fi
  22. % load packages, order matter
  23. \RequirePackage{amsmath} % math symbols and \DeclareMathOperator
  24. \RequirePackage{esint} % more integral symbols
  25. %\RequirePackage{accents} % accents such as \vec and \ddot
  26. % additional packages
  27. \RequirePackage{amssymb} % additional math
  28. % save old commands
  29. \let\oldvec = \vec
  30. \let\olddot = \dot
  31. \let\diameter = \O
  32. % formating indices
  33. \newcommand{\ir}[1]{\sf #1} % index roman
  34. % differential delta
  35. \newcommand{\diff}{\mathop{}\!\mathrm{\vphantom( d}}
  36. % ======================================================================
  37. % SI Units
  38. % ======================================================================
  39. \RequirePackage{siunitx} % SI package
  40. \sisetup{per-mode=reciprocal} % use ^-1 instead of fractals
  41. \sisetup{sticky-per=true} % every unit behind "per" is reciprocal
  42. \newcommand{\unitof}[1]{\ensuremath{\left[#1\right]}} % unit of
  43. \DeclareSIUnit{\degree}{deg}
  44. % ======================================================================
  45. % Vectors and Matrices
  46. % ======================================================================
  47. % Define \utilde: from package undertilde.sty
  48. \newlength\knuthian@fdfive
  49. \def\mathpal@save#1{\let\was@math@style=#1\relax}
  50. \def\utilde#1{\mathpalette\mathpal@save
  51. {\setbox124=\hbox{$\was@math@style#1$}%
  52. \setbox125=\hbox{$\fam=3\global\knuthian@fdfive=\fontdimen5\font$}
  53. \setbox125=\hbox{$\widetilde{\vrule height 0pt depth 0pt width \wd124}$}%
  54. \baselineskip=1pt\relax
  55. \vtop{\copy124\copy125\vskip -\knuthian@fdfive}}}
  56. % vectors and matrices
  57. \newcommand{\ma}[1]{\ensuremath{\utilde{\boldsymbol {#1}}}} % Matrixsymbol
  58. \newcommand{\mat}[1]{\ensuremath{\arraycolsep=0.5em \begin{bmatrix} #1 \end{bmatrix}}} % Matrix
  59. \newcommand{\tma}[3]{\ensuremath{{}_{#1} \ma #2_#3 }} % Trafomatrix
  60. %\renewcommand{\vec}[1]{\ensuremath{\underline{\boldsymbol \begingroup#1\endgroup}}} % Vector bold and underlined
  61. \newcommand{\vect}[1]{\ensuremath{\begin{pmatrix} #1 \end{pmatrix}}} % Vector
  62. \newcommand{\mvect}[1]{\ensuremath{\left.\begin{matrix} #1 \end{matrix}\right]}}% Matrixvector
  63. \newcommand{\tensor}[1]{\ensuremath{\underline{\underline{\boldsymbol #1}}}} % Tensor
  64. \DeclareMathOperator{\diag}{diag} % diagonal matrix
  65. % vector operations
  66. \newcommand{\norm}[1]{\ensuremath{\left\|#1\right\|}} % Norm
  67. \DeclareMathOperator{\Sp}{Sp} % Spur (german for trace \tr)
  68. % ======================================================================
  69. % Misc
  70. % ======================================================================
  71. % basic math
  72. \providecommand{\hateq}{\ensuremath{\stackrel{\wedge}{=}}} % Entspricht
  73. \providecommand{\floor}[1]{\ensuremath{\left\lfloor#1\right\rfloor}} % Abrunden
  74. \providecommand{\ceil}[1]{\ensuremath{\left\lceil {#1} \right\rceil}} % Aufrunden
  75. \providecommand{\sprod}[2]{\ensuremath{\left\langle #1, #2 \right\rangle }} % scalar product
  76. \providecommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}} % absolute value)
  77. \DeclareMathOperator{\const}{const.} % constant
  78. \DeclareMathOperator{\sgn}{sgn} % signum
  79. \DeclareMathOperator{\ld}{ld} % log_2
  80. \DeclareMathOperator{\ggT}{ggT} % ggT (german for gcd)
  81. % chemistry
  82. \newcommand{\chem}[1]{\ensuremath{\displaystyle{\mathrm{#1}}}} % chemistry with \chem (simple)
  83. \RequirePackage[version=3]{mhchem} % chemistry with \ce (advanced)
  84. \newcommand{\rom}[1]{\ensuremath{\underline{\overline{\textsc{#1}}}}} % roman numbers
  85. % ======================================================================
  86. % Important Constants
  87. % ======================================================================
  88. % math
  89. \providecommand{\e}{\mathrm{e}}
  90. % physical
  91. \providecommand{\kB}{\ensuremath{\mathrm{k}_{\text{B}}}} % Boltzman
  92. \providecommand{\Rgas}{\ensuremath{\mathrm{R}}} % Allg. Gaskonstante
  93. \providecommand{\NA}{\ensuremath{\mathrm{N}_{\text{A}}}} % Avogadro
  94. % ======================================================================
  95. % Complex and Hyper-complex Numbers
  96. % ======================================================================
  97. \newcommand{\cx}[1]{\boldsymbol{#1}} % complex number
  98. \newcommand{\cxc}[1]{\ensuremath{\boldsymbol #1^*}} % Konjugiert complex number
  99. \newcommand{\hx}[1]{\ensuremath{\mathfrak #1}} % hyper-complex number
  100. \renewcommand{\i}{\ensuremath{\mathrm{i}}} % imaginary unit
  101. \renewcommand{\j}{\ensuremath{\mathrm{j}}} % imaginary unit
  102. \renewcommand{\k}{\ensuremath{\mathrm{k}}} % imaginary unit
  103. % real and imaginary part
  104. \renewcommand{\Re}[1]{\ensuremath{\operatorname{Re}\left\{#1\right\}}}
  105. \renewcommand{\Im}[1]{\ensuremath{\operatorname{Im}\left\{#1\right\}}}
  106. % ======================================================================
  107. % Sets
  108. % ======================================================================
  109. % define sets
  110. \newcommand{\iset}[2]{\ensuremath{\bigl\{ \bigl. #1 \, \bigr| \, #2 \bigr\}}} % intensional set
  111. \newcommand{\eset}[1]{\ensuremath{\bigl\{#1\bigr\}}} % extensional set
  112. % abbreviations for important sets
  113. \DeclareMathOperator{\N}{\mathbb N} % Natürliche Zahlen
  114. \DeclareMathOperator{\R}{\mathbb R} % Reele Zahlen
  115. \DeclareMathOperator{\C}{\mathbb C} % Komplexe Zahlen
  116. \DeclareMathOperator{\K}{\mathbb K} % Reele oder komplexe Zahlen
  117. \def\B{\operatorname{\mathbb B}} % Binäre Zahlen 1,0
  118. \def\O{\operatorname{\mathcal O}} % Landau
  119. % set operations
  120. \let\cupplus\uplus % Vereinigunsmenge bzw. OR
  121. \newlength{\caplength}
  122. \setlength{\caplength}{\widthof{$\cap$}}
  123. \DeclareMathOperator{\capdot}{\cap\hspace{-0.7\caplength}\text{\textperiodcentered}\hspace{0.4\caplength}} % Schnittmenge bzw. AND
  124. % topology
  125. \newcommand{\interior}[1]{\ensuremath{\overset{{}_\circ}{#1}}} % Das Innere
  126. % ======================================================================
  127. % Frequency Transformations (Fourier, Laplace, etc.)
  128. % ======================================================================
  129. % Define symbol for Transformations. Source: trfsigns.sty
  130. \newcommand{\ftsymbol}{\mbox{\setlength{\unitlength}{0.1em}
  131. \begin{picture}(25,4)
  132. \put(3,3){\circle{4}} % empty
  133. \put(5,3){\line(1,0){13}}
  134. \put(19,3){\circle*{4}} % filled
  135. \end{picture}}}
  136. % Define Transformations
  137. \DeclareMathOperator{\T}{\overset{\scriptscriptstyle\mathcal{}}{\ftsymbol}} % General Transformation
  138. \DeclareMathOperator{\FT}{\overset{\scriptscriptstyle\mathcal{F}}{\ftsymbol}} % Fourier Transform
  139. \DeclareMathOperator{\LT}{\overset{\scriptscriptstyle\mathcal{L}}{\ftsymbol}} % Laplace Transform
  140. \DeclareMathOperator{\DFT}{\overset{\scriptscriptstyle\mathcal{DF}}{\ftsymbol}} % Discrete Fourier Transform
  141. \DeclareMathOperator{\DTFT}{\overset{\scriptscriptstyle\mathcal{DTF}}{\ftsymbol}} % Discrete Time Fourier Transform
  142. \DeclareMathOperator{\ZT}{\overset{\scriptscriptstyle\mathcal{Z}}{\ftsymbol}} % Z-Transform
  143. % ======================================================================
  144. % Differential Geometry
  145. % ======================================================================
  146. \DeclareMathOperator{\grad}{grad} % Gradient
  147. \def\div{\operatorname{div}} % Divergence
  148. \DeclareMathOperator{\rot}{rot} % rotation
  149. \DeclareMathOperator{\lpo}{\Delta} % laplace operator
  150. \DeclareMathOperator{\laplace}{\Delta} % laplace operator
  151. \DeclareMathOperator{\waveop}{\square} % wave operator
  152. % ======================================================================
  153. % Signals
  154. % ======================================================================
  155. \DeclareMathOperator{\dirac}{\ensuremath{\delta}} % Dirac Distribution
  156. \DeclareMathOperator{\heavi}{\ensuremath{\theta}} % Heaviside Step Function
  157. \DeclareMathOperator{\sinc}{sinc} % Sinus Cardinalis
  158. \DeclareMathOperator{\rect}{rect} % Rectangular
  159. \DeclareMathOperator{\tri}{tri} % Triangular
  160. \DeclareMathOperator{\erf}{erf} % Error Function
  161. \DeclareMathOperator{\erfc}{erfc} % Error Function
  162. \providecommand{\SNR}{\mathrm{SNR}} % Signal Noise Ratio
  163. \providecommand{\ACF}{\ensuremath{\varphi}} % autocorrelation function
  164. \providecommand{\PSD}{\ensuremath{\Phi}} % Power-Spectral-Density
  165. % ======================================================================
  166. % Stochastic
  167. % ======================================================================
  168. \renewcommand{\P}{\operatorname{\textsf{P}}} % Wahrscheinlichkeitsmaß
  169. \DeclareMathOperator{\F}{\mathbb F} % Ereignisalgebra
  170. \DeclareMathOperator{\X}{\textsf{\textit{X}}} % Zufallsvariable X
  171. \DeclareMathOperator{\Y}{\textsf{\textit{Y}}} % Zufallsvariable Y
  172. \DeclareMathOperator{\Z}{\textsf{\textit{Z}}} % Zufallsvariable Z
  173. \DeclareMathOperator{\E}{\textsf{E}} % Erwartungswert
  174. \newcommand{\ew}[1]{\textit{E} \left[ #1 \right]} % Erwartungswert (mit Parameter)
  175. \DeclareMathOperator{\Var}{\textsf{Var}} % Varianz
  176. \DeclareMathOperator{\Cov}{\textsf{Cov}} % Kovarianz
  177. % ======================================================================
  178. % Logic
  179. % ======================================================================
  180. \renewcommand{\implies}{\ensuremath{\rightarrow}} % →
  181. \let\limplies\implies
  182. \providecommand{\lequiv}{\ensuremath{\leftrightarrow}} % ↔
  183. \providecommand{\lnand}{\ensuremath{|}}
  184. \providecommand{\lxor}{\ensuremath{\downarrow}}
  185. \providecommand{\ltrue}{w}
  186. \providecommand{\lfalse}{f}
  187. % Ende von \input
  188. \endinput