220 lines
5.6 KiB
TeX
220 lines
5.6 KiB
TeX
\documentclass[a4paper]{article}
|
|
\usepackage{array}
|
|
\usepackage{adjustbox}
|
|
\usepackage{graphicx}
|
|
\usepackage[left=3cm,right=3cm,top=3cm, bottom=3cm]{geometry}
|
|
\usepackage{amsmath}
|
|
\usepackage{amssymb}
|
|
\usepackage{caption}
|
|
\usepackage[headsepline, footsepline]{scrlayer-scrpage}
|
|
\usepackage{enumerate}
|
|
\usepackage{dsfont}
|
|
\usepackage{float}
|
|
\usepackage{ifthen}
|
|
\usepackage[]{mathtools}
|
|
\usepackage[]{mathbbol}
|
|
\usepackage{multicol}
|
|
\usepackage{enumitem}
|
|
\usepackage[hidelinks]{hyperref}
|
|
\usepackage[]{circuitikz}
|
|
\usepackage{tcolorbox} % Für schöne Boxen
|
|
\usetikzlibrary{circuits.logic.IEC}
|
|
\usepackage{tabularray}
|
|
\usepackage{tikz}
|
|
\usepackage{tkz-graph}
|
|
\usepackage{listings}
|
|
\usepackage{xcolor}
|
|
\usepackage{setspace}
|
|
\usepackage{letltxmacro}
|
|
|
|
|
|
\setlist{itemsep=0.3em, topsep=0.5em, parsep=0pt}
|
|
|
|
\newcommand{\bpf}[1]{%
|
|
\par\vspace{0.8\baselineskip}% Abstand vor der Überschrift
|
|
\noindent\textbf{#1}% Fettgedruckte Überschrift
|
|
\par\vspace{0.3\baselineskip}% Abstand nach der Überschrift
|
|
}
|
|
|
|
|
|
|
|
\renewcommand{\contentsname}{Inhaltsverzeichnis}
|
|
\renewcommand{\figurename}{Grafik}
|
|
\renewcommand{\partname}{Teil}
|
|
\renewcommand{\epsilon}{\varepsilon}
|
|
|
|
\definecolor{darkgrey}{HTML}{232327}
|
|
|
|
% Zählerdefinition mit AUTOMATISCHEM SUBSECTION-RESET
|
|
\newcounter{commoncounter}[subsection]
|
|
\renewcommand{\thecommoncounter}{\thesection.\arabic{commoncounter}}
|
|
|
|
\usepackage{xparse}
|
|
|
|
\newcommand{\answer}[1]{%
|
|
\ifhmode\newline\newline\fi
|
|
\foreach \n in {1,...,#1}{\noindent\rule{\linewidth}{0.4pt}\par\vspace{1em}}
|
|
}
|
|
|
|
|
|
\newcommand{\currentsection}{}
|
|
\newcommand{\currentsubsection}{}
|
|
|
|
\LetLtxMacro{\oldsection}{\section}
|
|
\LetLtxMacro{\oldsubsection}{\subsection}
|
|
|
|
\RenewDocumentCommand{\section}{s o m}{%
|
|
\IfBooleanTF{#1}%
|
|
{ \oldsection*{#3} }% Stern-Variante → unverändert
|
|
{%
|
|
\IfValueTF{#2}%
|
|
{ \oldsection[#2]{#3} }% Optionales TOC-Argument
|
|
{ \oldsection{#3} }%
|
|
\renewcommand{\currentsection}{#3}%
|
|
}%
|
|
}
|
|
|
|
\RenewDocumentCommand{\subsection}{s o m}{%
|
|
\IfBooleanTF{#1}%
|
|
{ \oldsubsection*{#3} }%
|
|
{%
|
|
\IfValueTF{#2}%
|
|
{ \oldsubsection[#2]{#3} }%
|
|
{ \oldsubsection{#3} }%
|
|
\renewcommand{\currentsubsection}{#3}%
|
|
}%
|
|
}
|
|
|
|
|
|
|
|
% Zähler direkt bei Dokumentstart initialisieren
|
|
\AtBeginDocument{\setcounter{commoncounter}{0}}
|
|
|
|
% BOX-DEFINITIONEN mit korrigierter Zählerlogik
|
|
\newtcolorbox{definitionbox}[1][]{
|
|
before title={\refstepcounter{commoncounter}}, % KRITISCH: vor dem Titel!
|
|
title={Definition \thecommoncounter: #1},
|
|
colback=white,
|
|
colframe=white!75!darkgrey,
|
|
fonttitle=\bfseries,
|
|
boxrule=0.6mm,
|
|
coltitle=black,
|
|
rounded corners,
|
|
before skip=10pt,
|
|
after skip=10pt
|
|
}
|
|
|
|
\newtcolorbox{taskbox}[1][]{
|
|
before title={\refstepcounter{commoncounter}}, % KRITISCH: vor dem Titel!
|
|
title={Aufgabe \thecommoncounter: #1},
|
|
colback=white,
|
|
colframe=white!75!orange,
|
|
fonttitle=\bfseries,
|
|
boxrule=0.6mm,
|
|
coltitle=black,
|
|
rounded corners,
|
|
before skip=10pt,
|
|
after skip=10pt
|
|
}
|
|
|
|
\newtcolorbox{merkbox}[1][]{
|
|
title={Merken: #1},
|
|
colback=white,
|
|
colframe=white!75!red,
|
|
fonttitle=\bfseries,
|
|
boxrule=0.6mm,
|
|
coltitle=black,
|
|
rounded corners,
|
|
before skip=10pt,
|
|
after skip=10pt
|
|
}
|
|
|
|
|
|
|
|
\definecolor{codegreen}{rgb}{0,0.6,0}
|
|
\definecolor{codeblue}{rgb}{0,0,0.8}
|
|
\definecolor{codered}{rgb}{0.8,0,0}
|
|
\definecolor{lightgray}{rgb}{0.95,0.95,0.95}
|
|
|
|
\lstdefinestyle{CStyle}{
|
|
language=C,
|
|
basicstyle=\ttfamily\small, % Monospace-Schrift
|
|
keywordstyle=\color{blue}\bfseries, % Schlüsselwörter fett und blau
|
|
stringstyle=\color{red}, % Strings rot
|
|
commentstyle=\color{codegreen}, % Kommentare grün
|
|
backgroundcolor=\color{lightgray}, % Hintergrundfarbe
|
|
numbers=left, % Zeilennummern links
|
|
numbersep=10px, % Abstand zwischen Zeilennummern und Code
|
|
numberstyle=\color{gray}\texttt,
|
|
stepnumber=1, % Zeilennummerierung Schrittweite 1
|
|
frame=single, % Rahmen um den Code
|
|
tabsize=4, % Tabulatorgröße
|
|
breaklines=true, % Zeilenumbruch aktivieren
|
|
captionpos=below,
|
|
showstringspaces=false,
|
|
xleftmargin=15pt, % Linker Rand für den Code (verschiebt alles nach rechts)
|
|
}
|
|
|
|
|
|
\lstdefinestyle{ShellStyle}{
|
|
language=Bash,
|
|
basicstyle=\ttfamily\small, % Monospace-Schrift
|
|
keywordstyle=\color{black}, % Schlüsselwörter fett und blau
|
|
stringstyle=\color{black}, % Strings rot
|
|
commentstyle=\color{codegreen}, % Kommentare grün
|
|
backgroundcolor=\color{lightgray}, % Hintergrundfarbe
|
|
numbers=left, % Zeilennummern links
|
|
numbersep=10px, % Abstand zwischen Zeilennummern und Code
|
|
numberstyle=\color{gray}\texttt,
|
|
stepnumber=1, % Zeilennummerierung Schrittweite 1
|
|
frame=single, % Rahmen um den Code
|
|
tabsize=4, % Tabulatorgröße
|
|
breaklines=true, % Zeilenumbruch aktivieren
|
|
captionpos=below,
|
|
showstringspaces=false,
|
|
xleftmargin=15pt, % Linker Rand für den Code (verschiebt alles nach rechts)
|
|
}
|
|
|
|
|
|
% Umgebung für Listings mit Titel und Zähler
|
|
\newenvironment{codeexample}[1][]{
|
|
\refstepcounter{commoncounter} % Zähler erhöhen
|
|
\lstset{
|
|
style=CSharpStyle,
|
|
caption={Listing \thecommoncounter: #1}, % Titel mit Zähler
|
|
label={listing:\thecommoncounter}
|
|
}
|
|
}{}
|
|
|
|
\makeatletter
|
|
% Internen Zähler von subsubsection auf commoncounter umbiegen
|
|
\let\c@subsubsection\c@commoncounter
|
|
|
|
% Anzeige der Nummer angleichen
|
|
\renewcommand{\thesubsubsection}{\thecommoncounter}
|
|
\makeatother
|
|
|
|
\setlength{\parindent}{0pt}
|
|
|
|
|
|
|
|
\newcommand{\curdate}{09.07.2026}
|
|
\newcommand{\curtitle}{Das Galtonbrett}
|
|
|
|
\title{\curtitle}
|
|
\author{Fierke, Janik, Weidlich}
|
|
\pagestyle{scrheadings}
|
|
\date{\curdate}
|
|
\begin{document}
|
|
\ihead{\normalfont\normalsize Mathematik}
|
|
\chead{\normalfont\normalsize \curtitle}
|
|
\ohead{\normalfont\normalsize \curdate}
|
|
\ofoot{\normalfont\normalsize Seite {\pagemark} von \pageref{LastPage}}
|
|
\ifoot{\normalfont\normalsize Fierke, Janik, Weidlich}
|
|
|
|
\section{\curtitle}
|
|
|
|
|
|
\label{LastPage}
|
|
\end{document}
|