Für Vorlesungen, bitte die Webseite verwenden. https://flavigny.de/lecture
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

281 Zeilen
8.1KB

  1. \ProvidesClass{lecture}
  2. \LoadClass[a4paper]{book}
  3. \RequirePackage{faktor}
  4. \RequirePackage{xparse}
  5. \RequirePackage{stmaryrd}
  6. \RequirePackage[utf8]{inputenc}
  7. \RequirePackage[T1]{fontenc}
  8. \RequirePackage{textcomp}
  9. \RequirePackage{babel}
  10. \RequirePackage{amsmath, amssymb, amsthm}
  11. \RequirePackage{mdframed}
  12. \RequirePackage{tikz-cd}
  13. \RequirePackage{geometry}
  14. \RequirePackage{import}
  15. \RequirePackage{pdfpages}
  16. \RequirePackage{transparent}
  17. \RequirePackage{xcolor}
  18. \RequirePackage{array}
  19. \RequirePackage[shortlabels]{enumitem}
  20. \RequirePackage{tikz}
  21. \RequirePackage{pgfplots}
  22. \RequirePackage[pagestyles, nobottomtitles]{titlesec}
  23. \RequirePackage{listings}
  24. \RequirePackage{mathtools}
  25. \RequirePackage{forloop}
  26. \RequirePackage{totcount}
  27. \RequirePackage[hidelinks, unicode]{hyperref} %[unicode, hidelinks]{hyperref}
  28. \RequirePackage{bookmark}
  29. \RequirePackage{wasysym}
  30. \RequirePackage{environ}
  31. \RequirePackage{stackrel}
  32. \RequirePackage{subcaption}
  33. \usetikzlibrary{quotes, angles, math}
  34. \pgfplotsset{
  35. compat=1.15,
  36. axis lines = middle,
  37. ticks = none,
  38. %default 2d plot/.style={%
  39. % ticks=none,
  40. % axis lines = middle,
  41. % grid=both,
  42. % minor tick num=4,
  43. % grid style={line width=.1pt, draw=gray!10},
  44. % major grid style={line width=.2pt,draw=gray!50},
  45. % axis lines=middle,
  46. % enlargelimits={abs=0.2}
  47. }
  48. \newcounter{curve}
  49. \NewDocumentCommand{\algebraiccurve}{ O{} O{$#5 = 0$} O{-4:4} O{-4:4} m }{
  50. \addplot[id=curve\arabic{curve}, raw gnuplot, smooth, #1] function{%
  51. f(x,y) = #5;
  52. set xrange [#3];
  53. set yrange [#4];
  54. set view 0,0;
  55. set isosample 1000,1000;
  56. set size square;
  57. set cont base;
  58. set cntrparam levels incre 0,0.1,0;
  59. unset surface;
  60. splot f(x,y)
  61. };
  62. \addlegendentry{#2}
  63. \stepcounter{curve}
  64. }%
  65. %\newcommand{\algebraiccurve}[3][][hi]{%
  66. % %\addlegendentry{#2}
  67. % \stepcounter{curve}
  68. %}%
  69. \geometry{
  70. bottom=35mm
  71. }
  72. %\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
  73. \DeclareOption{uebung}{
  74. \makeatletter
  75. \lhead{\@title}
  76. \rhead{\@author}
  77. \makeatother
  78. }
  79. \ProcessOptions\relax
  80. % PARAGRAPH no indent but skip
  81. %\setlength{\parskip}{3mm}
  82. %\setlength{\parindent}{0mm}
  83. \newtheorem{satz}{Proposition}[chapter]
  84. \newtheorem{theorem}[satz]{Theorem}
  85. \newtheorem{lemma}[satz]{Lemma}
  86. \newtheorem{korollar}[satz]{Corollary}
  87. \theoremstyle{definition}
  88. \newtheorem{definition}[satz]{Definition}
  89. \newtheorem{bsp}[satz]{Example}
  90. \newtheorem{bem}[satz]{Remark}
  91. \newtheorem{aufgabe}[satz]{Exercise}
  92. \counterwithin{figure}{chapter}
  93. % enable aufgaben counting
  94. %\regtotcounter{aufgabe}
  95. \newcommand{\N}{\mathbb{N}}
  96. \newcommand{\R}{\mathbb{R}}
  97. \newcommand{\Z}{\mathbb{Z}}
  98. \newcommand{\Q}{\mathbb{Q}}
  99. \newcommand{\C}{\mathbb{C}}
  100. % I(V(I))
  101. \newcommand{\ivkr}{\mathcal{I}_k(\mathcal{V}_{(k^{(r)})^n}(I))}
  102. % HEADERS
  103. %\newpagestyle{main}[\small]{
  104. % \setheadrule{.55pt}%
  105. % \sethead[\thepage]% even-left
  106. % []% even-center
  107. % [\thechapter~\chaptertitle]% even-right
  108. % {\thesection~\sectiontitle}% odd-left
  109. % {}% odd-center
  110. % {\thepage}% odd-right
  111. %}
  112. %\pagestyle{main}
  113. \newcommand{\incfig}[1]{%
  114. \def\svgwidth{\columnwidth}
  115. \import{./figures/}{#1.pdf_tex}
  116. }
  117. \pdfsuppresswarningpagegroup=1
  118. % horizontal rule
  119. \newcommand\hr{
  120. \noindent\rule[0.5ex]{\linewidth}{0.5pt}
  121. }
  122. % code listings, define style
  123. \lstdefinestyle{mystyle}{
  124. commentstyle=\color{gray},
  125. keywordstyle=\color{blue},
  126. numberstyle=\tiny\color{gray},
  127. stringstyle=\color{black},
  128. basicstyle=\ttfamily\footnotesize,
  129. breakatwhitespace=false,
  130. breaklines=true,
  131. captionpos=b,
  132. keepspaces=true,
  133. numbers=left,
  134. numbersep=5pt,
  135. showspaces=false,
  136. showstringspaces=false,
  137. showtabs=false,
  138. tabsize=2
  139. }
  140. % activate my colour style
  141. \lstset{style=mystyle}
  142. % better stackrel
  143. \let\oldstackrel\stackrel
  144. \renewcommand{\stackrel}[3][]{%
  145. \oldstackrel[\mathclap{#1}]{\mathclap{#2}}{#3}
  146. }%
  147. % integral d sign
  148. \makeatletter \renewcommand\d[2][]{\ensuremath{%
  149. \,\mathrm{d}^{#1}#2\@ifnextchar^{}{\@ifnextchar\d{}{\,}}}}
  150. \makeatother
  151. % remove page before chapters
  152. \let\cleardoublepage=\clearpage
  153. %josua
  154. \newcommand{\norm}[1]{\left\Vert#1\right\Vert}
  155. % contradiction
  156. \newcommand{\contr}{\text{\Large\lightning}}
  157. % people seem to prefer varepsilon over epsilon
  158. \renewcommand{\epsilon}{\varepsilon}
  159. \ExplSyntaxOn
  160. % S-tackrelcompatible ALIGN environment
  161. % some might also call it the S-uper ALIGN environment
  162. % uses regular expressions to calculate the widest stackrel
  163. % to put additional padding on both sides of relation symbols
  164. \NewEnviron{salign}
  165. {
  166. \begin{align}
  167. \lec_insert_padding:V \BODY
  168. \end{align}
  169. }
  170. % starred version that does no equation numbering
  171. \NewEnviron{salign*}
  172. {
  173. \begin{align*}
  174. \lec_insert_padding:V \BODY
  175. \end{align*}
  176. }
  177. % some helper variables
  178. \tl_new:N \l__lec_text_tl
  179. \seq_new:N \l_lec_stackrels_seq
  180. \int_new:N \l_stackrel_count_int
  181. \int_new:N \l_idx_int
  182. \box_new:N \l_tmp_box
  183. \dim_new:N \l_tmp_dim_a
  184. \dim_new:N \l_tmp_dim_b
  185. \dim_new:N \l_tmp_dim_c
  186. \dim_new:N \l_tmp_dim_needed
  187. % function to insert padding according to widest stackrel
  188. \cs_new_protected:Nn \lec_insert_padding:n
  189. {
  190. \tl_set:Nn \l__lec_text_tl { #1 }
  191. % get all stackrels in this align environment
  192. \regex_extract_all:nnN { \c{stackrel}(\[.*?\])?{(.*?)}{(.*?)} } { #1 } \l_lec_stackrels_seq
  193. % get number of stackrels
  194. \int_set:Nn \l_stackrel_count_int { \seq_count:N \l_lec_stackrels_seq }
  195. \int_set:Nn \l_idx_int { 1 }
  196. \dim_set:Nn \l_tmp_dim_needed { 0pt }
  197. % iterate over stackrels
  198. \int_while_do:nn { \l_idx_int <= \l_stackrel_count_int }
  199. {
  200. % calculate width of text
  201. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 1 }$}
  202. \dim_set:Nn \l_tmp_dim_a {\box_wd:N \l_tmp_box}
  203. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 2 }$}
  204. \dim_set:Nn \l_tmp_dim_c {\box_wd:N \l_tmp_box}
  205. \dim_set:Nn \l_tmp_dim_a {\dim_max:nn{ \l_tmp_dim_c} {\l_tmp_dim_a}}
  206. % calculate width of relation symbol
  207. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 3 }$}
  208. \dim_set:Nn \l_tmp_dim_b {\box_wd:N \l_tmp_box}
  209. % check if 0.5*(a-b) > minimum padding, if yes updated minimum padding
  210. \dim_compare:nNnTF
  211. { 1pt * \dim_ratio:nn { \l_tmp_dim_a - \l_tmp_dim_b } { 2pt } } > { \l_tmp_dim_needed }
  212. { \dim_set:Nn \l_tmp_dim_needed { 1pt * \dim_ratio:nn { \l_tmp_dim_a - \l_tmp_dim_b } { 2pt } } }
  213. { }
  214. % increment list index by three, as every stackrel produces three list entries
  215. \int_incr:N \l_idx_int
  216. \int_incr:N \l_idx_int
  217. \int_incr:N \l_idx_int
  218. \int_incr:N \l_idx_int
  219. }
  220. % replace all relations with align characters (&) and add the needed padding
  221. \regex_replace_all:nnN
  222. { (\c{simeq}&|&\c{simeq}|\c{leq}&|&\c{leq}|\c{geq}&|&\c{geq}|\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}&|>&|&>|<&|&<) }
  223. { \c{kern} \u{l_tmp_dim_needed} \1 \c{kern} \u{l_tmp_dim_needed} }
  224. \l__lec_text_tl
  225. \l__lec_text_tl
  226. }
  227. \cs_generate_variant:Nn \lec_insert_padding:n { V }
  228. \NewEnviron{leftright}
  229. {
  230. \lec_replace_parens:V \BODY
  231. }
  232. % function to replace parens with left right
  233. \cs_new_protected:Nn \lec_replace_parens:n
  234. {
  235. \tl_set:Nn \l__lec_text_tl { #1 }
  236. % replace all parantheses with \left( \right)
  237. \regex_replace_all:nnN { \( } { \c{left}( } \l__lec_text_tl
  238. \regex_replace_all:nnN { \) } { \c{right}) } \l__lec_text_tl
  239. \regex_replace_all:nnN { \[ } { \c{left}[ } \l__lec_text_tl
  240. \regex_replace_all:nnN { \] } { \c{right}] } \l__lec_text_tl
  241. \l__lec_text_tl
  242. }
  243. \cs_generate_variant:Nn \lec_replace_parens:n { V }
  244. \ExplSyntaxOff
  245. % add one equation tag to the current line to otherwise unnumbered environment
  246. \newcommand{\tageq}{\stepcounter{equation}\tag{\theequation}}