diff --git a/CHANGELOG.md b/CHANGELOG.md index d82968431d5afc1996179b7b0599f391b6dec982..16fdfd266078f64f148c1c984288be83595c9a69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ All notable changes to this project will be documented in this file. ### 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 diff --git a/HsH-classes.dtx b/HsH-classes.dtx index 0aaad61a17b91b6e5dc6f3820ac878a059fab1f9..6db78ae99f584e9874de82695eb5d7ab346f30c9 100644 --- a/HsH-classes.dtx +++ b/HsH-classes.dtx @@ -115,6 +115,10 @@ \PassOptionsToPackage{hidelinks}{hyperref} \RequirePackage{hyperref} % +% put anchors at the beginning of floats +\PassOptionsToPackage{hypcap=true}{caption} +\RequirePackage{caption} +% % generat bookmarkes \RequirePackage{bookmark} % @@ -184,7 +188,7 @@ % center all floats \g@addto@macro\@floatboxreset\centering % center all captions - \setcapwidth[c]{0.8\textwidth} + \setcapwidth{0.8\textwidth} \fi % abbreviations for names: \if@german diff --git a/README.md b/README.md index fbb059911210a10612047189eab797d8d8228d13..3e6f876d942c2a1fb4235fab5fb45f1c94f25aa4 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,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..cb98b424c6275882f5668a9cc4ed635657a5bebe 100644 --- a/src/HsH-article.cls +++ b/src/HsH-article.cls @@ -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 d26c094bc1304f2d4f155966f7a264605c116652..c990fe36207eee19d2d59ae9a8467918bfb2b9d4 100644 --- a/src/HsH-report.cls +++ b/src/HsH-report.cls @@ -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.}