For reading the lecture notes, please head to https://merten.dev/lecture/pdf/groupschemes.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

285 lignes
8.2KB

  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*{bem*}{Remark}
  92. \newtheorem{aufgabe}[satz]{Exercise}
  93. \counterwithin{figure}{chapter}
  94. % enable aufgaben counting
  95. %\regtotcounter{aufgabe}
  96. \newcommand{\N}{\mathbb{N}}
  97. \newcommand{\R}{\mathbb{R}}
  98. \newcommand{\Z}{\mathbb{Z}}
  99. \newcommand{\Q}{\mathbb{Q}}
  100. \newcommand{\C}{\mathbb{C}}
  101. % I(V(I))
  102. \newcommand{\ivkr}{\mathcal{I}_k(\mathcal{V}_{(k^{(r)})^n}(I))}
  103. % HEADERS
  104. %\newpagestyle{main}[\small]{
  105. % \setheadrule{.55pt}%
  106. % \sethead[\thepage]% even-left
  107. % []% even-center
  108. % [\thechapter~\chaptertitle]% even-right
  109. % {\thesection~\sectiontitle}% odd-left
  110. % {}% odd-center
  111. % {\thepage}% odd-right
  112. %}
  113. %\pagestyle{main}
  114. \newcommand{\incfig}[1]{%
  115. \def\svgwidth{\columnwidth}
  116. \import{./figures/}{#1.pdf_tex}
  117. }
  118. \pdfsuppresswarningpagegroup=1
  119. % horizontal rule
  120. \newcommand\hr{
  121. \noindent\rule[0.5ex]{\linewidth}{0.5pt}
  122. }
  123. % code listings, define style
  124. \lstdefinestyle{mystyle}{
  125. commentstyle=\color{gray},
  126. keywordstyle=\color{blue},
  127. numberstyle=\tiny\color{gray},
  128. stringstyle=\color{black},
  129. basicstyle=\ttfamily\footnotesize,
  130. breakatwhitespace=false,
  131. breaklines=true,
  132. captionpos=b,
  133. keepspaces=true,
  134. numbers=left,
  135. numbersep=5pt,
  136. showspaces=false,
  137. showstringspaces=false,
  138. showtabs=false,
  139. tabsize=2
  140. }
  141. % activate my colour style
  142. \lstset{style=mystyle}
  143. % better stackrel
  144. \let\oldstackrel\stackrel
  145. \renewcommand{\stackrel}[3][]{%
  146. \oldstackrel[\mathclap{#1}]{\mathclap{#2}}{#3}
  147. }%
  148. % integral d sign
  149. \makeatletter \renewcommand\d[2][]{\ensuremath{%
  150. \,\mathrm{d}^{#1}#2\@ifnextchar^{}{\@ifnextchar\d{}{\,}}}}
  151. \makeatother
  152. % remove page before chapters
  153. \let\cleardoublepage=\clearpage
  154. %josua
  155. \newcommand{\norm}[1]{\left\Vert#1\right\Vert}
  156. % contradiction
  157. \newcommand{\contr}{\text{\Large\lightning}}
  158. % people seem to prefer varepsilon over epsilon
  159. \renewcommand{\epsilon}{\varepsilon}
  160. \newcommand{\Spec}{\operatorname{Spec}}
  161. \ExplSyntaxOn
  162. % S-tackrelcompatible ALIGN environment
  163. % some might also call it the S-uper ALIGN environment
  164. % uses regular expressions to calculate the widest stackrel
  165. % to put additional padding on both sides of relation symbols
  166. \NewEnviron{salign}
  167. {
  168. \begin{align}
  169. \lec_insert_padding:V \BODY
  170. \end{align}
  171. }
  172. % starred version that does no equation numbering
  173. \NewEnviron{salign*}
  174. {
  175. \begin{align*}
  176. \lec_insert_padding:V \BODY
  177. \end{align*}
  178. }
  179. % some helper variables
  180. \tl_new:N \l__lec_text_tl
  181. \seq_new:N \l_lec_stackrels_seq
  182. \int_new:N \l_stackrel_count_int
  183. \int_new:N \l_idx_int
  184. \box_new:N \l_tmp_box
  185. \dim_new:N \l_tmp_dim_a
  186. \dim_new:N \l_tmp_dim_b
  187. \dim_new:N \l_tmp_dim_c
  188. \dim_new:N \l_tmp_dim_needed
  189. % function to insert padding according to widest stackrel
  190. \cs_new_protected:Nn \lec_insert_padding:n
  191. {
  192. \tl_set:Nn \l__lec_text_tl { #1 }
  193. % get all stackrels in this align environment
  194. \regex_extract_all:nnN { \c{stackrel}(\[.*?\])?{(.*?)}{(.*?)} } { #1 } \l_lec_stackrels_seq
  195. % get number of stackrels
  196. \int_set:Nn \l_stackrel_count_int { \seq_count:N \l_lec_stackrels_seq }
  197. \int_set:Nn \l_idx_int { 1 }
  198. \dim_set:Nn \l_tmp_dim_needed { 0pt }
  199. % iterate over stackrels
  200. \int_while_do:nn { \l_idx_int <= \l_stackrel_count_int }
  201. {
  202. % calculate width of text
  203. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 1 }$}
  204. \dim_set:Nn \l_tmp_dim_a {\box_wd:N \l_tmp_box}
  205. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 2 }$}
  206. \dim_set:Nn \l_tmp_dim_c {\box_wd:N \l_tmp_box}
  207. \dim_set:Nn \l_tmp_dim_a {\dim_max:nn{ \l_tmp_dim_c} {\l_tmp_dim_a}}
  208. % calculate width of relation symbol
  209. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 3 }$}
  210. \dim_set:Nn \l_tmp_dim_b {\box_wd:N \l_tmp_box}
  211. % check if 0.5*(a-b) > minimum padding, if yes updated minimum padding
  212. \dim_compare:nNnTF
  213. { 1pt * \dim_ratio:nn { \l_tmp_dim_a - \l_tmp_dim_b } { 2pt } } > { \l_tmp_dim_needed }
  214. { \dim_set:Nn \l_tmp_dim_needed { 1pt * \dim_ratio:nn { \l_tmp_dim_a - \l_tmp_dim_b } { 2pt } } }
  215. { }
  216. % increment list index by three, as every stackrel produces three list entries
  217. \int_incr:N \l_idx_int
  218. \int_incr:N \l_idx_int
  219. \int_incr:N \l_idx_int
  220. \int_incr:N \l_idx_int
  221. }
  222. % replace all relations with align characters (&) and add the needed padding
  223. \regex_replace_all:nnN
  224. { (\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}&|>&|&>|<&|&<) }
  225. { \c{kern} \u{l_tmp_dim_needed} \1 \c{kern} \u{l_tmp_dim_needed} }
  226. \l__lec_text_tl
  227. \l__lec_text_tl
  228. }
  229. \cs_generate_variant:Nn \lec_insert_padding:n { V }
  230. \NewEnviron{leftright}
  231. {
  232. \lec_replace_parens:V \BODY
  233. }
  234. % function to replace parens with left right
  235. \cs_new_protected:Nn \lec_replace_parens:n
  236. {
  237. \tl_set:Nn \l__lec_text_tl { #1 }
  238. % replace all parantheses with \left( \right)
  239. \regex_replace_all:nnN { \( } { \c{left}( } \l__lec_text_tl
  240. \regex_replace_all:nnN { \) } { \c{right}) } \l__lec_text_tl
  241. \regex_replace_all:nnN { \[ } { \c{left}[ } \l__lec_text_tl
  242. \regex_replace_all:nnN { \] } { \c{right}] } \l__lec_text_tl
  243. \l__lec_text_tl
  244. }
  245. \cs_generate_variant:Nn \lec_replace_parens:n { V }
  246. \ExplSyntaxOff
  247. % add one equation tag to the current line to otherwise unnumbered environment
  248. \newcommand{\tageq}{\stepcounter{equation}\tag{\theequation}}
  249. \newcommand{\ve}{\varepsilon}