%!TEX root=Band2.tex

\usepackage[paperheight=240mm,paperwidth=170mm,left=2.1cm,right=1.9cm,top=20mm,bottom=20mm,heightrounded]{geometry}

\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}


\usepackage{tikz}
\usetikzlibrary{arrows.meta,bending,positioning,matrix,fit,arrows,backgrounds}
\usepackage{circuitikz}
\usetikzlibrary{circuits.ee.IEC.relay}
%\usepackage{sanitize-umlaut}

% fuer Stichwortverzeichnis
\usepackage{makeidx}

% Stichwortverzeichnis erstellen
\makeindex


\usepackage{graphicx}
%\usepackage{fancyhdr}
\usepackage{makecell}

%\reversemarginpar

% ref packages
%\usepackage{nameref}
% folowing  must be in this order
%\usepackage{varioref}
\usepackage[colorlinks=true,urlcolor=blue,linkcolor=blue]{hyperref}
%\usepackage{cleveref}

\usepackage[parfill]{parskip}
%\newcommand{\anf}[1]{"`#1"'}

\newcommand{\anf}[1]{\glqq#1\grqq}

%\usepackage{showframe}
\usepackage[most]{tcolorbox}
\usepackage{amsmath,amssymb}


\usepackage{scrlayer-scrpage}
\pagestyle{scrheadings} 	

%https://www.grund-wissen.de/informatik/latex/seitenlayout.html
\automark[section]{chapter}
\clearscrheadfoot
\ohead{\pagemark}
\ihead{\headmark}

\newcommand{\einrueckungm}[2]{\begin{addmargin}[#1pt]{0pt}
		#2\end{addmargin}
}

\newcommand{\einrueckung}[1]{\begin{addmargin}[45pt]{0pt}
		#1\end{addmargin}
}

%%%%Leerseite
\usepackage{afterpage}
\newcommand\myemptypage{
	\null
	\thispagestyle{empty}
	\addtocounter{page}{-1}
	\newpage
}	

%%%%Zahl linker Rand

\newcommand{\liRa}[1]{\marginpar[\raggedleft\Huge{\textbf{#1}}]{\textbf{\Huge{#1}}}}

%%%%Farbbox
\newtcolorbox{mybox}[1][]{%
	%enhanced,
	%boxed title style={colback=red, sharp corners},
	colframe = orange!20,
	colback = orange!20,  
	%	overlay = {\node[text=white, fill=red] at (frame.east) 
		%		{$\clubsuit$};},
	#1}

%\usepackage{enumitem,calc}
%\SetLabelAlign{myparleft}{\parbox[t]\textwidth{#1\par\mbox{}}}

\usepackage{calc}
\usepackage{enumitem} % für liste mit Klammern siehe 3.4
%\setlist[description]{leftmargin=\parindent,labelindent=\parindent}\usepackage{enumitem}
%\setlist[description]{leftmargin=\parindent,labelindent=\parindent}

\newlength{\mylength}

\newcommand{\ausrichtung}[1]{ % Befehl zur Berechnung der Wortlänge
	\settowidth{\mylength}{#1} % Breite des Wortes berechnen und in Längenvariable speichern
	\hspace{\mylength}} % wird die Klammer eine Zeile tiefer gesetzt, dann rutscht das nachfolgende um ? nach rechts


%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsthm}
%\newtheorem{thm}{Theorem}[chapter]
%\newtheorem{defn}[thm]{Definition}
%
%\newtheoremstyle{theorem}
%{10pt}
%{0pt}
%{}
%{}
%{\bfseries}
%{}
%{\newline}
%{}
%\theoremstyle{theorem}


%%%%%%%%%%%%%%%%%%%%%%%%%%
%1. Beispiel
%\newtheoremstyle{break}
%{\topsep}{\topsep}%
%{\itshape}{}%
%{\bfseries}{}%
%{\newline}{}%
%\theoremstyle{break}
%\newtheorem{theorem}{Theorem}
%
%\begin{document}
%	
%	\begin{theorem}[Some note]
	%		\lipsum*[2]
	%	\end{theorem}
%	
%\end{document}

%2. Beispiel
%\newtheoremstyle{side}{}{}{\advance\leftskip3cm\relax\itshape}{}
%{\bfseries}{}{0pt}{%
	%	\makebox[0pt][r]{%
		%		\smash{\parbox[t]{2.5cm}{\raggedright\thmname{#1}%
				%				\thmnumber{\space #2}\thmnote{\newline (#3)}}}%
		%		\hspace{.5cm}}}
%
%\theoremstyle{side}
%\newtheorem{theorem}{Theorem}[section]
%
%\theoremstyle{definition}
%\newtheorem{definition}[theorem]{Definition}
%
%\begin{document}
%	
%	\lipsum[1]
%	
%	\begin{theorem}
	%		\lipsum[1]
	%	\end{theorem}
%	
%	\begin{theorem}[Euclid]
	%		\lipsum[2]
	%	\end{theorem}
%	
%	\begin{theorem}[Very long name]
	%		\lipsum[3]
	%	\end{theorem}
%	
%	\begin{definition}
	%		\lipsum[1]
	%	\end{definition}
%	
%\end{document}




\usepackage{pgfplots}

%%%%%%%%%%%%%%%%%%%%%%%%%


\newtheorem{thb}{Theorem}[chapter]
\newtheorem{bsp}[thb]{Beispiel}

%https://tex.stackexchange.com/questions/338209/remove-dot-after-theorem-with-amsthm-and-hyperref

\usepackage{xpatch}
\makeatletter
\AtBeginDocument{\xpatchcmd{\@thm}{\thm@headpunct{.}}{\thm@headpunct{}}{}{}}
\makeatother

\numberwithin{equation}{chapter} %Numerierung der Formeln mit Kapitelnummer 

%%%%%%%%%%%%%%%%%%%%%Tabellenbreite

\usepackage{tabulary}

%%%%%%%%%%%%%%%%%%%%%




%%%%%%Neues Enviroment für Defintion
%% https://tex.stackexchange.com/questions/43495/defining-a-custom-environment-with-per-section-numbering

\newcounter{mydefcount}
\newcounter{mybspcount}
\newcounter{myaufgcount}
\newcounter{mysatzcount}

\newenvironment{definition}{%      define a custom environment
%	\bigskip\noindent%         create a vertical offset to previous material
	\refstepcounter{mydefcount}% increment the environment's counter
	\textbf{Definition \themydefcount}: }{}  
\numberwithin{mydefcount}{chapter}


\newenvironment{satz}{%      define a custom environment
	%	\bigskip\noindent%         create a vertical offset to previous material
	\refstepcounter{mysatzcount}% increment the environment's counter
	\textbf{Satz \themysatzcount}: }{}  
\numberwithin{mysatzcount}{chapter}

%%%%%%Neues Enviroment für Definition Ende

\newenvironment{beispiel}{%      define a custom environment
	\bigskip\noindent%         create a vertical offset to previous material
	\refstepcounter{mybspcount}% increment the environment's counter
	\textbf{Beispiel \themybspcount}:}{}
\numberwithin{mybspcount}{chapter}


\newenvironment{aufgabe}{%      define a custom environment
	\bigskip\noindent%         create a vertical offset to previous material
	\refstepcounter{myaufgcount}% increment the environment's counter
	\textbf{* Aufgabe \themyaufgcount}\mbox{}
	\vspace*{-\baselineskip}
	\newline
	
}{\par\bigskip}  %          create a vertical offset to following material
\numberwithin{myaufgcount}{chapter}

\title{Differential- und Integralrechnung für Funktionen mit einer Variablen}

%%%Pfeile
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}
\newcommand{\bglayer}[1]{%
	\begin{pgfonlayer}{background}
		\begin{scope}[every picture]
			#1
		\end{scope}
	\end{pgfonlayer}
}
%%%Pfeile

\everymath{\displaystyle}

\usepackage[figurewithin=chapter,labelsep=space]{caption}

%\usepackage[font=small,labelfont=bf,figurewithin=section,labelsep=space]{caption}

%%%Caption in tabelle auch links
%\usepackage[singlelinecheck=false % <-- important
%]{caption}

\usepackage{booktabs} 
%\usepackage{floatrow} % um die caption nach rechts zu setzen

%Abbildung nach Bild umbenennen
\renewcaptionname{german}{\figurename}{Bild}

\newcommand{\hhlline}[3]{\draw (#1-#2-1.south west) -- (#1-#2-#3.south east);}
