\documentclass[a4paper, fontsize = 10pt, landscape]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[left=5mm, right=5mm, bottom=5mm, top=5mm]{geometry}
\usepackage{lastpage}
\usepackage[explicit]{titlesec}
\usepackage{ulem}
\usepackage{bm}
% Hyperref links, pdf metadata
\usepackage{hyperref}

\usepackage{titling}
\usepackage{calc}
\usepackage[table]{xcolor}
\usepackage{enumitem}
\setlist{nolistsep, leftmargin = 4mm}

\usepackage{multicol}
\usepackage{adjustbox}
\usepackage{multirow}
\usepackage{csvsimple}
\usepackage{colortbl}

\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{esint}
\usepackage{amssymb}    % \cdots
\usepackage{cancel}     % strike-through terms
\usepackage{gensymb}
\usepackage{siunitx}
\sisetup{exponent-product = \cdot, per-mode = fraction, range-phrase = \dots}

\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{positioning, calc, fit, matrix, decorations, angles, quotes, babel, 3d, arrows.meta, shadings, circuits.logic.IEC, circuits.ee.IEC, automata}
\usepackage{circuitikz}
\ctikzset{tripoles/pmos style/emptycircle}
\usepackage{wrapfig}
%% Formal tables
\usepackage{booktabs}

% pgfplot layers
\pgfplotsset{compat=1.7}                                                                % Version? für Plots  
\pgfdeclarelayer{bg}
\pgfdeclarelayer{l1}
\pgfdeclarelayer{l2}
\pgfdeclarelayer{l3}
\pgfdeclarelayer{tl1}
\pgfdeclarelayer{tl2}
\pgfdeclarelayer{tl3}
\pgfsetlayers{bg,l3,l2,l1,main,tl1,tl2,tl3}

% custom colors
\definecolor{darkgreen}{HTML}{008E00}
\definecolor{darkred}{HTML}{990000}
\definecolor{mred}{HTML}{e60000}
\definecolor{burntorange}{HTML}{ff9a00}
\definecolor{darkblue}{HTML}{000099}
\definecolor{lightblue}{HTML}{99d6ff}
\definecolor{lightgray}{HTML}{A9A9A9}
\definecolor{darkyellow}{HTML}{FED600}
\definecolor{limegreen}{HTML}{3ae32b}
\definecolor{pastelmoss}{HTML}{A0C1B8}
\definecolor{pastelaqua}{HTML}{709FB0}
\definecolor{pastelviolet}{HTML}{726a95}

\definecolor{primaryheader}{HTML}{30475e}
\definecolor{secondaryheader}{HTML}{f1935c}
\definecolor{thirdheader}{HTML}{ba6b57}

\definecolor{numColor}{HTML}{000099}
\definecolor{twoColor}{HTML}{008E00}

\newcommand{\clktag}{{\footnotesize C1}}

\tikzset{
    circ/.style = {circle, fill = black, minimum size=1mm, inner sep=0pt, outer sep=0pt},
    point/.style = {circle, draw = black, thick, minimum size=1mm, inner sep=0pt, outer sep=0pt},
    gnd/.style = {draw, fill, minimum width = 10mm, minimum height = 1pt},
    kvbinhead/.style = {draw = white, fill = secondaryheader!30, text = black},
    srLatch/.style = {flipflop, flipflop def = {t1 = S, t3 =R, t6={~}, n4 = 1}},
    srtLatch/.style = {flipflop, flipflop def = {t1 = S, t2 = T, t3 =R, t6={~}, n4 = 1}},
    dLatch/.style = {flipflop, flipflop def = {t1 = D, t2 = T, t6={~}, n4 = 1}},
    dFf/.style = {flipflop, flipflop def = {t1 = D, t2=\clktag, t6={~}, c2=1, n4=1}},
    srFf/.style = {flipflop, flipflop def = {t1 = S, t2=\clktag, t3=R, t6={~}, c2=1, n4=1}},
    jkFf/.style = {flipflop, flipflop def = {t1 = J, t2=\clktag, t3=K, t6={~}, c2=1, n4=1}},  
    tFfv1/.style = {flipflop, flipflop def = {t2=\clktag, t6={~}, c2=1, n4=1}, label={[label distance =1.2mm]90:T}},
    tFfv2/.style = {flipflop, flipflop def = {t1=T, t2=\clktag, t6={~}, c2=1, n4=1}},
    tFfmin/.style = {flipflop, flipflop def = {t6={~}, c2=1}, label={[label distance =0mm]90:T}}
}

