about summary refs log tree commit diff stats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xcommon/inits/latex/init.local44
-rw-r--r--common/latex/preamble.tex2
-rw-r--r--common/latex/preamble/academia/theorems/definitions.tex2
-rw-r--r--common/latex/preamble/academia/theorems/mod.tex2
-rw-r--r--common/latex/preamble/core/bable.tex1
-rw-r--r--common/latex/preamble/core/graphics_and_floats.tex2
-rw-r--r--common/latex/preamble/core/math.tex14
-rw-r--r--common/latex/preamble/core/mod.tex1
-rw-r--r--common/latex/preamble/core/notes.tex2
-rw-r--r--common/latex/preamble/core/references.tex8
10 files changed, 62 insertions, 16 deletions
diff --git a/common/inits/latex/init.local b/common/inits/latex/init.local
index ae57756..123e349 100755
--- a/common/inits/latex/init.local
+++ b/common/inits/latex/init.local
@@ -21,8 +21,50 @@ de_DE | de_*)
     ;;
 esac
 
+if [ "$bable_language" = "british" ]; then
+    todonotes_language="english"
+else
+    todonotes_language="$bable_language"
+fi
+
+siunitx_language=""
+# locales UK, US, DE (Germany), PL (Poland), FR (French), SI (Slovene) and ZA (South Africa).
+case "$LANGUAGE" in
+"en_GB")
+    siunitx_language="UK" # United Kingdom
+    ;;
+"en_US")
+    siunitx_language="US" # United States of Amerika
+    ;;
+en_ZA)
+    siunitx_language="ZA" # South Africa
+    ;;
+en_*)
+    echo "'$LANGUAGE' is not yet recognized! But it seems english, thus we set SIUNITX_LANGUAGE='UK'."
+    siunitx_language="UK"
+    ;;
+de_DE)
+    siunitx_language="DE" # Germany
+    ;;
+pl_PL)
+    siunitx_language="PL" # Poland
+    ;;
+fr_FR)
+    siunitx_language="FR" # French
+    ;;
+sl_SL)
+    siunitx_language="SI" # Slovene
+    ;;
+*)
+    echo "'$LANGUAGE' is not yet recognized by the init.local script! Please open an issue." 1>&2
+    echo "set 'SIUNITX_LANGUAGE' to 'NOT_YET_RECOGNIZED_PLEASE_REPLACE' to help you find instances of the variable use." 1>&2
+    siunitx_language="NOT_YET_RECOGNIZED_PLEASE_REPLACE"
+    ;;
+esac
+
 prompt BABLE_LANGUAGE "The language to use for the bable package" "$bable_language" "dont_ask"
 prompt DATE_TIME_LANGUAGE "The language to use for the datetime2 package" "$(echo "$LANGUAGE" | sed 's/_/-/g')" "dont_ask"
-prompt SIUNITX_LANGUAGE "The language to use for the siunitx package" "$(echo "$LANGUAGE" | sed 's/\(\w\w\).*/\U\1/')" "dont_ask"
+prompt SIUNITX_LANGUAGE "The language to use for the siunitx package" "$siunitx_language" "dont_ask"
+prompt TODONOTES_LANGUAGE "The language to use for the todonotes package" "$todonotes_language" "dont_ask"
 
 # vim: ft=sh
diff --git a/common/latex/preamble.tex b/common/latex/preamble.tex
index 110e3a0..d45262a 100644
--- a/common/latex/preamble.tex
+++ b/common/latex/preamble.tex
@@ -1,2 +1,2 @@
 \input{headers/preamble/mod.tex}
-\input{headers/preamble/preamble_local.tex}
+\input{headers/preamble_local.tex}
diff --git a/common/latex/preamble/academia/theorems/definitions.tex b/common/latex/preamble/academia/theorems/definitions.tex
index 4355b3c..3179dd9 100644
--- a/common/latex/preamble/academia/theorems/definitions.tex
+++ b/common/latex/preamble/academia/theorems/definitions.tex
@@ -1,4 +1,4 @@
-\renewcommand\qedsymbol{\ensuremath{\text{\textit{O.}}~\epsilon.~\delta.}}
+\RenewDocumentCommand\qedsymbol{}{\ensuremath{\text{\textit{O.}}~\epsilon.~\delta.}}
 % \renewcommand\qedsymbol{\dots}
 
 \theoremstyle{definition}
diff --git a/common/latex/preamble/academia/theorems/mod.tex b/common/latex/preamble/academia/theorems/mod.tex
index 8350276..d0f801c 100644
--- a/common/latex/preamble/academia/theorems/mod.tex
+++ b/common/latex/preamble/academia/theorems/mod.tex
@@ -1,2 +1,2 @@
-\input{headers/preamble/academia/theorems/definitions.tex}
 \input{headers/preamble/academia/theorems/packages.tex}
