diff --git a/src/HsH-article.cls b/src/HsH-article.cls index abb5657735105c1e84c28a3a2ab59a9895e55d50..07cf0e6a21402bf3748932c6cfaa020a5c723915 100644 --- a/src/HsH-article.cls +++ b/src/HsH-article.cls @@ -5,16 +5,16 @@ %% The original source files were: %% %% HsH-classes.dtx (with options: `article') -%% +%% %% Copyright (C) 2024 by Jan Wille <mail@janiwlle.de> -%% +%% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License (LPPL), either %% version 1.3c of this license or (at your option) any later %% version. The latest version of this license is in the file: -%% +%% %% http://www.latex-project.org/lppl.txt -%% +%% \NeedsTeXFormat{LaTeX2e}[2022-06-01] \ProvidesClass{HsH-article} [2024-04-23 3.00 HsH-class based on KOMA] @@ -171,7 +171,7 @@ \RequirePackage[main=\HsH@opt@language]{babel} \RequirePackage[autostyle=true]{csquotes} \MakeOuterQuote{"} -\iflanguage{ngerman}{\RequirePackage{ziffer}}{}% +\iflanguage{ngerman}{\RequirePackage{ziffer}}{} \RequirePackage[hidelinks]{hyperref} % must load before `bookmarks' \RequirePackage{bookmark} \AtBeginDocument{ @@ -199,7 +199,6 @@ \RequirePackage{graphicx} \RequirePackage{amsmath,amssymb,amsfonts} \RequirePackage[svgnames]{xcolor} -\RequirePackage{scrhack} \PassOptionsToPackage{backend=biber}{biblatex} \AtBeginDocument{ \makeatletter @@ -209,6 +208,26 @@ \makeatother } \PassOptionsToPackage{free-standing-units}{siunitx} +\AtBeginDocument{ + \makeatletter + \@ifpackageloaded{siunitx}{ + \iflanguage{ngerman}{ + \sisetup{output-decimal-marker={,}} + }{} + }{} + \makeatother +} +\RequirePackage{scrhack} +\AtBeginDocument{ + \makeatletter + \@ifpackageloaded{biblatex}{ + \RequirePackage{lstautogobble}\lstset{autogobble=true} + \iflanguage{ngerman}{ + \lstset{literate={Ö}{{\"O}}1{Ä}{{\"A}}1{Ü}{{\"U}}1{ß}{{\ss}}1{ü}{{\"u}}1{ä}{{\"a}}1{ö}{{\"o}}1} + }{} + }{} + \makeatother +} \PassOptionsToPackage{european,EFvoltages,straightvoltages,betterproportions}{circuitikz} \AtBeginDocument{ \makeatletter diff --git a/src/HsH-classes.cfg b/src/HsH-classes.cfg index c3a352fba9e26336ecd68211e67d8b836f91a191..5b8947308fc113ed485cc42017513af8af1561a1 100644 --- a/src/HsH-classes.cfg +++ b/src/HsH-classes.cfg @@ -14,9 +14,6 @@ } }{} \@ifpackageloaded{siunitx}{ - \iflanguage{ngerman}{ - \sisetup{output-decimal-marker={,}} % use comma as dezimal - }{}% \sisetup{ tight-spacing=true, per-mode=symbol, @@ -27,9 +24,6 @@ } }{} \@ifpackageloaded{listings}{ - \PassOptionsToPackage{svgnames}{xcolor} - \RequirePackage{xcolor} - \RequirePackage{lstautogobble} \lstset{ commentstyle=\color{gray}, keywordstyle=\color{FireBrick}\bfseries, @@ -37,9 +31,7 @@ showstringspaces=false, basicstyle=\ttfamily, tabsize=4, - literate={Ö}{{\"O}}1{Ä}{{\"A}}1{Ü}{{\"U}}1{ß}{{\ss}}1{ü}{{\"u}}1{ä}{{\"a}}1{ö}{{\"o}}1, escapeinside={(*@}{@*)}, - autogobble=true, } }{} \@ifpackageloaded{enumitem}{ diff --git a/src/HsH-classes.dtx b/src/HsH-classes.dtx index 13cf50c6d4aa6ffcb197c81fdf9dd5bf503cdaaf..24148ae1f2d9f9eaad9673d57bbf21c05be2d3dd 100644 --- a/src/HsH-classes.dtx +++ b/src/HsH-classes.dtx @@ -861,7 +861,7 @@ http://www.latex-project.org/lppl.txt % replacing it with some whitespace on printed version. Luckily loading the % \pkg{ziffer} package sets this up to match the german standart. % \begin{macrocode} -\iflanguage{ngerman}{\RequirePackage{ziffer}}{}% +\iflanguage{ngerman}{\RequirePackage{ziffer}}{} % \end{macrocode} % % @@ -908,12 +908,6 @@ http://www.latex-project.org/lppl.txt \RequirePackage[svgnames]{xcolor} % \end{macrocode} % -% For better compatibility with the \pkg{listings} package we load the -% \pkg{scrhack} package. -% \begin{macrocode} -\RequirePackage{scrhack} -% \end{macrocode} -% % \subsubsection{Options for packages that could be loaded by the user} % Some package are not always needed and potentially heavy to load in by default. % But its still usefull to set default options for these packagese. @@ -921,6 +915,9 @@ http://www.latex-project.org/lppl.txt % These differ from the settings provided in |HsH-classes.cfg| in that they are % defaults that apply allway and not user-configurable preferences which are user % or even project specific. +% +% For the \pkg{bibtex} we ensure the \emph{biber} backend is selcted, which matches +% the settings in |.latexmkrc|. % \begin{macrocode} %<*article|report> \PassOptionsToPackage{backend=biber}{biblatex} @@ -932,7 +929,41 @@ http://www.latex-project.org/lppl.txt \makeatother } %</article|report> +% \end{macrocode} +% +% For \pkg{bibtex} we load the free-stadnding units, mostly for backwards compatibility. +% We also ensure german language specific settings are applyed. +% \begin{macrocode} \PassOptionsToPackage{free-standing-units}{siunitx} +\AtBeginDocument{ + \makeatletter + \@ifpackageloaded{siunitx}{ + \iflanguage{ngerman}{ + \sisetup{output-decimal-marker={,}} + }{} + }{} + \makeatother +} +% \end{macrocode} +% +% For better compatibility with the \pkg{listings} package we load the +% \pkg{scrhack} package. We also pass some configurations to if if it gets loaded. +% \begin{macrocode} +\RequirePackage{scrhack} +\AtBeginDocument{ + \makeatletter + \@ifpackageloaded{biblatex}{ + \RequirePackage{lstautogobble}\lstset{autogobble=true} + \iflanguage{ngerman}{ + \lstset{literate={Ö}{{\"O}}1{Ä}{{\"A}}1{Ü}{{\"U}}1{ß}{{\ss}}1{ü}{{\"u}}1{ä}{{\"a}}1{ö}{{\"o}}1} + }{} + }{} + \makeatother +} +% \end{macrocode} +% +% The \pkg{circuitikz} needs bo be configure so it matches typical european styles. +% \begin{macrocode} \PassOptionsToPackage{european,EFvoltages,straightvoltages,betterproportions}{circuitikz} % \end{macrocode} % diff --git a/src/HsH-classes.pdf b/src/HsH-classes.pdf index 593cecaf0968943fa3e2613563162ab220ae10f0..c46cf0c68a01ff07c208adcea73db768c3f002e4 100644 --- a/src/HsH-classes.pdf +++ b/src/HsH-classes.pdf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9fc4c73ce94b87b806dc3dab2f1d830277c372596b61e94d7c72ee647905a2f4 -size 310671 +oid sha256:5511976d0dbcde0b1cf2b63aaf4467734dc03f8c8574781d19cc506504445c63 +size 312970 diff --git a/src/HsH-report.cls b/src/HsH-report.cls index e80866519a9880d064b5055b59a9e79af9d165fe..3548b21bd5f3128dae2cbc6383000e43bf138199 100644 --- a/src/HsH-report.cls +++ b/src/HsH-report.cls @@ -5,16 +5,16 @@ %% The original source files were: %% %% HsH-classes.dtx (with options: `report') -%% +%% %% Copyright (C) 2024 by Jan Wille <mail@janiwlle.de> -%% +%% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License (LPPL), either %% version 1.3c of this license or (at your option) any later %% version. The latest version of this license is in the file: -%% +%% %% http://www.latex-project.org/lppl.txt -%% +%% \NeedsTeXFormat{LaTeX2e}[2022-06-01] \ProvidesClass{HsH-report} [2024-04-23 3.00 HsH-class based on KOMA] @@ -171,7 +171,7 @@ \RequirePackage[main=\HsH@opt@language]{babel} \RequirePackage[autostyle=true]{csquotes} \MakeOuterQuote{"} -\iflanguage{ngerman}{\RequirePackage{ziffer}}{}% +\iflanguage{ngerman}{\RequirePackage{ziffer}}{} \RequirePackage[hidelinks]{hyperref} % must load before `bookmarks' \RequirePackage{bookmark} \AtBeginDocument{ @@ -199,7 +199,6 @@ \RequirePackage{graphicx} \RequirePackage{amsmath,amssymb,amsfonts} \RequirePackage[svgnames]{xcolor} -\RequirePackage{scrhack} \PassOptionsToPackage{backend=biber}{biblatex} \AtBeginDocument{ \makeatletter @@ -209,6 +208,26 @@ \makeatother } \PassOptionsToPackage{free-standing-units}{siunitx} +\AtBeginDocument{ + \makeatletter + \@ifpackageloaded{siunitx}{ + \iflanguage{ngerman}{ + \sisetup{output-decimal-marker={,}} + }{} + }{} + \makeatother +} +\RequirePackage{scrhack} +\AtBeginDocument{ + \makeatletter + \@ifpackageloaded{biblatex}{ + \RequirePackage{lstautogobble}\lstset{autogobble=true} + \iflanguage{ngerman}{ + \lstset{literate={Ö}{{\"O}}1{Ä}{{\"A}}1{Ü}{{\"U}}1{ß}{{\ss}}1{ü}{{\"u}}1{ä}{{\"a}}1{ö}{{\"o}}1} + }{} + }{} + \makeatother +} \PassOptionsToPackage{european,EFvoltages,straightvoltages,betterproportions}{circuitikz} \AtBeginDocument{ \makeatletter diff --git a/src/HsH-standalone.cls b/src/HsH-standalone.cls index cfcfa1540c5a0c0f20b548c01fcd68afe35a6d22..04decc2c31f8364c5c497209c8a53f923cb3a96e 100644 --- a/src/HsH-standalone.cls +++ b/src/HsH-standalone.cls @@ -5,16 +5,16 @@ %% The original source files were: %% %% HsH-classes.dtx (with options: `standalone') -%% +%% %% Copyright (C) 2024 by Jan Wille <mail@janiwlle.de> -%% +%% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License (LPPL), either %% version 1.3c of this license or (at your option) any later %% version. The latest version of this license is in the file: -%% +%% %% http://www.latex-project.org/lppl.txt -%% +%% \NeedsTeXFormat{LaTeX2e}[2022-06-01] \ProvidesClass{HsH-standalone} [2024-04-23 3.00 HsH-class based on KOMA] @@ -104,7 +104,7 @@ \RequirePackage[main=\HsH@opt@language]{babel} \RequirePackage[autostyle=true]{csquotes} \MakeOuterQuote{"} -\iflanguage{ngerman}{\RequirePackage{ziffer}}{}% +\iflanguage{ngerman}{\RequirePackage{ziffer}}{} \RequirePackage[hidelinks]{hyperref} % must load before `bookmarks' \RequirePackage{bookmark} \AtBeginDocument{ @@ -132,8 +132,27 @@ \RequirePackage{graphicx} \RequirePackage{amsmath,amssymb,amsfonts} \RequirePackage[svgnames]{xcolor} -\RequirePackage{scrhack} \PassOptionsToPackage{free-standing-units}{siunitx} +\AtBeginDocument{ + \makeatletter + \@ifpackageloaded{siunitx}{ + \iflanguage{ngerman}{ + \sisetup{output-decimal-marker={,}} + }{} + }{} + \makeatother +} +\RequirePackage{scrhack} +\AtBeginDocument{ + \makeatletter + \@ifpackageloaded{biblatex}{ + \RequirePackage{lstautogobble}\lstset{autogobble=true} + \iflanguage{ngerman}{ + \lstset{literate={Ö}{{\"O}}1{Ä}{{\"A}}1{Ü}{{\"U}}1{ß}{{\ss}}1{ü}{{\"u}}1{ä}{{\"a}}1{ö}{{\"o}}1} + }{} + }{} + \makeatother +} \PassOptionsToPackage{european,EFvoltages,straightvoltages,betterproportions}{circuitikz} \AtBeginDocument{ \makeatletter diff --git a/test.pdf b/test.pdf index bcb14ffd00546c305ea11344c312e6a80d0129d2..e849b842d637608515e1fc038d2b25248ce31ff8 100644 --- a/test.pdf +++ b/test.pdf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9d5d9728aa5d9aec8d3dade86e36576ddc5b5bbbb44c71e5f2e0d3bf72e8c0a5 -size 192319 +oid sha256:840ea5ae3c85ee50216c6d560b7c9cdd83562b569a438ee6ff26d264d5387f96 +size 193375 diff --git a/test.tex b/test.tex index 7c43a7b3ead61141fb1e03b8cb802658695c87a9..64a6726bb52f3d45a5d3808e05db05dd127787cf 100644 --- a/test.tex +++ b/test.tex @@ -1,6 +1,7 @@ \documentclass[todos=off]{HsH-report} \usepackage{lipsum} +\usepackage{siunitx} % \usepackage{showframe} %% documents personal data: @@ -40,6 +41,11 @@ A_1 = \sum_{i=0}^{10} B_i + \abs{\frac{x}{2}} \end{equation} + \begin{equation} + \frac{4\,\m}{12\,\s} = \frac{1}{3}\,\unit{m\per s} + \end{equation} + + \begin{itemize} \item Hello World \item test