\newcommand{\cirin}[1]{\textbf{\sffamily #1}}
\newcommand{\cirout}[1]{\textit{\textbf{#1}}}
\newcommand{\ciroutn}[1]{$\overline{\text{\textit{\textbf{#1}}}}$}

\newenvironment{circuit}[1][0.4]{
    \begin{center}
    \begin{circuitikz}[european]
        \ctikzset{flipflops/scale = #1}
        \ctikzset{multipoles/flipflop/font = \normalsize}
        \ctikzset{multipoles/flipflop/clock wedge size=0.3}
        \ctikzset{tripoles/european not symbol=circle}
        \ctikzset{tripoles/european nor port/height=0.3}
        \ctikzset{tripoles/european nor port/width=0.6} 
        \ctikzset{tripoles/european and port/height=0.3}
        \ctikzset{tripoles/european and port/width=0.6} 
        \ctikzset{tripoles/european not port/height=0.3}
        \ctikzset{tripoles/european not port/width=0.5} 
}{
    \end{circuitikz}
    \end{center}
} 

\newcommand{\uunits}[2]{$\left[#1\right] = \si{#2}$}
\newcommand{\floor}[1]{\text{floor}\left(#1\right)}

\newcommand{\cemph}[2][red]{\textcolor{#1}{\sffamily\bfseries\boldmath #2}}
\newcommand{\cbmath}[2]{\textcolor{#1}{\bfseries\boldmath #2}}
\newcommand{\twocom}{$2^{\text{er}}$}
\newcommand{\nibp}[2]{#1\textcolor{blue}{#2}} 



\newcommand{\overrideplainstyle}{
    \fancypagestyle{plain}{
        \fancyhf{}
        \rfoot{Seite \thepage \protect{ }von \pageref{LastPage}}
        \renewcommand{\headrulewidth}{0pt}
        \renewcommand{\footrulewidth}{0pt}
    }
}


\setlength{\columnseprule}{1pt}
\def\columnseprulecolor{\color{black!20!white}}

\newcommand{\raisedrulefill}[2][0ex]{\leaders\hbox{\rule[#1]{1pt}{#2}}\hfill}

\titleformat{\section}{\sffamily\bfseries\boldmath\large}{}{-5pt}{\colorbox{primaryheader}{\parbox[c][3mm]{\linewidth + 4pt}{\textcolor{white}{#1}}}}
\titleformat{\subsection}{\sffamily\bfseries\boldmath}{}{-5pt}{\colorbox{secondaryheader}{\parbox[c][2mm]{\linewidth + 4pt}{#1}}}
\titleformat{\subsubsection}{\sffamily\bfseries\boldmath}{}{0pt}{\textcolor{thirdheader}{#1 \raisedrulefill[0.4ex]{0.5pt}}}
\titleformat{\paragraph}[runin]{\sffamily\bfseries\boldmath}{}{-5pt}{\uline{#1}}

\parindent 0pt

\definecolor{formulabox}{RGB}{182,225,189}
\renewcommand{\not}[1]{\overline{#1}}
% equation box        
\newcommand{\eqbox}[1]{\fcolorbox{black}{white}{\hspace{0.5em}#1\hspace{0.5em}}}
\newcommand{\eqboxf}[1]{\fcolorbox{black}{formulabox}{\hspace{0.5em}#1\hspace{0.5em}}}


\begin{document}
\begin{multicols*}{3}
	\begin{center}
		\Large{Digitaltechnik} \\
		\tiny{von Jirayu Ruh, \href{mailto:jirruh@ethz.ch}{jirruh@ethz.ch}}
	\end{center}

	\input{sections/gates.tex}
	\input{sections/cmos.tex}
	\input{sections/boolsche_algebra.tex}
	\input{sections/karnaugh.tex}
	\input{sections/zahlensysteme.tex}
	\input{sections/codes.tex}
	\input{sections/EinfacheHardwarekomp.tex}
	\input{sections/latches_flipflops.tex}
	\input{sections/automaten.tex}
	\input{sections/speicher.tex}
	\input{sections/misc.tex}
\end{multicols*}
\end{document}
