Für Vorlesungen, bitte die Webseite verwenden. https://flavigny.de/lecture
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

211 рядки
6.1KB

  1. \ProvidesClass{arbeit}
  2. \LoadClass[a4paper, titlepage]{article}
  3. \RequirePackage[utf8]{inputenc}
  4. \RequirePackage[T1]{fontenc}
  5. \RequirePackage{textcomp}
  6. \RequirePackage[german, english]{babel}
  7. \RequirePackage{amsmath, amssymb, amsthm}
  8. \RequirePackage{mdframed}
  9. \RequirePackage{fancyhdr}
  10. \RequirePackage{geometry}
  11. \RequirePackage{import}
  12. \RequirePackage{pdfpages}
  13. \RequirePackage{transparent}
  14. \RequirePackage{xcolor}
  15. \RequirePackage{array}
  16. \RequirePackage[shortlabels]{enumitem}
  17. \RequirePackage{tikz}
  18. \RequirePackage{pgfplots}
  19. \RequirePackage[nobottomtitles]{titlesec}
  20. \RequirePackage{listings}
  21. \RequirePackage{mathtools}
  22. \RequirePackage{forloop}
  23. \RequirePackage{totcount}
  24. \RequirePackage{calc}
  25. \RequirePackage{wasysym}
  26. \RequirePackage{environ}
  27. \usetikzlibrary{quotes, angles}
  28. \pgfplotsset{
  29. compat=1.15,
  30. default 2d plot/.style={%
  31. grid=both,
  32. minor tick num=4,
  33. grid style={line width=.1pt, draw=gray!10},
  34. major grid style={line width=.2pt,draw=gray!50},
  35. axis lines=middle,
  36. enlargelimits={abs=0.2}
  37. },
  38. }
  39. % PAGE GEOMETRY
  40. \geometry{
  41. bottom=35mm
  42. }
  43. % PARAGRAPH no indent but skip
  44. %\setlength{\parskip}{3mm}
  45. %\setlength{\parindent}{0mm}
  46. \newtheorem{satz}{Satz}[section]
  47. \newtheorem{lemma}[satz]{Lemma}
  48. \newtheorem{korollar}[satz]{Korollar}
  49. \theoremstyle{definition}
  50. \newtheorem{definition}[satz]{Definition}
  51. \newtheorem*{definition*}{Definition}
  52. %\theoremstyle{definition}
  53. %\newmdtheoremenv{satz}{Satz}[section]
  54. %\newmdtheoremenv{lemma}[satz]{Lemma}
  55. %\newmdtheoremenv{korollar}[satz]{Korollar}
  56. %\newmdtheoremenv{definition}[satz]{Definition}
  57. \newtheorem{bsp}[satz]{Beispiel}
  58. \newtheorem{bem}[satz]{Bemerkung}
  59. \newtheorem{aufgabe}{Aufgabe}
  60. % enable aufgaben counting
  61. \regtotcounter{aufgabe}
  62. % temporary calculation counter
  63. \newcounter{var}
  64. \newcommand{\N}{\mathbb{N}}
  65. \newcommand{\R}{\mathbb{R}}
  66. \newcommand{\Z}{\mathbb{Z}}
  67. \newcommand{\Q}{\mathbb{Q}}
  68. \newcommand{\C}{\mathbb{C}}
  69. % HEADERS
  70. \pagestyle{headings}
  71. \newcommand{\incfig}[1]{%
  72. \def\svgwidth{\columnwidth}
  73. \import{./figures/}{#1.pdf_tex}
  74. }
  75. \pdfsuppresswarningpagegroup=1
  76. % code listings, define style
  77. \lstdefinestyle{mystyle}{
  78. commentstyle=\color{gray},
  79. keywordstyle=\color{blue},
  80. numberstyle=\tiny\color{gray},
  81. stringstyle=\color{black},
  82. basicstyle=\ttfamily\footnotesize,
  83. breakatwhitespace=false,
  84. breaklines=true,
  85. captionpos=b,
  86. keepspaces=true,
  87. numbers=left,
  88. numbersep=5pt,
  89. showspaces=false,
  90. showstringspaces=false,
  91. showtabs=false,
  92. tabsize=2
  93. }
  94. % activate my colour style
  95. \lstset{style=mystyle}
  96. % better stackrel
  97. \let\oldstackrel\stackrel
  98. \renewcommand{\stackrel}[2]{%
  99. \oldstackrel{\mathclap{#1}}{#2}
  100. }%
  101. % integral d sign
  102. \makeatletter \renewcommand\d[2][]{\ensuremath{%
  103. \,\mathrm{d}^{#1}#2\@ifnextchar^{}{\@ifnextchar\d{}{\,}}}}
  104. \makeatother
  105. % contradiction
  106. \newcommand{\contr}{\text{\Large\lightning}}
  107. % disjoint unions: provides cupdot and bigcupdot
  108. \makeatletter
  109. \def\moverlay{\mathpalette\mov@rlay}
  110. \def\mov@rlay#1#2{\leavevmode\vtop{%
  111. \baselineskip\z@skip \lineskiplimit-\maxdimen
  112. \ialign{\hfil$\m@th#1##$\hfil\cr#2\crcr}}}
  113. \newcommand{\charfusion}[3][\mathord]{
  114. #1{\ifx#1\mathop\vphantom{#2}\fi
  115. \mathpalette\mov@rlay{#2\cr#3}
  116. }
  117. \ifx#1\mathop\expandafter\displaylimits\fi}
  118. \makeatother
  119. \newcommand{\cupdot}{\charfusion[\mathbin]{\cup}{\cdot}}
  120. \newcommand{\bigcupdot}{\charfusion[\mathop]{\bigcup}{\cdot}}
  121. \ExplSyntaxOn
  122. % S-tackrelcompatible ALIGN environment
  123. % some might also call it the S-uper ALIGN environment
  124. % uses regular expressions to calculate the widest stackrel
  125. % to put additional padding on both sides of relation symbols
  126. \NewEnviron{salign}
  127. {
  128. \begin{align}
  129. \lec_insert_padding:V \BODY
  130. \end{align}
  131. }
  132. % starred version that does no equation numbering
  133. \NewEnviron{salign*}
  134. {
  135. \begin{align*}
  136. \lec_insert_padding:V \BODY
  137. \end{align*}
  138. }
  139. % some helper variables
  140. \tl_new:N \l__lec_text_tl
  141. \seq_new:N \l_lec_stackrels_seq
  142. \int_new:N \l_stackrel_count_int
  143. \int_new:N \l_idx_int
  144. \box_new:N \l_tmp_box
  145. \dim_new:N \l_tmp_dim_a
  146. \dim_new:N \l_tmp_dim_b
  147. \dim_new:N \l_tmp_dim_needed
  148. % function to insert padding according to widest stackrel
  149. \cs_new_protected:Nn \lec_insert_padding:n
  150. {
  151. \tl_set:Nn \l__lec_text_tl { #1 }
  152. % get all stackrels in this align environment
  153. \regex_extract_all:nnN { \c{stackrel}{(.*?)}{(.*?)} } { #1 } \l_lec_stackrels_seq
  154. % get number of stackrels
  155. \int_set:Nn \l_stackrel_count_int { \seq_count:N \l_lec_stackrels_seq }
  156. \int_set:Nn \l_idx_int { 1 }
  157. \dim_set:Nn \l_tmp_dim_needed { 0pt }
  158. % iterate over stackrels
  159. \int_while_do:nn { \l_idx_int <= \l_stackrel_count_int }
  160. {
  161. % calculate width of text
  162. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 1 }$}
  163. \dim_set:Nn \l_tmp_dim_a {\box_wd:N \l_tmp_box}
  164. % calculate width of relation symbol
  165. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 2 }$}
  166. \dim_set:Nn \l_tmp_dim_b {\box_wd:N \l_tmp_box}
  167. % check if 0.5*(a-b) > minimum padding, if yes updated minimum padding
  168. \dim_compare:nNnTF
  169. { 1pt * \dim_ratio:nn { \l_tmp_dim_a - \l_tmp_dim_b } { 2pt } } > { \l_tmp_dim_needed }
  170. { \dim_set:Nn \l_tmp_dim_needed { 1pt * \dim_ratio:nn { \l_tmp_dim_a - \l_tmp_dim_b } { 2pt } } }
  171. { }
  172. \quad
  173. % increment list index by three, as every stackrel produces three list entries
  174. \int_incr:N \l_idx_int
  175. \int_incr:N \l_idx_int
  176. \int_incr:N \l_idx_int
  177. }
  178. % replace all relations with align characters (&) and add the needed padding
  179. \regex_replace_all:nnN
  180. { (<&|&<|\c{iff}&|&\c{iff}|\c{impliedby}&|&\c{impliedby}|\c{implies}&|&\c{implies}|\c{approx}&|&\c{approx}|\c{equiv}&|&\c{equiv}|=&|&=|\c{le}&|&\c{le}|\c{ge}&|&\c{ge}|&\c{stackrel}{.*?}{.*?}|\c{stackrel}{.*?}{.*?}&|&\c{neq}|\c{neq}&|\c{simeq}&|&\c{simeq}) }
  181. { \c{kern} \u{l_tmp_dim_needed} \1 \c{kern} \u{l_tmp_dim_needed} }
  182. \l__lec_text_tl
  183. \l__lec_text_tl
  184. }
  185. \cs_generate_variant:Nn \lec_insert_padding:n { V }
  186. \ExplSyntaxOff