For reading the lecture notes, please head to https://merten.dev/lecture/pdf/groupschemes.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

283 rindas
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. \newcommand{\Spec}{\operatorname{Spec}}
  160. \ExplSyntaxOn
  161. % S-tackrelcompatible ALIGN environment
  162. % some might also call it the S-uper ALIGN environment
  163. % uses regular expressions to calculate the widest stackrel
  164. % to put additional padding on both sides of relation symbols
  165. \NewEnviron{salign}
  166. {
  167. \begin{align}
  168. \lec_insert_padding:V \BODY
  169. \end{align}
  170. }
  171. % starred version that does no equation numbering
  172. \NewEnviron{salign*}
  173. {
  174. \begin{align*}
  175. \lec_insert_padding:V \BODY
  176. \end{align*}
  177. }
  178. % some helper variables
  179. \tl_new:N \l__lec_text_tl
  180. \seq_new:N \l_lec_stackrels_seq
  181. \int_new:N \l_stackrel_count_int
  182. \int_new:N \l_idx_int
  183. \box_new:N \l_tmp_box
  184. \dim_new:N \l_tmp_dim_a
  185. \dim_new:N \l_tmp_dim_b
  186. \dim_new:N \l_tmp_dim_c
  187. \dim_new:N \l_tmp_dim_needed
  188. % function to insert padding according to widest stackrel
  189. \cs_new_protected:Nn \lec_insert_padding:n
  190. {
  191. \tl_set:Nn \l__lec_text_tl { #1 }
  192. % get all stackrels in this align environment
  193. \regex_extract_all:nnN { \c{stackrel}(\[.*?\])?{(.*?)}{(.*?)} } { #1 } \l_lec_stackrels_seq
  194. % get number of stackrels
  195. \int_set:Nn \l_stackrel_count_int { \seq_count:N \l_lec_stackrels_seq }
  196. \int_set:Nn \l_idx_int { 1 }
  197. \dim_set:Nn \l_tmp_dim_needed { 0pt }
  198. % iterate over stackrels
  199. \int_while_do:nn { \l_idx_int <= \l_stackrel_count_int }
  200. {
  201. % calculate width of text
  202. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 1 }$}
  203. \dim_set:Nn \l_tmp_dim_a {\box_wd:N \l_tmp_box}
  204. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 2 }$}
  205. \dim_set:Nn \l_tmp_dim_c {\box_wd:N \l_tmp_box}
  206. \dim_set:Nn \l_tmp_dim_a {\dim_max:nn{ \l_tmp_dim_c} {\l_tmp_dim_a}}
  207. % calculate width of relation symbol
  208. \hbox_set:Nn \l_tmp_box {$\seq_item:Nn \l_lec_stackrels_seq { \l_idx_int + 3 }$}
  209. \dim_set:Nn \l_tmp_dim_b {\box_wd:N \l_tmp_box}
  210. % check if 0.5*(a-b) > minimum padding, if yes updated minimum padding
  211. \dim_compare:nNnTF
  212. { 1pt * \dim_ratio:nn { \l_tmp_dim_a - \l_tmp_dim_b } { 2pt } } > { \l_tmp_dim_needed }
  213. { \dim_set:Nn \l_tmp_dim_needed { 1pt * \dim_ratio:nn { \l_tmp_dim_a - \l_tmp_dim_b } { 2pt } } }
  214. { }
  215. % increment list index by three, as every stackrel produces three list entries
  216. \int_incr:N \l_idx_int
  217. \int_incr:N \l_idx_int
  218. \int_incr:N \l_idx_int
  219. \int_incr:N \l_idx_int
  220. }
  221. % replace all relations with align characters (&) and add the needed padding
  222. \regex_replace_all:nnN
  223. { (\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}&|>&|&>|<&|&<) }
  224. { \c{kern} \u{l_tmp_dim_needed} \1 \c{kern} \u{l_tmp_dim_needed} }
  225. \l__lec_text_tl
  226. \l__lec_text_tl
  227. }
  228. \cs_generate_variant:Nn \lec_insert_padding:n { V }
  229. \NewEnviron{leftright}
  230. {
  231. \lec_replace_parens:V \BODY
  232. }
  233. % function to replace parens with left right
  234. \cs_new_protected:Nn \lec_replace_parens:n
  235. {
  236. \tl_set:Nn \l__lec_text_tl { #1 }
  237. % replace all parantheses with \left( \right)
  238. \regex_replace_all:nnN { \( } { \c{left}( } \l__lec_text_tl
  239. \regex_replace_all:nnN { \) } { \c{right}) } \l__lec_text_tl
  240. \regex_replace_all:nnN { \[ } { \c{left}[ } \l__lec_text_tl
  241. \regex_replace_all:nnN { \] } { \c{right}] } \l__lec_text_tl
  242. \l__lec_text_tl
  243. }
  244. \cs_generate_variant:Nn \lec_replace_parens:n { V }
  245. \ExplSyntaxOff
  246. % add one equation tag to the current line to otherwise unnumbered environment
  247. \newcommand{\tageq}{\stepcounter{equation}\tag{\theequation}}