From 4b77e848a6c92d69094dc0350764d16132762b08 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sat, 24 Jul 2021 12:50:14 +0200 Subject: Update HSR-Stud package --- tex/hsrstud.sty | 148 +++++++------------------------------------------------- tex/hsrzf.cls | 69 ++++++++++++++------------ 2 files changed, 54 insertions(+), 163 deletions(-) diff --git a/tex/hsrstud.sty b/tex/hsrstud.sty index a95150e..a599c16 100644 --- a/tex/hsrstud.sty +++ b/tex/hsrstud.sty @@ -77,9 +77,6 @@ prefix=hsr@ } -%% Enable backwards-compatibility -\DeclareBoolOption[false]{legacy} - %% Do not renew LaTeX Macros \DeclareBoolOption[false]{dontrenew} @@ -125,6 +122,9 @@ showstringspaces=false, % default language language=[LaTeX]TeX, + % break long lines, and show an arrow where the line was broken + breaklines=true, + postbreak=\mbox{\textcolor{hsr-blue}{$\hookrightarrow$}\space}, % font basicstyle=\ttfamily\small, identifierstyle=\color{hsr-black}, @@ -151,9 +151,8 @@ \renewcommand{\@hsrvecf}[1]{\hsrvecarrow{#1}} \fi -\ifhsr@dontrenew - \newcommand{\vc}{\@hsrvecf} -\else +\newcommand{\vc}{\@hsrvecf} +\ifhsr@dontrenew\else % save previous command \newcommand{\vaccent}{\v} \newcommand{\oldvec}{\vec} @@ -181,8 +180,7 @@ \newcommand{\cross}{\crossp} %%)) -\newcommand{\mtx}[1]{\mathrm{#1}} -\newcommand{\ten}[1]{\underline{\mathbf{\boldsymbol{#1}}}} +\newcommand{\mx}[1]{\mathbf{\boldsymbol{#1}}} \newcommand{\heq}{\stackrel{\hat{\texttt{H}}}{=}} @@ -194,39 +192,39 @@ %% Gradient (( \ifhsr@textvecdiff - \newcommand{\grad}{\text{grad }} + \DeclareMathOperator{\grad}{grad} \else - \newcommand{\grad}{\nabla}% + \DeclareMathOperator{\grad}{\nabla} \fi %% )) %% Divergence (( \ifhsr@textvecdiff - \newcommand{\@hsrdivf}{\text{div }} + \newcommand{\@hsrdivf}{div} \else \newcommand{\@hsrdivf}{\nabla\cdot} \fi -\ifhsr@dontrenew - \newcommand{\divg}{\@hsrdivf} -\else + +\DeclareMathOperator{\divg}{\@hsrdivf} +\ifhsr@dontrenew\else \let\divsymb=\div - \renewcommand{\div}{\@hsrdivf} + \renewcommand{\div}{\operatorname{\@hsrdivf}} \fi %% )) %% Curl (( \ifhsr@textvecdiff - \newcommand{\curl}{\text{curl }} + \DeclareMathOperator{\curl}{curl} \else - \newcommand{\curl}{\nabla\times} + \DeclareMathOperator{\curl}{\nabla\times} \fi %% )) %% laplacian (( \ifhsr@textvecdiff - \newcommand{\laplace}{\text{div grad }} + \DeclareMathOperator{\laplace}{div grad} \else - \newcommand{\laplace}{\nabla^2} + \DeclareMathOperator{\laplace}{\nabla^2} \fi %% )) @@ -278,118 +276,6 @@ \definecolor{hsr-black40}{HTML}{A4A2A4} \definecolor{hsr-black20}{HTML}{D1D1D1} -\ifhsr@legacy -%% Makros für Titel, Autor und Datum (( -%% Dank diesem Makro stehen Titel, Autor und Datum überall im Dokument zur verfügung -%% Date hat zudem den Default-Wert \today -\def\@Title{} -\def\@Author{} -\def\@Date{\today} -\newcommand{\Title}{\@Title} -\newcommand{\Author}{\@Author} -\newcommand{\Date}{\@Date} -\AtBeginDocument{% - \let\@Title\@title - \let\@Author\@author - \let\@Date\@date -} -%% )) - -%% Makros für den Arraystretch (( -%% bei uns meist in Tabellen genutzt, welche Formeln enthalten - -%% Default Value -\def\@ArrayStretchDefault{1} % Entspricht der Voreinstellung von Latex - -%% Setzt einen neuen Wert für den arraystretch -\newcommand{\setArrayStretch}[1]{\renewcommand{\arraystretch}{#1}} - -%% Setzt den arraystretch zurück auf den default wert -\newcommand{\resetArrayStretch}{\renewcommand{\arraystretch}{\@ArrayStretchDefault}} - -%% Makro zum setzten des Default arraystretch. -%% Kann nur in der Präambel verwendet werden. -\newcommand{\setDefaultArrayStretch}[1]{% -\AtBeginDocument{% -\def\@ArrayStretchDefault{#1} -\renewcommand{\arraystretch}{#1} -} -} -%% )) - -%% Command for images in table -\newcommand\tabImg[2][]{% - \raisebox{0pt}[\dimexpr\totalheight+\dp\strutbox\relax][\dp\strutbox]{% - \includegraphics[#1]{#2}% - }% -} - -%% Makros für Verweise auf ein Buch oder Skript (( -\newcommand{\buch}[1]{\texorpdfstring{$_{\textcolor{HSRLakeGreen}{\mbox{\small{#1}}}}$}{}} -\newcommand{\buchSeite}[1]{\texorpdfstring{\ensuremath{_{\textcolor{red}{\mbox{\small{ S#1}}}}}}{}} -\newcommand{\skript}[1]{\texorpdfstring{$_{\textcolor{HSRReed}{\mbox{\small{#1}}}}$}{}} -\newcommand{\formelbuch}[1]{$_{\textcolor{red}{\mbox{\small{S#1}}}}$} -%% )) - -\setlength{\parindent}{0pt} - -%% Todo command -\newcommand{\todo}[1]{\textbf{\color{red}{TO DO: #1}}} - -%% Color names (( -\colorlet{HSRWhite}{white} - -\colorlet{HSRBlue}{hsr-blue} -\colorlet{HSRBlue80}{hsr-blue80} -\colorlet{HSRBlue60}{hsr-blue60} -\colorlet{HSRBlue40}{hsr-blue40} -\colorlet{HSRBlue20}{hsr-blue20} - -\colorlet{HSRLightGray}{hsr-lightgrey} -\colorlet{HSRLightGray80}{hsr-lightgrey80} -\colorlet{HSRLightGray60}{hsr-lightgrey60} -\colorlet{HSRLightGray40}{hsr-lightgrey40} -\colorlet{HSRLightGray20}{hsr-lightgrey20} - -\colorlet{HSRSchwarz}{hsr-black} -\colorlet{HSRSchwarz80}{hsr-black80} -\colorlet{HSRSchwarz60}{hsr-black60} -\colorlet{HSRSchwarz40}{hsr-black40} -\colorlet{HSRSchwarz20}{hsr-black20} - -\colorlet{HSRHematite}{hsr-mauve} -\colorlet{HSRHematite80}{hsr-mauve80} -\colorlet{HSRHematite60}{hsr-mauve60} -\colorlet{HSRHematite40}{hsr-mauve40} -\colorlet{HSRHematite20}{hsr-mauve20} - -\colorlet{HSRLakeGreen}{hsr-lakegreen} -\colorlet{HSRLakeGreen80}{hsr-lakegreen80} -\colorlet{HSRLakeGreen60}{hsr-lakegreen60} -\colorlet{HSRLakeGreen40}{hsr-lakegreen40} -\colorlet{HSRLakeGreen20}{hsr-lakegreen20} - -\colorlet{HSRReed}{hsr-reed} -\colorlet{HSRReed80}{hsr-reed80} -\colorlet{HSRReed60}{hsr-reed60} -\colorlet{HSRReed40}{hsr-reed40} -\colorlet{HSRReed20}{hsr-reed20} - -\colorlet{HSRPetrol}{hsr-petrol} -\colorlet{HSRPetrol80}{hsr-petrol80} -\colorlet{HSRPetrol60}{hsr-petrol60} -\colorlet{HSRPetrol40}{hsr-petrol40} -\colorlet{HSRPetrol20}{hsr-petrol20} - -\colorlet{HSRBasswood}{hsr-basswood} -\colorlet{HSRBasswood80}{hsr-basswood80} -\colorlet{HSRBasswood60}{hsr-basswood60} -\colorlet{HSRBasswood40}{hsr-basswood40} -\colorlet{HSRBasswood20}{hsr-basswood20} -%% )) - -\fi %% ifhsr@legacy - \endinput %% %% End of file `hsrstud.sty'. diff --git a/tex/hsrzf.cls b/tex/hsrzf.cls index 66e9474..e929e8d 100644 --- a/tex/hsrzf.cls +++ b/tex/hsrzf.cls @@ -59,18 +59,17 @@ %% Class options \SetupKeyvalOptions{ - family=hsrzf, - prefix=hsrzf@ + family=hsr, + prefix=hsr@ } %% Use header and footer \DeclareBoolOption[false]{header} \DeclareComplementaryOption{noheader}{header} -%% Use a sans-serif font +%% Use a sans-serif slab-serif or concrete font \DeclareBoolOption[false]{sans} \DeclareBoolOption[false]{slab} - \DeclareBoolOption[false]{concrete} %% Configures the geometry package @@ -105,7 +104,7 @@ \fi } -\ProcessKeyvalOptions{hsrzf} +\ProcessKeyvalOptions{hsr} %% Create new metadata fields @@ -145,7 +144,7 @@ \RequirePackage{geometry} \RequirePackage{fancyhdr} \RequirePackage{titling} -% \RequirePackage{lastpage} +\RequirePackage{totpages} \RequirePackage{array} %% Insert metadata in the pdf @@ -154,13 +153,13 @@ %% Configure Sans-Serif font -\ifhsrzf@sans - \ifhsrzf@slab +\ifhsr@sans + \ifhsr@slab \PackageError{hsrzf}{% sans ans slab options cannot be used at the same time } \fi - \ifhsrzf@concrete{hsrzf}{% + \ifhsr@concrete{hsrzf}{% sans and concrete options cannot be used at the same time } \fi @@ -172,13 +171,13 @@ \fi %% Configure Slab-Serif font -\ifhsrzf@slab - \ifhsrzf@sans +\ifhsr@slab + \ifhsr@sans \PackageError{hsrzf}{% slab and sans options cannot be used at the same time } \fi - \ifhsrzf@concrete{hsrzf}{% + \ifhsr@concrete{hsrzf}{% slab and concrete options cannot be used at the same time } \fi @@ -190,12 +189,12 @@ \fi %% Configure (secret) concrete font -\ifhsrzf@concrete - \ifhsrzf@sans{hsrzf}{% +\ifhsr@concrete + \ifhsr@sans{hsrzf}{% concrete and sans options cannot be used at the same time } \fi - \ifhsrzf@slab + \ifhsr@slab \PackageError{hsrzf}{% concrete ans slab options cannot be used at the same time } @@ -212,35 +211,35 @@ \newlength{\hsr@hmarginwidth} \newlength{\hsr@vmarginheight} -\ifx\hsrzf@margin\@empty +\ifx\hsr@margin\@empty \setlength\hsr@hmarginwidth{30mm} \setlength\hsr@vmarginheight{30mm} \else - \expandafter\ifstrequal\expandafter{\hsrzf@margin}{huge}{ + \expandafter\ifstrequal\expandafter{\hsr@margin}{huge}{ \setlength\hsr@hmarginwidth{45mm} \setlength\hsr@vmarginheight{40mm}}{} %% - \expandafter\ifstrequal\expandafter{\hsrzf@margin}{large}{ + \expandafter\ifstrequal\expandafter{\hsr@margin}{large}{ \setlength\hsr@hmarginwidth{35mm} \setlength\hsr@vmarginheight{35mm}}{} %% - \expandafter\ifstrequal\expandafter{\hsrzf@margin}{big}{ + \expandafter\ifstrequal\expandafter{\hsr@margin}{big}{ \setlength\hsr@hmarginwidth{30mm} \setlength\hsr@vmarginheight{30mm}}{} %% - \expandafter\ifstrequal\expandafter{\hsrzf@margin}{normal}{ + \expandafter\ifstrequal\expandafter{\hsr@margin}{normal}{ \setlength\hsr@hmarginwidth{25mm} \setlength\hsr@vmarginheight{30mm}}{} %% - \expandafter\ifstrequal\expandafter{\hsrzf@margin}{small}{ + \expandafter\ifstrequal\expandafter{\hsr@margin}{small}{ \setlength\hsr@hmarginwidth{20mm} \setlength\hsr@vmarginheight{20mm}}{} %% - \expandafter\ifstrequal\expandafter{\hsrzf@margin}{tiny}{ + \expandafter\ifstrequal\expandafter{\hsr@margin}{tiny}{ \setlength\hsr@hmarginwidth{10mm} \setlength\hsr@vmarginheight{20mm}}{} %% - \expandafter\ifstrequal\expandafter{\hsrzf@margin}{minimal}{ + \expandafter\ifstrequal\expandafter{\hsr@margin}{minimal}{ \setlength\hsr@hmarginwidth{ 5mm} \setlength\hsr@vmarginheight{20mm}}{} %% @@ -261,27 +260,33 @@ \fancypagestyle{hsrzf}{% \fancyhf{} % clear - \fancyhead[C]{\thetitle} - \fancyhead[R]{\rightmark} \fancyhead[L]{\leftmark} - \fancyfoot[R]{\@date} - \fancyfoot[L]{\theauthor} + \fancyhead[C]{\themodule} + \fancyhead[R]{\@date} + + \fancyfoot[L]{\href{https://github.com/HSR-Stud/}{\texttt{HSR-Stud}}} + \fancyfoot[C]{\texttt{CC BY-NC-SA}} + \fancyfoot[R]{\thepage ~/ \pageref{TotPages}} + \renewcommand{\headrulewidth}{.5pt} \renewcommand{\footrulewidth}{.5pt} } \fancypagestyle{hsrzf-norulers}{% \fancyhf{} % clear - \fancyhead[C]{\thetitle} - \fancyhead[R]{\rightmark} \fancyhead[L]{\leftmark} - \fancyfoot[R]{\@date} - \fancyfoot[L]{\theauthor} + \fancyhead[C]{\themodule} + \fancyhead[R]{\@date} + + \fancyfoot[L]{\href{https://github.com/HSR-Stud/}{\texttt{HSR-Stud}}} + \fancyfoot[C]{\texttt{CC BY-NC-SA}} + \fancyfoot[R]{\thepage ~/ \pageref{TotPages}} + \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } -\ifhsrzf@header +\ifhsr@header \pagestyle{hsrzf} \fi -- cgit v1.2.1