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

210 рядки
6.0KB

  1. \ProvidesClass{arbeit}
  2. \LoadClass[a4paper, titlepage]{article}
  3. \RequirePackage[utf8]{inputenc}
  4. \RequirePackage[T1]{fontenc}
  5. \RequirePackage{textcomp}
  6. \RequirePackage[german]{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. %\theoremstyle{definition}
  52. %\newmdtheoremenv{satz}{Satz}[section]
  53. %\newmdtheoremenv{lemma}[satz]{Lemma}
  54. %\newmdtheoremenv{korollar}[satz]{Korollar}
  55. %\newmdtheoremenv{definition}[satz]{Definition}
  56. \newtheorem{bsp}[satz]{Beispiel}
  57. \newtheorem{bem}[satz]{Bemerkung}
  58. \newtheorem{aufgabe}{Aufgabe}
  59. % enable aufgaben counting
  60. \regtotcounter{aufgabe}
  61. % temporary calculation counter
  62. \newcounter{var}
  63. \newcommand{\N}{\mathbb{N}}
  64. \newcommand{\R}{\mathbb{R}}
  65. \newcommand{\Z}{\mathbb{Z}}
  66. \newcommand{\Q}{\mathbb{Q}}
  67. \newcommand{\C}{\mathbb{C}}
  68. % HEADERS
  69. \pagestyle{fancy}
  70. \newcommand{\incfig}[1]{%
  71. \def\svgwidth{\columnwidth}
  72. \import{./figures/}{#1.pdf_tex}
  73. }
  74. \pdfsuppresswarningpagegroup=1
  75. % code listings, define style
  76. \lstdefinestyle{mystyle}{
  77. commentstyle=\color{gray},
  78. keywordstyle=\color{blue},
  79. numberstyle=\tiny\color{gray},
  80. stringstyle=\color{black},
  81. basicstyle=\ttfamily\footnotesize,
  82. breakatwhitespace=false,
  83. breaklines=true,
  84. captionpos=b,
  85. keepspaces=true,
  86. numbers=left,
  87. numbersep=5pt,
  88. showspaces=false,
  89. showstringspaces=false,
  90. showtabs=false,
  91. tabsize=2
  92. }
  93. % activate my colour style
  94. \lstset{style=mystyle}
  95. % better stackrel
  96. \let\oldstackrel\stackrel
  97. \renewcommand{\stackrel}[2]{%
  98. \oldstackrel{\mathclap{#1}}{#2}
  99. }%
  100. % integral d sign
  101. \makeatletter \renewcommand\d[2][]{\ensuremath{%
  102. \,\mathrm{d}^{#1}#2\@ifnextchar^{}{\@ifnextchar\d{}{\,}}}}
  103. \makeatother
  104. % contradiction
  105. \newcommand{\contr}{\text{\Large\lightning}}
  106. % disjoint unions: provides cupdot and bigcupdot
  107. \makeatletter
  108. \def\moverlay{\mathpalette\mov@rlay}
  109. \def\mov@rlay#1#2{\leavevmode\vtop{%
  110. \baselineskip\z@skip \lineskiplimit-\maxdimen
  111. \ialign{\hfil$\m@th#1##$\hfil\cr#2\crcr}}}
  112. \newcommand{\charfusion}[3][\mathord]{
  113. #1{\ifx#1\mathop\vphantom{#2}\fi
  114. \mathpalette\mov@rlay{#2\cr#3}
  115. }
  116. \ifx#1\mathop\expandafter\displaylimits\fi}
  117. \makeatother
  118. \newcommand{\cupdot}{\charfusion[\mathbin]{\cup}{\cdot}}
  119. \newcommand{\bigcupdot}{\charfusion[\mathop]{\bigcup}{\cdot}}
  120. \ExplSyntaxOn
  121. % S-tackrelcompatible ALIGN environment
  122. % some might also call it the S-uper ALIGN environment
  123. % uses regular expressions to calculate the widest stackrel
  124. % to put additional padding on both sides of relation symbols
  125. \NewEnviron{salign}
  126. {
  127. \begin{align}
  128. \lec_insert_padding:V \BODY
  129. \end{align}
  130. }
  131. % starred version that does no equation numbering
  132. \NewEnviron{salign*}
  133. {
  134. \begin{align*}
  135. \lec_insert_padding:V \BODY
  136. \end{align*}
  137. }
  138. % some helper variables
  139. \tl_new:N \l__lec_text_tl
  140. \seq_new:N \l_lec_stackrels_seq
  141. \int_new:N \l_stackrel_count_int
  142. \int_new:N \l_idx_int
  143. \box_new:N \l_tmp_box
  144. \dim_new:N \l_tmp_dim_a
  145. \dim_new:N \l_tmp_dim_b
  146. \dim_new:N \l_tmp_dim_needed
  147. % function to insert padding according to widest stackrel
  148. \cs_new_protected:Nn \lec_insert_padding:n
  149. {
  150. \tl_set:Nn \l__lec_text_tl { #1 }
  151. % get all stackrels in this align environment
  152. \regex_extract_all:nnN { \c{stackrel}{(.*?)}{(.*?)} } { #1 } \l_lec_stackrels_seq
  153. % get number of stackrels
  154. \int_set:Nn \l_stackrel_count_int { \seq_count:N \l_lec_stackrels_seq }
  155. \int_set:Nn \l_idx_int { 1 }
  156. \dim_set:Nn \l_tmp_dim_needed { 0pt }
  157. % iterate over stackrels
  158. \int_while_do:nn { \l_idx_int <= \l_stackrel_count_int }
  159. {
  160. % calculate width of text
  161. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 1 }$}
  162. \dim_set:Nn \l_tmp_dim_a {\box_wd:N \l_tmp_box}
  163. % calculate width of relation symbol
  164. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 2 }$}
  165. \dim_set:Nn \l_tmp_dim_b {\box_wd:N \l_tmp_box}
  166. % check if 0.5*(a-b) > minimum padding, if yes updated minimum padding
  167. \dim_compare:nNnTF
  168. { 1pt * \dim_ratio:nn { \l_tmp_dim_a - \l_tmp_dim_b } { 2pt } } > { \l_tmp_dim_needed }
  169. { \dim_set:Nn \l_tmp_dim_needed { 1pt * \dim_ratio:nn { \l_tmp_dim_a - \l_tmp_dim_b } { 2pt } } }
  170. { }
  171. \quad
  172. % increment list index by three, as every stackrel produces three list entries
  173. \int_incr:N \l_idx_int
  174. \int_incr:N \l_idx_int
  175. \int_incr:N \l_idx_int
  176. }
  177. % replace all relations with align characters (&) and add the needed padding
  178. \regex_replace_all:nnN
  179. { (<&|&<|\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}&) }
  180. { \c{kern} \u{l_tmp_dim_needed} \1 \c{kern} \u{l_tmp_dim_needed} }
  181. \l__lec_text_tl
  182. \l__lec_text_tl
  183. }
  184. \cs_generate_variant:Nn \lec_insert_padding:n { V }
  185. \ExplSyntaxOff