\ProvidesClass{lecture}
\LoadClass[a4paper, titlepage]{article}

\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage{textcomp}
\RequirePackage[german]{babel}
\RequirePackage{amsmath, amssymb, amsthm}
\RequirePackage{mdframed}
\RequirePackage{fancyhdr}
\RequirePackage{geometry}
\RequirePackage{import}
\RequirePackage{pdfpages}
\RequirePackage{transparent}
\RequirePackage{xcolor}
\RequirePackage{array}
\RequirePackage[shortlabels]{enumitem}
\RequirePackage{tikz}
\RequirePackage{pgfplots}
\RequirePackage[nobottomtitles]{titlesec}
\RequirePackage{listings}
\RequirePackage{mathtools}

\usetikzlibrary{quotes, angles}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\DeclareOption{uebung}{
    \makeatletter
    \lhead{\@title}
    \rhead{\@author}
    \makeatother
}
\ProcessOptions\relax

% PAGE GEOMETRY
\geometry{
    left=15mm,
    right=40mm,
    top=20mm,
    bottom=20mm
}

% PARAGRAPH no indent but skip
\setlength{\parskip}{3mm}
\setlength{\parindent}{0mm}

\theoremstyle{definition}
\newmdtheoremenv{satz}{Satz}[section]
\newmdtheoremenv{lemma}[satz]{Lemma}
\newmdtheoremenv{korrolar}[satz]{Korrolar}
\newmdtheoremenv{definition}[satz]{Definition}

\newtheorem{bsp}[satz]{Beispiel}
\newtheorem{bem}[satz]{Bemerkung}
\newtheorem{aufgabe}{Aufgabe}

\newcommand{\N}{\mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\C}{\mathbb{C}}

% HEADERS

\pagestyle{fancy}

\newcommand{\incfig}[1]{%
    \def\svgwidth{\columnwidth}
    \import{./figures/}{#1.pdf_tex}
}
\pdfsuppresswarningpagegroup=1

% horizontal rule
\newcommand\hr{
    \noindent\rule[0.5ex]{\linewidth}{0.5pt}
}

% punkte tabelle
\newcommand\punkte{
    \begin{tabular}{|c|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|@{}m{0cm}@{}}
        \hline
        Aufgabe & \centering A1 & \centering A2 & \centering A3 & \centering A4 & \centering $\sum$ & \\[5mm] \hline
        Punkte & & & & & & \\[5mm] \hline
    \end{tabular}
}

% code listings, define style
\lstdefinestyle{mystyle}{
    commentstyle=\color{gray},
    keywordstyle=\color{blue},
    numberstyle=\tiny\color{gray},
    stringstyle=\color{black},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,         
    breaklines=true,                 
    captionpos=b,                    
    keepspaces=true,                 
    numbers=left,                    
    numbersep=5pt,                  
    showspaces=false,                
    showstringspaces=false,
    showtabs=false,                  
    tabsize=2
}

% activate my colour style
\lstset{style=mystyle}

% better stackrel
\let\oldstackrel\stackrel
\renewcommand{\stackrel}[2]{%
    \oldstackrel{\mathclap{#1}}{#2}
}%
