dotfiles/tex/handout.cls

360 lines
9.8 KiB
OpenEdge ABL
Raw Normal View History

2022-12-04 16:01:19 -05:00
\ProvidesClass{handout}
\LoadClass{scrartcl}
2023-02-08 03:04:29 -05:00
\RequirePackage{tex-macros}
2022-12-04 16:01:19 -05:00
\RequirePackage[T1]{fontenc}
\RequirePackage{textcomp}
\RequirePackage{stmaryrd}
\SetSymbolFont{stmry}{bold}{U}{stmry}{m}{n}
\RequirePackage{url}
\RequirePackage{float}
\RequirePackage{booktabs}
\RequirePackage{emptypage}
\RequirePackage{subcaption}
\RequirePackage{multicol}
\RequirePackage{cancel}
\RequirePackage{mathrsfs}
\RequirePackage{minted}
\RequirePackage{listings}
\RequirePackage{systeme}
\RequirePackage{amsfonts, amsmath, mathtools, amssymb, amsthm}
\RequirePackage{enumitem}
\RequirePackage{bm}
\RequirePackage{listings}
\RequirePackage{geometry}
\RequirePackage{graphicx}
2024-11-14 03:41:41 -05:00
\RequirePackage[dvipsnames]{xcolor}
2022-12-04 16:01:19 -05:00
\RequirePackage{bm}
2022-12-12 12:30:43 -05:00
\RequirePackage{siunitx}[=v2]
2022-12-04 16:01:19 -05:00
\RequirePackage{physics}
2022-12-12 12:30:43 -05:00
\RenewCommandCopy\qty\SI%
2022-12-04 16:01:19 -05:00
\RequirePackage{etoolbox}
\RequirePackage{xifthen}
\RequirePackage{import}
\RequirePackage{pdfpages}
\RequirePackage{fancyhdr}
\RequirePackage{tikz}
\RequirePackage{tikz-cd}
\RequirePackage{pgfplots}
2022-12-04 23:37:31 -05:00
\RequirePackage{parskip}
2023-09-25 14:10:12 -04:00
\RequirePackage{algpseudocode}
\RequirePackage{algorithm}
2024-02-08 02:01:17 -05:00
\RequirePackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=blue,
urlcolor=blue,
}
2022-12-04 16:01:19 -05:00
\pgfplotsset{
compat=newest,
}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{patterns, intersections, angles, quotes, calc, positioning}
\usetikzlibrary{arrows.meta}
\RequirePackage{thmtools}
\RequirePackage[framemethod=TikZ]{mdframed}
\mdfsetup{skipabove=1em, skipbelow=0em, innertopmargin=5pt, innerbottommargin=6pt}
\theoremstyle{definition}
\makeatletter
2022-12-18 16:38:23 -05:00
\@ifclasswith{handout}{nocolor}{
2022-12-04 16:01:19 -05:00
2022-12-18 16:38:23 -05:00
\usemintedstyle{bw}
\declaretheoremstyle[
headfont=\bfseries\sffamily, bodyfont=\normalfont,
mdframed={nobreak}
]{thmboxed}
2022-12-04 16:01:19 -05:00
2022-12-18 16:38:23 -05:00
\declaretheoremstyle[
headfont=\bfseries\sffamily, bodyfont=\normalfont,
]{thmsimple}
\declaretheoremstyle[
headfont=\bfseries\sffamily, bodyfont=\normalfont,
numbered=no,
mdframed={
rightline=false, topline=false, bottomline=false,
},
qed=\qedsymbol,
]{thmproof}
\declaretheoremstyle[
headfont=\bfseries\sffamily, bodyfont=\normalfont,
numbered=no,
mdframed={
rightline=false, topline=false, bottomline=false,
}
]{thmline}
2022-12-04 16:01:19 -05:00
2022-12-18 16:38:23 -05:00
\declaretheorem[style=thmboxed, name=Definition]{definition}
\declaretheorem[style=thmboxed, name=Lemma]{lemma}
\declaretheorem[style=thmboxed, name=Theorem]{theorem}
\declaretheorem[style=thmboxed, name=Proposition]{proposition}
\declaretheorem[style=thmboxed, numbered=no, name=Corollary]{corollary}
\declaretheorem[style=thmsimple, numbered=no, name=Example]{eg}
\declaretheorem[name=Problem]{prob}
2022-12-04 16:01:19 -05:00
2022-12-18 16:38:23 -05:00
\AtEndEnvironment{eg}{\null\hfill$\diamond$}
2022-12-04 16:01:19 -05:00
2022-12-18 16:38:23 -05:00
\declaretheorem[style=thmproof, name=Proof]{thmproof}
\renewenvironment{proof}[1][\proofname]{\begin{thmproof}}{\end{thmproof}}
\declaretheorem[style=thmline, numbered=no, name=Proof]{expl}
2023-09-25 14:10:12 -04:00
\declaretheorem[style=thmline, numbered=no, name=Solution]{answ}
2022-12-04 16:01:19 -05:00
2022-12-18 16:38:23 -05:00
\declaretheorem[style=thmsimple, numbered=no, name=Remark]{remark}
\declaretheorem[style=thmsimple, numbered=no, name=Note]{note}
2022-12-04 16:01:19 -05:00
2023-09-25 14:10:12 -04:00
\newenvironment{code}[1]{\VerbatimEnvironment\begin{minted}[fontfamily=courier, frame=lines,framesep=7pt, linenos, breaklines]{#1}}{\end{minted}}
2022-12-04 16:01:19 -05:00
2022-12-18 16:38:23 -05:00
\newcommand{\inlinecode}[2]{\mintinline{#1}|#2|}
2022-12-04 16:01:19 -05:00
2023-09-25 14:10:12 -04:00
\newcommand{\importcode}[2]{\inputminted[fontfamily=courier, frame=lines, framesep=7pt, linenos, breaklines]{#1}{#2}}
2022-12-04 16:01:19 -05:00
2022-12-18 16:38:23 -05:00
\newcommand{\specialquote}[2]
{
\begin{flushright}
\begin{tikzpicture}
\draw (0,0) node [right,text width=8.75cm] {
\begin{mdframed}[
linecolor=black,
rightline=false,
topline=false,
bottomline=false,
linewidth=2pt
]
{``#1''}
\vspace{1mm}
\hfill-- \small{#2}
\end{mdframed}
};
\end{tikzpicture}
\end{flushright}
}
\newcommand{\specialnoquote}[2]
{
\begin{flushright}
\begin{tikzpicture}
\draw (0,0) node [right,text width=8.75cm] {
\begin{mdframed}[
linecolor=black,
rightline=false,
topline=false,
bottomline=false,
linewidth=2pt
]
{#1}
\vspace{1mm}
\hfill-- \small{#2}
\end{mdframed}
};
\end{tikzpicture}
\end{flushright}
}
}{
\usemintedstyle{monokai}
\declaretheoremstyle[
headfont=\bfseries\sffamily\color{ForestGreen!70!black}, bodyfont=\normalfont,
mdframed={
linecolor=ForestGreen,
backgroundcolor=ForestGreen!5,
}
]{thmdef}
\declaretheoremstyle[
headfont=\bfseries\sffamily\color{RawSienna!70!black}, bodyfont=\normalfont,
mdframed={
linecolor=RawSienna,
backgroundcolor=RawSienna!5,
}
]{thmthm}
\declaretheoremstyle[
headfont=\bfseries\sffamily\color{NavyBlue!70!black}, bodyfont=\normalfont,
mdframed={
linewidth=2pt,
rightline=false, topline=false, bottomline=false,
linecolor=NavyBlue, backgroundcolor=NavyBlue!5,
}
]{thmexample}
\declaretheoremstyle[
headfont=\bfseries\sffamily, bodyfont=\normalfont,
mdframed={
linewidth=2pt,
rightline=false, topline=false, bottomline=false,
linecolor=Black, backgroundcolor=Black!5,
}
]{thmremark}
\declaretheoremstyle[
headfont=\bfseries\sffamily\color{RawSienna!70!black}, bodyfont=\normalfont,
mdframed={
linewidth=2pt,
rightline=false, topline=false, bottomline=false,
linecolor=RawSienna,
},
qed=\qedsymbol%
]{thmproof}
\declaretheoremstyle[
headfont=\bfseries\sffamily\color{NavyBlue!70!black}, bodyfont=\normalfont,
mdframed={
linewidth=2pt,
rightline=false, topline=false, bottomline=false,
linecolor=NavyBlue,
},
qed=\qedsymbol%
]{thmexpl}
\declaretheorem[style=thmdef, name=Definition]{definition}
\declaretheorem[style=thmthm, name=Lemma]{lemma}
\declaretheorem[style=thmthm, name=Theorem]{theorem}
\declaretheorem[style=thmthm, name=Proposition]{proposition}
\declaretheorem[style=thmthm, numbered=no, name=Corollary]{corollary}
\declaretheorem[style=thmexample, numbered=no, name=Example]{eg}
\declaretheorem[name=Problem]{prob}
\declaretheorem[style=thmproof, name=Proof]{thmproof}
\renewenvironment{proof}[1][\proofname]{\begin{thmproof}}{\end{thmproof}}
\declaretheorem[style=thmexpl, numbered=no, name=Proof]{thmexpl}
\newenvironment{expl}[1][]{\vspace{-12pt}\begin{thmexpl}}{\end{thmexpl}}
2023-09-25 14:10:12 -04:00
\declaretheorem[style=thmexpl, numbered=no, name=Solution]{thmansw}
\newenvironment{answ}[1][]{\vspace{-12pt}\begin{thmansw}}{\end{thmansw}}
2022-12-18 16:38:23 -05:00
\declaretheorem[style=thmremark, numbered=no, name=Remark]{remark}
\declaretheorem[style=thmremark, numbered=no, name=Note]{note}
\definecolor{MintedBg}{RGB}{38, 38, 38}
\newcommand{\toc}{\tableofcontents\raggedbottom}
\newenvironment{code}[1]{\color{white}\VerbatimEnvironment\begin{minted}[breaklines, bgcolor=MintedBg]{#1}}{\end{minted}}
\newcommand{\inlinecode}[2]{\color{white}\mintinline[breaklines, bgcolor=MintedBg]{#1}|#2|}
\newcommand{\importcode}[2]{\color{white}\inputminted[breaklines, bgcolor=MintedBg]{#1}{#2}}
\newcommand{\specialquote}[2]
{
\begin{flushright}
\begin{tikzpicture}
\draw (0,0) node [right,text width=8.75cm] {
\begin{mdframed}[
linecolor=RoyalPurple,
rightline=false,
topline=false,
bottomline=false,
backgroundcolor=RoyalPurple!5,
linewidth=2pt
]
``#1''
\vspace{1mm}
\hfill-- \small{#2}
\end{mdframed}
};
\end{tikzpicture}
\end{flushright}
}
\newcommand{\specialnoquote}[2]
{
\begin{flushright}
\begin{tikzpicture}
\draw (0,0) node [right,text width=8.75cm] {
\begin{mdframed}[
linecolor=RoyalPurple,
rightline=false,
topline=false,
bottomline=false,
backgroundcolor=RoyalPurple!5,
linewidth=2pt
]
{#1}
\vspace{1mm}
\hfill-- \small{#2}
\end{mdframed}
};
\end{tikzpicture}
\end{flushright}
}
}
2022-12-04 16:01:19 -05:00
2023-02-08 03:09:21 -05:00
\newcommand{\exercise}[2][]{%
\def\@exercise{#2}%
\subsection*{Exercise #2. #1}
2022-12-04 16:01:19 -05:00
}
2023-02-08 03:09:21 -05:00
\newcommand{\subexercise}[2][]{%
\subsubsection*{Exercise \@exercise.#2. #1}
2022-12-04 16:01:19 -05:00
}
2023-02-08 03:09:21 -05:00
2022-12-04 16:01:19 -05:00
\newcommand{\sect}[1]{
\def\@section{#1}
\section{#1}
}
2023-09-25 14:10:12 -04:00
\newcommand{\subsect}[1]{
\def\@subsection{#1}
\subsection{#1}
}
2022-12-04 16:01:19 -05:00
\newcommand{\chapter}[1]{}
\renewcommand{\part}[1]{}
\renewcommand{\tableofcontents}{}
\newcounter{chapter}
\def\@lecture{}
\newcommand{\lecture}[2]{
\ifthenelse{\isempty{#2}}{
\def\@lecture{Lecture #1}%
}{%
\def\@lecture{Lecture #1: #2}%
}%
\subsection*{\@lecture}
}
\newcommand{\fullpagebreak}{}
\newcommand{\incfig}[1]{%
\def\svgwidth{\columnwidth}
2022-12-04 16:04:29 -05:00
\import{./figures/}{#1.pdf_tex}
2022-12-04 16:01:19 -05:00
}
\pagestyle{fancy}
2022-12-04 23:37:31 -05:00
\fancyhead[L]{\@title}
\fancyhead[R]{\@section}
2022-12-04 16:01:19 -05:00
2022-12-12 00:13:40 -05:00
2022-12-04 16:01:19 -05:00
\makeatother