Für Vorlesungen, bitte die Webseite verwenden. https://flavigny.de/lecture
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

223 wiersze
6.0KB

  1. \ProvidesClass{lecture}
  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. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
  29. \DeclareOption{uebung}{
  30. \makeatletter
  31. \lhead{\@title}
  32. \rhead{\@author}
  33. \makeatother
  34. }
  35. \ProcessOptions\relax
  36. % PAGE GEOMETRY
  37. \geometry{
  38. left=15mm,
  39. right=40mm,
  40. top=20mm,
  41. bottom=20mm
  42. }
  43. % PARAGRAPH no indent but skip
  44. \setlength{\parskip}{3mm}
  45. \setlength{\parindent}{0mm}
  46. \theoremstyle{definition}
  47. \newmdtheoremenv{satz}{Satz}[section]
  48. \newmdtheoremenv{lemma}[satz]{Lemma}
  49. \newmdtheoremenv{korrolar}[satz]{Korrolar}
  50. \newmdtheoremenv{definition}[satz]{Definition}
  51. \newtheorem{bsp}[satz]{Beispiel}
  52. \newtheorem{bem}[satz]{Bemerkung}
  53. \newtheorem{aufgabe}{Aufgabe}
  54. % enable aufgaben counting
  55. \regtotcounter{aufgabe}
  56. % temporary calculation counter
  57. \newcounter{var}
  58. \newcommand{\N}{\mathbb{N}}
  59. \newcommand{\R}{\mathbb{R}}
  60. \newcommand{\Z}{\mathbb{Z}}
  61. \newcommand{\Q}{\mathbb{Q}}
  62. \newcommand{\C}{\mathbb{C}}
  63. % HEADERS
  64. \pagestyle{fancy}
  65. \newcommand{\incfig}[1]{%
  66. \def\svgwidth{\columnwidth}
  67. \import{./figures/}{#1.pdf_tex}
  68. }
  69. \pdfsuppresswarningpagegroup=1
  70. % horizontal rule
  71. \newcommand\hr{
  72. \noindent\rule[0.5ex]{\linewidth}{0.5pt}
  73. }
  74. % punkte tabelle
  75. \newcommand{\punkte}[1][1]{
  76. \newcounter{k}
  77. \setcounter{k}{#1}
  78. \@punkten{\value{k}}{\totvalue{aufgabe}}
  79. \setcounter{k}{#1-1}
  80. \setcounter{aufgabe}{\value{k}}
  81. \vspace{5mm}
  82. }
  83. \def\@punkten#1#2{
  84. \newcounter{n}
  85. % create a temporary calculation counter
  86. \setcounter{var}{#2-#1+1}
  87. \begin{tabular}{|c|*{\value{var}}{m{1cm}|}m{1cm}|@{}m{0cm}@{}}
  88. \hline
  89. Aufgabe
  90. \forloop{n}{#1}{\not{\value{n} > #2}}{
  91. & \centering A\then
  92. }
  93. & \centering $\sum$ & \\[5mm] \hline
  94. Punkte
  95. \forloop{n}{#1}{\not{\value{n} > #2}}{
  96. &
  97. }
  98. & & \\[5mm] \hline
  99. \end{tabular}
  100. }
  101. % code listings, define style
  102. \lstdefinestyle{mystyle}{
  103. commentstyle=\color{gray},
  104. keywordstyle=\color{blue},
  105. numberstyle=\tiny\color{gray},
  106. stringstyle=\color{black},
  107. basicstyle=\ttfamily\footnotesize,
  108. breakatwhitespace=false,
  109. breaklines=true,
  110. captionpos=b,
  111. keepspaces=true,
  112. numbers=left,
  113. numbersep=5pt,
  114. showspaces=false,
  115. showstringspaces=false,
  116. showtabs=false,
  117. tabsize=2
  118. }
  119. % activate my colour style
  120. \lstset{style=mystyle}
  121. % better stackrel
  122. \let\oldstackrel\stackrel
  123. \renewcommand{\stackrel}[2]{%
  124. \oldstackrel{\mathclap{#1}}{#2}
  125. }%
  126. % integral d sign
  127. \makeatletter \renewcommand\d[2][]{\ensuremath{%
  128. \,\mathrm{d}^{#1}#2\@ifnextchar^{}{\@ifnextchar\d{}{\,}}}}
  129. \makeatother
  130. % contradiction
  131. \newcommand{\contr}{\text{\Large\lightning}}
  132. \ExplSyntaxOn
  133. % S-tackrelcompatible ALIGN environment
  134. % some might also call it the S-uper ALIGN environment
  135. % uses regular expressions to calculate the widest stackrel
  136. % to put additional padding on both sides of relation symbols
  137. \NewEnviron{salign}
  138. {
  139. \begin{align}
  140. \lec_insert_padding:V \BODY
  141. \end{align}
  142. }
  143. % starred version that does no equation numbering
  144. \NewEnviron{salign*}
  145. {
  146. \begin{align*}
  147. \lec_insert_padding:V \BODY
  148. \end{align*}
  149. }
  150. % some helper variables
  151. \tl_new:N \l__lec_text_tl
  152. \seq_new:N \l_lec_stackrels_seq
  153. \int_new:N \l_stackrel_count_int
  154. \int_new:N \l_idx_int
  155. \box_new:N \l_tmp_box
  156. \dim_new:N \l_tmp_dim_a
  157. \dim_new:N \l_tmp_dim_b
  158. \dim_new:N \l_tmp_dim_needed
  159. % function to insert padding according to widest stackrel
  160. \cs_new_protected:Nn \lec_insert_padding:n
  161. {
  162. \tl_set:Nn \l__lec_text_tl { #1 }
  163. % get all stackrels in this align environment
  164. \regex_extract_all:nnN { \c{stackrel}{(.*?)}{(.*?)} } { #1 } \l_lec_stackrels_seq
  165. % get number of stackrels
  166. \int_set:Nn \l_stackrel_count_int { \seq_count:N \l_lec_stackrels_seq }
  167. \int_set:Nn \l_idx_int { 1 }
  168. \dim_set:Nn \l_tmp_dim_needed { 0pt }
  169. % iterate over stackrels
  170. \int_while_do:nn { \l_idx_int <= \l_stackrel_count_int }
  171. {
  172. % calculate width of text
  173. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 1 }$}
  174. \dim_set:Nn \l_tmp_dim_a {\box_wd:N \l_tmp_box}
  175. % calculate width of relation symbol
  176. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 2 }$}
  177. \dim_set:Nn \l_tmp_dim_b {\box_wd:N \l_tmp_box}
  178. % check if 0.5*(a-b) > minimum padding, if yes updated minimum padding
  179. \dim_compare:nNnTF
  180. { 1pt * \dim_ratio:nn { \l_tmp_dim_a - \l_tmp_dim_b } { 2pt } } > { \l_tmp_dim_needed }
  181. { \dim_set:Nn \l_tmp_dim_needed { 1pt * \dim_ratio:nn { \l_tmp_dim_a - \l_tmp_dim_b } { 2pt } } }
  182. { }
  183. \quad
  184. % increment list index by three, as every stackrel produces three list entries
  185. \int_incr:N \l_idx_int
  186. \int_incr:N \l_idx_int
  187. \int_incr:N \l_idx_int
  188. }
  189. % replace all relations with align characters (&) and add the needed padding
  190. \regex_replace_all:nnN
  191. { (\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}&) }
  192. { \c{kern} \u{l_tmp_dim_needed} \1 \c{kern} \u{l_tmp_dim_needed} }
  193. \l__lec_text_tl
  194. \l__lec_text_tl
  195. }
  196. \cs_generate_variant:Nn \lec_insert_padding:n { V }
  197. \ExplSyntaxOff