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.

234 wiersze
6.3KB

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