about summary refs log tree commit diff stats
path: root/common/inits/latex/init.local
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-10-03 13:20:43 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-10-03 13:20:43 +0200
commit55d71819679b20c2d26557d94eae6b505becaf6e (patch)
treefdc496aca7997b917668e5787514e2d157b67597 /common/inits/latex/init.local
parentchore(build): Re-generate (diff)
downloadflake-templates-55d71819679b20c2d26557d94eae6b505becaf6e.tar.gz
flake-templates-55d71819679b20c2d26557d94eae6b505becaf6e.zip
fix(common/latex/preamble): Fix compilation errors
Diffstat (limited to '')
-rwxr-xr-xcommon/inits/latex/init.local44
1 files changed, 43 insertions, 1 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