diff --git a/CHANGELOG.md b/CHANGELOG.md index 0edcb9e9f69aa55eed95b395b818bb8d2c5bd201..edd2a30d981cbd783ba49430f34b736b0755d215 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. ## [Current] +### Added + +- autogobble option for `listings`, which automaticly determins the indentation width and gooble it up, removing the need to put `gobble=n` manually + every time. (#8) +- `todos` class-option. Loads the `todos` package if present but also redefines its commands to have no effect when this option is omitted. Also + changes the margins to make space for the todo-notes. + ### Changed - `\title` now accepts an optional argument. It will be used as a short version of the title and will be put into the header. @@ -54,7 +61,7 @@ All notable changes to this project will be documented in this file. ## [1.1] - 2021-04-22 -This version provides mostly minor fixed and upgrades. +This version provides mostly minor fixed and upgrades. **IMPORTANT:** the `personal.tex` has been removed ### Added diff --git a/README.md b/README.md index 1556f42316dc53df6768ec556f66c491d73c2ecd..28dc4f59e5fc797644c033d171d5bf4e8ad5cd8d 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,9 @@ If you don't define something different, the classes set your project up to use keep the page numbering consistent with the original. - `sans` This option sets the font family to Sans Serif. - `roman` The opposite of `sans`, sets a roman/serif font. +- `todos` This enables the [`todonotes`](http://tug.ctan.org/macros/latex/contrib/todonotes/todonotes.pdf) package and allows you to use the `\todo{}` + command. It is set up in a way that removing this option allows you to still leave `\todos`'s in your code without breaking. DO NOT combine this + with the `twoside` option! All remaining options are passed along to the respective subclasses and processed there. This means, that you can use all the options described in their respective documentations. diff --git a/src/HsH-article.cls b/src/HsH-article.cls index af8be928a1b28040574da73f9e4f06cdca215eb7..b58cf143e4e0d70fde9d8fceb59e8afed7609da6 100644 --- a/src/HsH-article.cls +++ b/src/HsH-article.cls @@ -5,21 +5,21 @@ %% The original source files were: %% %% HsH-classes.dtx (with options: `article') -%% +%% %% This is a generated file. -%% +%% %% Copyright (C) 2021 by Jan Wille <mail@janwille.de> -%% +%% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3 of this license %% or (at your option) any later version. The latest version of this %% license is in: -%% +%% %% http://www.latex-project.org/lppl.txt -%% +%% %% and version 1.3 or later is part of all distributions of LaTeX version %% 2021/01/01 or later. -%% +%% \typeout{Adapted from KOMA script for use in Hochschule Hannover <2022-03-28> Jan Wille} \NeedsTeXFormat{LaTeX2e} \newcommand{\myClassName}{HsH-article} @@ -30,6 +30,7 @@ \newcommand{\HsHlogoPage}{1} \newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}} \newif\if@german% +\newif\if@todos\@todosfalse% %% document options ------------------------------------------------------------------------------- \DeclareOption{german}{ @@ -62,6 +63,9 @@ \DeclareOption{roman}{ \renewcommand{\familydefault}{\rmdefault} } +\DeclareOption{todos}{ + \@todostrue +} \DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrartcl}} \ExecuteOptions{fontsize=11pt,a4paper,ngerman,sans} % default options \ProcessOptions\relax @@ -78,7 +82,11 @@ \RequirePackage{graphicx} \RequirePackage{amsmath} \if@german\RequirePackage{ziffer}\fi -\PassOptionsToPackage{left=3cm,right=2.5cm,top=3cm,bottom=3cm}{geometry} +\if@todos + \PassOptionsToPackage{left=1cm,right=5cm,top=3cm,bottom=3cm}{geometry} +\else + \PassOptionsToPackage{left=3cm,right=2.5cm,top=3cm,bottom=3cm}{geometry} +\fi \RequirePackage{geometry} \if@german\PassOptionsToPackage{ngerman}{babel}\else\PassOptionsToPackage{english}{babel}\fi \RequirePackage{babel} @@ -94,6 +102,20 @@ \if@german\PassOptionsToPackage{german=quotes}{csquotes}\fi \RequirePackage{csquotes} \MakeOuterQuote{"} +\if@todos + \PassOptionsToPackage{svgnames}{xcolor} + \PassOptionsToPackage{ + textwidth=4.5cm, + textsize=small, + figwidth=.6\textwidth + }{todonotes} + \RequirePackage{todonotes} + \setlength{\marginparwidth}{5.2cm} +\else + \newcommand{\listoftodos}[1][]{} + \newcommand{\todo}[2][]{} + \newcommand{\missingfigure}[2][]{} +\fi \RequirePackage{pgffor} %% options for not loaded packages ---------------------------------------------------------------- \PassOptionsToPackage{backend=biber,style=alphabetic,sorting=nyt}{biblatex} @@ -118,12 +140,13 @@ %% typesetting indexes upright or standart \def\subinrm#1{\sb{\mathrm{#1}}} {\catcode`\_=13 \global\let_=\subinrm} -\mathcode`_="8000 \newcommand\upsubscripts{\catcode`\_=12 } \newcommand\normalsubscripts{\catcode`\_=8 } \upsubscripts %% header and footer +\clearpairofpagestyles +\cfoot*{\pagemark} \newpagestyle{HsHheadings}{ { \parbox[b]{\sls@headwidth}{ @@ -131,14 +154,22 @@ \ifx\@shorttitle\@empty\@title\else\@shorttitle\fi }% } - {\parbox[b]{\sls@headwidth}{\LaTeXraggedleft\leftmark}} + { + \parbox[b]{\sls@headwidth}{ + \LaTeXraggedleft + \leftmark + }% + } { \parbox[b]{.45\sls@headwidth}{ \LaTeXraggedright \ifx\@shorttitle\@empty\@title\else\@shorttitle\fi }% \hfill - \parbox[b]{.45\sls@headwidth}{\LaTeXraggedleft\headmark}% + \parbox[b]{.45\sls@headwidth}{ + \LaTeXraggedleft + \headmark + }% } (\textwidth,.1pt) }{ diff --git a/src/HsH-report.cls b/src/HsH-report.cls index ac8a96207059ad94f12c68ef0f531e5871d107d8..cbde0a7153e5ec1ee1835ef00d77a557fcd67eab 100644 --- a/src/HsH-report.cls +++ b/src/HsH-report.cls @@ -5,21 +5,21 @@ %% The original source files were: %% %% HsH-classes.dtx (with options: `report') -%% +%% %% This is a generated file. -%% +%% %% Copyright (C) 2021 by Jan Wille <mail@janwille.de> -%% +%% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3 of this license %% or (at your option) any later version. The latest version of this %% license is in: -%% +%% %% http://www.latex-project.org/lppl.txt -%% +%% %% and version 1.3 or later is part of all distributions of LaTeX version %% 2021/01/01 or later. -%% +%% \typeout{Adapted from KOMA script for use in Hochschule Hannover <2022-03-28> Jan Wille} \NeedsTeXFormat{LaTeX2e} \newcommand{\myClassName}{HsH-report} @@ -30,6 +30,7 @@ \newcommand{\HsHlogoPage}{1} \newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}} \newif\if@german% +\newif\if@todos\@todosfalse% %% document options ------------------------------------------------------------------------------- \DeclareOption{german}{ @@ -62,6 +63,9 @@ \DeclareOption{roman}{ \renewcommand{\familydefault}{\rmdefault} } +\DeclareOption{todos}{ + \@todostrue +} \DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrreprt}} \ExecuteOptions{fontsize=11pt,a4paper,ngerman,sans} % default options \ProcessOptions\relax @@ -78,7 +82,11 @@ \RequirePackage{graphicx} \RequirePackage{amsmath} \if@german\RequirePackage{ziffer}\fi -\PassOptionsToPackage{left=3cm,right=2.5cm,top=3cm,bottom=3cm}{geometry} +\if@todos + \PassOptionsToPackage{left=1cm,right=5cm,top=3cm,bottom=3cm}{geometry} +\else + \PassOptionsToPackage{left=3cm,right=2.5cm,top=3cm,bottom=3cm}{geometry} +\fi \RequirePackage{geometry} \if@german\PassOptionsToPackage{ngerman}{babel}\else\PassOptionsToPackage{english}{babel}\fi \RequirePackage{babel} @@ -94,6 +102,20 @@ \if@german\PassOptionsToPackage{german=quotes}{csquotes}\fi \RequirePackage{csquotes} \MakeOuterQuote{"} +\if@todos + \PassOptionsToPackage{svgnames}{xcolor} + \PassOptionsToPackage{ + textwidth=4.5cm, + textsize=small, + figwidth=.6\textwidth + }{todonotes} + \RequirePackage{todonotes} + \setlength{\marginparwidth}{5.2cm} +\else + \newcommand{\listoftodos}[1][]{} + \newcommand{\todo}[2][]{} + \newcommand{\missingfigure}[2][]{} +\fi \RequirePackage{pgffor} %% options for not loaded packages ---------------------------------------------------------------- \PassOptionsToPackage{backend=biber,style=alphabetic,sorting=nyt}{biblatex} @@ -118,12 +140,13 @@ %% typesetting indexes upright or standart \def\subinrm#1{\sb{\mathrm{#1}}} {\catcode`\_=13 \global\let_=\subinrm} -\mathcode`_="8000 \newcommand\upsubscripts{\catcode`\_=12 } \newcommand\normalsubscripts{\catcode`\_=8 } \upsubscripts %% header and footer +\clearpairofpagestyles +\ofoot*{\pagemark} \newpagestyle{HsHheadings}{ { \parbox[b]{\sls@headwidth}{ @@ -131,14 +154,22 @@ \ifx\@shorttitle\@empty\@title\else\@shorttitle\fi }% } - {\parbox[b]{\sls@headwidth}{\LaTeXraggedleft\leftmark}} + { + \parbox[b]{\sls@headwidth}{ + \LaTeXraggedleft + \leftmark + }% + } { \parbox[b]{.45\sls@headwidth}{ \LaTeXraggedright \ifx\@shorttitle\@empty\@title\else\@shorttitle\fi }% \hfill - \parbox[b]{.45\sls@headwidth}{\LaTeXraggedleft\headmark}% + \parbox[b]{.45\sls@headwidth}{ + \LaTeXraggedleft + \headmark + }% } (\textwidth,.1pt) }{ diff --git a/src/HsH-standalone.cls b/src/HsH-standalone.cls index 3ff2d255847a432addd6f9aab6b38c9aba68d60e..1bdde11ad66ca79e99d082ea439c0ea1cb5356fb 100644 --- a/src/HsH-standalone.cls +++ b/src/HsH-standalone.cls @@ -5,21 +5,21 @@ %% The original source files were: %% %% HsH-classes.dtx (with options: `standalone') -%% +%% %% This is a generated file. -%% +%% %% Copyright (C) 2021 by Jan Wille <mail@janwille.de> -%% +%% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3 of this license %% or (at your option) any later version. The latest version of this %% license is in: -%% +%% %% http://www.latex-project.org/lppl.txt -%% +%% %% and version 1.3 or later is part of all distributions of LaTeX version %% 2021/01/01 or later. -%% +%% \typeout{Adapted from KOMA script for use in Hochschule Hannover <2022-03-28> Jan Wille} \NeedsTeXFormat{LaTeX2e} \newcommand{\myClassName}{HsH-standalone} @@ -84,7 +84,6 @@ %% typesetting indexes upright or standart \def\subinrm#1{\sb{\mathrm{#1}}} {\catcode`\_=13 \global\let_=\subinrm} -\mathcode`_="8000 \newcommand\upsubscripts{\catcode`\_=12 } \newcommand\normalsubscripts{\catcode`\_=8 } \upsubscripts diff --git a/src/config.tex b/src/config.tex index a41def46aa2a227d458909dfda5e15842539613a..59d28f2e02e07f1aa05bf6d525a0cb3bdf1e7fd7 100644 --- a/src/config.tex +++ b/src/config.tex @@ -17,6 +17,13 @@ isbn=false, } }{} +\@ifpackageloaded{todonotes}{ + \setuptodonotes{ + backgroundcolor=orange!60!white, + linecolor=orange, + bordercolor=white + } +}{} \@ifpackageloaded{siunitx}{ \if@german \sisetup{output-decimal-marker={,}} % use comma as dezimal @@ -33,6 +40,7 @@ \@ifpackageloaded{listings}{ \PassOptionsToPackage{svgnames}{xcolor} \RequirePackage{xcolor} + \RequirePackage{lstautogobble} \lstset{ commentstyle=\color{gray}, keywordstyle=\color{FireBrick}\bfseries, @@ -42,6 +50,7 @@ tabsize=4, literate={Ö}{{\"O}}1{Ä}{{\"A}}1{Ü}{{\"U}}1{ß}{{\ss}}1{ü}{{\"u}}1{ä}{{\"a}}1{ö}{{\"o}}1, escapeinside={(*@}{@*)}, + autogobble=true, } }{} \@ifpackageloaded{enumitem}{