From 509e25ae9453e4aa5c8dd3afdbadf0f1924f976c Mon Sep 17 00:00:00 2001 From: Jan Wille <jan.wille@stud.hs-hannover.de> Date: Mon, 28 Mar 2022 17:09:21 +0200 Subject: [PATCH] define front-, main- and backmatter --- CHANGELOG.md | 3 +++ HsH-classes.dtx | 17 +++++++++++++++++ src/HsH-report.cls | 14 ++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index baef11b..d829684 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. ## [Current] +### Added +- defined `\fronmatter`, `\mainmatter` and `\backmatter` for HsH-report class + ## [1.3] - 2022-03-07 diff --git a/HsH-classes.dtx b/HsH-classes.dtx index f97a009..0aaad61 100644 --- a/HsH-classes.dtx +++ b/HsH-classes.dtx @@ -210,6 +210,23 @@ % rulers when using draft disabled \renewcommand{\layercontentsmeasure}{\@empty} +%<*report> +% these commands are only defined for the book class, but they also make sens for the report class: +%% define easy shorthands to switch pagenumbering +\newif\if@mainmatter\@mainmattertrue +\newcommand*\frontmatter{% + \if@twoside\cleardoubleoddpage\else\clearpage\fi + \@mainmatterfalse\pagenumbering{Roman}% +} +\newcommand*\mainmatter{% + \if@twoside\cleardoubleoddpage\else\clearpage\fi + \@mainmattertrue\pagenumbering{arabic}% +} +\newcommand*\backmatter{% + \if@openright\cleardoubleoddpage\else\clearpage\fi\@mainmatterfalse +} + +%</report> %% custom commands % these two comand can convert decimal number into roman numerrals in etheir upper- or lowercase \newcommand{\uproman}[1]{\uppercase\expandafter{\romannumeral#1}} diff --git a/src/HsH-report.cls b/src/HsH-report.cls index 8403cce..d26c094 100644 --- a/src/HsH-report.cls +++ b/src/HsH-report.cls @@ -152,6 +152,20 @@ \raggedbottom \renewcommand{\layercontentsmeasure}{\@empty} +%% define easy shorthands to switch pagenumbering +\newif\if@mainmatter\@mainmattertrue +\newcommand*\frontmatter{% + \if@twoside\cleardoubleoddpage\else\clearpage\fi + \@mainmatterfalse\pagenumbering{Roman}% +} +\newcommand*\mainmatter{% + \if@twoside\cleardoubleoddpage\else\clearpage\fi + \@mainmattertrue\pagenumbering{arabic}% +} +\newcommand*\backmatter{% + \if@openright\cleardoubleoddpage\else\clearpage\fi\@mainmatterfalse +} + %% custom commands \newcommand{\uproman}[1]{\uppercase\expandafter{\romannumeral#1}} \newcommand{\lowroman}[1]{\romannumeral#1\relax} -- GitLab