diff --git a/CHANGELOG.md b/CHANGELOG.md index 56294d62fdd5d14dd135ab53ee442b31dcf66883..109842a6a0887438a48d9a62e3a096b5d2d369be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. +## [1.4] - 2022-03-28 + +### Added +- defined `\fronmatter`, `\mainmatter` and `\backmatter` for HsH-report class +- included the caption package to fix #6 + +### Fixes +- references now get point to the to of floats, not to the captions position (#6) + + ## [1.3] - 2022-03-07 ### Changed diff --git a/README.md b/README.md index a28457372cabeb0d4277d6ace4cbded9a72f626e..9ada9564e6558bc9e7a6d84a8e5f16aedfa0dce9 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ used in pretty much every project anyway. - `pgffor` allows for the use of for-loops (internal) - `graphicx` for importing images - `hyperref` for references and links + - `caption` to customise captions and make references point to the begining of the floats - `bookmark` for bookmarking - `amsmath` for a lot of general purpose maths features - `csquotes` makes quotations easier diff --git a/src/HsH-article.cls b/src/HsH-article.cls index dbb739131387feb415380d09f86eed8e445d2ce2..1d43d8d1c7570331a7f53b5b47fa6f90c70f899f 100644 --- a/src/HsH-article.cls +++ b/src/HsH-article.cls @@ -20,10 +20,10 @@ %% 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-07> Jan Wille} +\typeout{Adapted from KOMA script for use in Hochschule Hannover <2022-03-28> Jan Wille} \NeedsTeXFormat{LaTeX2e} \newcommand{\myClassName}{HsH-article} -\ProvidesClass{\myClassName}[2022/03/07 v1.3 HsH-Class based on KOMA] +\ProvidesClass{\myClassName}[2022/03/28 v1.4 HsH-Class based on KOMA] %% commands for HsH-logo \newcommand{\HsHlogoPath}{HSH-Logo.pdf} @@ -87,6 +87,8 @@ \RequirePackage{scrhack} \PassOptionsToPackage{hidelinks}{hyperref} \RequirePackage{hyperref} +\PassOptionsToPackage{hypcap=true}{caption} +\RequirePackage{caption} \RequirePackage{bookmark} \PassOptionsToPackage{babel}{csquotes} \if@german\PassOptionsToPackage{german=quotes}{csquotes}\fi @@ -129,7 +131,7 @@ \renewcommand{\fps@table}{h!t} \ifx\KOMAScriptVersion\undefined\else \g@addto@macro\@floatboxreset\centering - \setcapwidth[c]{0.8\textwidth} + \setcapwidth{0.8\textwidth} \fi \if@german \renewcaptionname{ngerman}{\figurename}{Abb.} diff --git a/src/HsH-report.cls b/src/HsH-report.cls index 8403cce080878d90e9ef76f4a248eb74a1a73364..24d670ceb6f08633243e80e5c75f91d592a369d8 100644 --- a/src/HsH-report.cls +++ b/src/HsH-report.cls @@ -20,10 +20,10 @@ %% 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-07> Jan Wille} +\typeout{Adapted from KOMA script for use in Hochschule Hannover <2022-03-28> Jan Wille} \NeedsTeXFormat{LaTeX2e} \newcommand{\myClassName}{HsH-report} -\ProvidesClass{\myClassName}[2022/03/07 v1.3 HsH-Class based on KOMA] +\ProvidesClass{\myClassName}[2022/03/28 v1.4 HsH-Class based on KOMA] %% commands for HsH-logo \newcommand{\HsHlogoPath}{HSH-Logo.pdf} @@ -87,6 +87,8 @@ \RequirePackage{scrhack} \PassOptionsToPackage{hidelinks}{hyperref} \RequirePackage{hyperref} +\PassOptionsToPackage{hypcap=true}{caption} +\RequirePackage{caption} \RequirePackage{bookmark} \PassOptionsToPackage{babel}{csquotes} \if@german\PassOptionsToPackage{german=quotes}{csquotes}\fi @@ -130,7 +132,7 @@ \renewcommand{\fps@table}{h!t} \ifx\KOMAScriptVersion\undefined\else \g@addto@macro\@floatboxreset\centering - \setcapwidth[c]{0.8\textwidth} + \setcapwidth{0.8\textwidth} \fi \if@german \renewcaptionname{ngerman}{\figurename}{Abb.} @@ -152,6 +154,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} diff --git a/src/HsH-standalone.cls b/src/HsH-standalone.cls index 7f972d07da5eb8cba3330e487e21818122055e39..3ff2d255847a432addd6f9aab6b38c9aba68d60e 100644 --- a/src/HsH-standalone.cls +++ b/src/HsH-standalone.cls @@ -20,10 +20,10 @@ %% 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-07> Jan Wille} +\typeout{Adapted from KOMA script for use in Hochschule Hannover <2022-03-28> Jan Wille} \NeedsTeXFormat{LaTeX2e} \newcommand{\myClassName}{HsH-standalone} -\ProvidesClass{\myClassName}[2022/03/07 v1.3 HsH-Class based on KOMA] +\ProvidesClass{\myClassName}[2022/03/28 v1.4 HsH-Class based on KOMA] %% commands for HsH-logo \newcommand{\HsHlogoPath}{HSH-Logo.pdf}