+\input{headers/preamble/academia/theorems/definitions.tex}
diff --git a/common/latex/preamble/core/bable.tex b/common/latex/preamble/core/bable.tex
new file mode 100644
index 0000000..f034018
--- /dev/null
+++ b/common/latex/preamble/core/bable.tex
@@ -0,0 +1 @@
+\usepackage[%INIT_BABLE_LANGUAGE]{babel} % For language support
diff --git a/common/latex/preamble/core/graphics_and_floats.tex b/common/latex/preamble/core/graphics_and_floats.tex
index b975c5f..c0784c9 100644
--- a/common/latex/preamble/core/graphics_and_floats.tex
+++ b/common/latex/preamble/core/graphics_and_floats.tex
@@ -5,7 +5,7 @@
 \usetikzlibrary{calc}
 
 \usepackage{pgfplots} % plots, 2D and 3D
-\pgfplotsset{compat=1.19} % Set a compatibility level, to be able to use the new versions
+\pgfplotsset{compat=1.18} % Set a compatibility level, to be able to use the new versions
 
 \usetikzlibrary{external}
 \tikzexternalize[prefix=figures/, mode=list and make]
diff --git a/common/latex/preamble/core/math.tex b/common/latex/preamble/core/math.tex
index 35144df..170f57a 100644
--- a/common/latex/preamble/core/math.tex
+++ b/common/latex/preamble/core/math.tex
@@ -12,14 +12,16 @@
 \NewDocumentCommand\Z{}{\ensuremath{\mathbb{Z}}}
 \NewDocumentCommand\Q{}{\ensuremath{\mathbb{Q}}}
 \NewDocumentCommand\C{}{\ensuremath{\mathbb{C}}}
-\NewDocumentCommand\O{}{\ensuremath{\emptyset}} % replaces the Ø
+\let\originalO\O
+\RenewDocumentCommand\O{}{\ensuremath{\emptyset}} % replaces the Ø
 
 % readable limits
-\let\svlim\lim{}
-\renewcommand\lim{\svlim\limits}
+\let\originalLim\lim
+\RenewDocumentCommand\lim{}{\originalLim\limits}
 
 % aliases
-\let\implies\Rightarrow{}
-\let\impliedby\Leftarrow{}
+\let\implies\Rightarrow
+\let\impliedby\Leftarrow
 
-\let\epsilon{\varepsilon} % I like the textual epsilon more
+\let\originalEpsilon\epsilon
+\RenewDocumentCommand\epsilon{}{\varepsilon} % I like the textual epsilon more
diff --git a/common/latex/preamble/core/mod.tex b/common/latex/preamble/core/mod.tex
index 3a800a1..403ce58 100644
--- a/common/latex/preamble/core/mod.tex
+++ b/common/latex/preamble/core/mod.tex
@@ -1,6 +1,7 @@
 % Core packages (used in the implementation of this preamble)
 \usepackage{ifdraft}
 
+\input{headers/preamble/core/bable.tex}
 \input{headers/preamble/core/chemistry.tex}
 \input{headers/preamble/core/copyright.tex}
 \input{headers/preamble/core/date_and_time.tex}
diff --git a/common/latex/preamble/core/notes.tex b/common/latex/preamble/core/notes.tex
index 8eab467..1f10ef3 100644
--- a/common/latex/preamble/core/notes.tex
+++ b/common/latex/preamble/core/notes.tex
@@ -1 +1 @@
-\usepackage[obeyFinal,%INIT_BABLE_LANGUAGE]{todonotes}
+\usepackage[obeyFinal,%INIT_TODONOTES_LANGUAGE]{todonotes}
diff --git a/common/latex/preamble/core/references.tex b/common/latex/preamble/core/references.tex
index 69a6ad6..e42b22f 100644
--- a/common/latex/preamble/core/references.tex
+++ b/common/latex/preamble/core/references.tex
@@ -1,4 +1,3 @@
-\usepackage[%INIT_BABLE_LANGUAGE]{babel} % For language support
 \usepackage{csquotes} % required by biblatex
 
 % \usepackage{biblatex-dw}
@@ -20,8 +19,6 @@
 \addbibresource{ref/references.bib}
 % \bibliography{res/reference} % Set the location of the references
 
-\usepackage[nospace,%INIT_BABLE_LANGUAGE]{varioref} % for \vref
-\usepackage[%INIT_BABLE_LANGUAGE, noabbrev, nameinlink]{cleveref}
 \usepackage[pdflang=%INIT_DATE_TIME_LANGUAGE]{hyperref}
 \hypersetup{
 	colorlinks,
@@ -30,8 +27,11 @@
 	urlcolor={blue!80!black}
 }
 
+\usepackage[nospace,%INIT_TODONOTES_LANGUAGE]{varioref} % for \vref
+\usepackage[%INIT_TODONOTES_LANGUAGE, noabbrev, nameinlink]{cleveref}
+
 \ifdraft{
 	\usepackage{showlabels}
 } {
-	\message {Draft packages not loaded, showlabels not loaded.}
+	\message {Draft packages not loaded, 'showlabels' not loaded.}
 }