From f2d2299e8bc22580b8428c2ae0db44005bc676af Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Tue, 1 Apr 2025 12:55:15 +0200 Subject: [PATCH] Improve formulas --- main/math.tex | 3 --- main/style/counters.tex | 10 +++++++++- main/style/math.tex | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/main/math.tex b/main/math.tex index 5a47859..fab0602 100644 --- a/main/math.tex +++ b/main/math.tex @@ -8,9 +8,6 @@ % ▄███▄ ▀▀ ▄████▄████▀██▄ ▀███████ ████▄ -\renewcommand{\vec}[1]{\overrightarrow{#1}} -\renewcommand{\hat}[1]{\widehat{#1}} -\renewcommand{\tilde}[1]{\widetilde{#1}} \newcommand{\R}{\mathbb{R}} \newcommand{\N}{\mathbb{N}} \newcommand{\C}{\mathbb{C}} diff --git a/main/style/counters.tex b/main/style/counters.tex index acae00a..d797006 100644 --- a/main/style/counters.tex +++ b/main/style/counters.tex @@ -14,6 +14,7 @@ \newcounter{examples} \newcounter{facts} \newcounter{propositions} +\newcounter{formulas} \newcounter{all} \newcommand{\useSubsection}{\ifnum\value{numberSubsections}>0{\arabic{subsection}.}\else{}\fi} @@ -42,6 +43,7 @@ \setcounter{examples}{1} \setcounter{facts}{1} \setcounter{propositions}{1} + \setcounter{formulas}{1} \setcounter{all}{1} } \newsectionNoPB @@ -78,10 +80,14 @@ overlay={\node[overlaystyle,draw=Cyan!75!black,fill=Cyan!75!black] at (frame.nor \newtcolorbox{example}[2][]{mainboxstyle,colback=gray!5!white,colframe=gray!75!black,colbacktitle=gray!75!black,title={\large #2}, overlay={\node[overlaystyle,draw=gray!75!black,fill=gray!75!black] at (frame.north east) {\large \translate{Example}{Beispiel} \usenumberArabic{examples}};},#1} +% Formula +\newtcolorbox{formula}[2][]{mainboxstyle,colback=red!5!white,colframe=red!75!black,colbacktitle=red!75!black,title={\large #2}, +overlay={\node[overlaystyle,draw=red!75!black,fill=red!75!black] at (frame.north east) {\large \translate{Formula}{Formel} \usenumberArabic{formulas}};},#1} % Inline environments (inline) \newcommand{\inlineex}{\textbf{\translate{Example}{Beispiel} \usenumberArabic{examples}:}} \newcommand{\inlinedef}{\bg{blue}{Definition \usenumberArabic{definitions}:}} +\newcommand{\inlineformula}{\bg{red}{\translate{Formula}{Formel} \usenumberArabic{formulas}:}} \newcommand{\inlinelemma}{\bg{Aquamarine}{Lemma \usenumberArabic{lemmas}:}} \newcommand{\inlinetheorem}{\bg{ForestGreen}{Theorem \usenumberArabic{theorems}:}} \newcommand{\inlineaxiom}{\bg{JungleGreen}{Axiom \usenumberArabic{axioms}:}} @@ -93,6 +99,7 @@ overlay={\node[overlaystyle,draw=gray!75!black,fill=gray!75!black] at (frame.nor % Enhanced inline environments \newcommand{\compactexample}[1]{\bg{gray}{\translate{Example}{Beispiel} \usenumberArabic{examples}:} \textit{#1}} \newcommand{\compactdefinition}[1]{\bg{blue}{Definition \usenumberArabic{definitions}:} \textit{#1}} +\newcommand{\compactformula}[1]{\bg{red}{\translate{Formula}{Formel} \usenumberArabic{formulas}:} \textit{#1}} \newcommand{\compactlemma}[1]{\bg{Aquamarine}{Lemma \usenumberArabic{lemmas}:} \textit{#1}} \newcommand{\compacttheorem}[1]{\bg{ForestGreen}{Theorem \usenumberArabic{theorems}:} \textit{#1}} \newcommand{\compactaxiom}[1]{\bg{JungleGreen}{Axiom \usenumberArabic{axioms}:} \textit{#1}} @@ -104,10 +111,11 @@ overlay={\node[overlaystyle,draw=gray!75!black,fill=gray!75!black] at (frame.nor % short environments (abbreviated) \newcommand{\shortex}{\textbf{\translate{Ex}{Bsp} \usenumberArabic{examples}:}} \newcommand{\shortdef}{\bg{blue}{D \usenumberArabic{definitions}:}} +\newcommand{\short}{\bg{red}{F \usenumberArabic{formulas}:}} \newcommand{\shortlemma}{\bg{Aquamarine}{L \usenumberArabic{lemmas}:}} \newcommand{\shorttheorem}{\bg{ForestGreen}{T \usenumberArabic{theorems}:}} \newcommand{\shortaxiom}{\bg{JungleGreen}{A \usenumberArabic{axioms}:}} \newcommand{\shortcorollary}{\bg{teal}{\translate{C}{K} \usenumberArabic{corollaries}:}} -\newcommand{\shortfact}{\bg{SeaGreen}{\translate{F}{F} \usenumberArabic{facts}:}} +\newcommand{\shortfact}{\bg{SeaGreen}{F \usenumberArabic{facts}:}} \newcommand{\shortproposition}{\bg{Cyan}{\translate{P}{S} \usenumberArabic{propositions}:}} \newcommand{\shortproof}{\bg{magenta}{\translate{Proof}{Beweis}:}} diff --git a/main/style/math.tex b/main/style/math.tex index 128b212..c1ed9a2 100644 --- a/main/style/math.tex +++ b/main/style/math.tex @@ -4,7 +4,7 @@ % ██ ██▌▐█▌▐█▪ ▐▌ ▐█▌·██▌▐▀ ▐█▄▪▐█ ▐█▌· ▐█▀·.▐█▌ ▄▐█▄▄▌ % ▀▀ █▪▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀ · ▀▀▀▀ ▀▀▀ ▀ • .▀▀▀ ▀▀▀ -% Math specific tcolorboxes -\newtcolorbox{formula}[2][]{mainboxstyle,colback=red!5!white,colframe=red!75!black,colbacktitle=red!75!black,title={\large #2}, -overlay={\node[overlaystyle,draw=red!75!black,fill=red!75!black] at (frame.north east) {\large \translate{Formula}{Formel}};},#1} - +% Replace some commonly used commands with better ones +\renewcommand{\vec}[1]{\overrightarrow{#1}} +\renewcommand{\hat}[1]{\widehat{#1}} +\renewcommand{\tilde}[1]{\widetilde{#1}}