diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c2c3ce3c4ed33fab35494be1459b4d8959126d4..a2b909e4739d11c09a8041af5c5b86c591a1e72f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. ## [Current] +### Fixed + +- `\ihead` and `\ohead` now have a max width and will break into multiple lines (#7) + ## [1.4] - 2022-03-28 diff --git a/HsH-classes.dtx b/HsH-classes.dtx index 63fda1e14aeb538e67a23a83e65866cdaf10fc03..d9db6f9bc11be6d22ae4c191d61abd815314ac50 100644 --- a/HsH-classes.dtx +++ b/HsH-classes.dtx @@ -168,15 +168,25 @@ % %<*article|report> %% header and footer -\pagestyle{scrheadings} -\clearpairofpagestyles +\newpagestyle{HsHheadings}{ + {\parbox{\sls@headwidth}{\LaTeXraggedright\@title}} + {\parbox{\sls@headwidth}{\LaTeXraggedleft\leftmark}} + { + \parbox[b]{.45\sls@headwidth}{\LaTeXraggedright\@title}% + \hfill + \parbox[b]{.45\sls@headwidth}{\LaTeXraggedleft\headmark}% + } + (\textwidth,.1pt) +}{ + {\pagemark} + {\hfill\pagemark} + {\hfill\pagemark} +} +\pagestyle{HsHheadings} %<article>\automark{section} %<report>\automark{chapter} % Chaptertitles get same header/footer as everything: -%<report>\renewcommand*{\chapterpagestyle}{scrheadings} -\ohead{\headmark} -\ihead{\@title} -\ofoot*{\pagemark} +%<report>\renewcommand*{\chapterpagestyle}{HsHheadings} %% floats % positioning of floats diff --git a/src/HsH-article.cls b/src/HsH-article.cls index 1d43d8d1c7570331a7f53b5b47fa6f90c70f899f..af0ce27accd70e7d8891cf9b94ab9ad9164ad108 100644 --- a/src/HsH-article.cls +++ b/src/HsH-article.cls @@ -119,12 +119,22 @@ \upsubscripts %% header and footer -\pagestyle{scrheadings} -\clearpairofpagestyles +\newpagestyle{HsHheadings}{ + {\parbox{\sls@headwidth}{\LaTeXraggedright\@title}} + {\parbox{\sls@headwidth}{\LaTeXraggedleft\leftmark}} + { + \parbox[b]{.45\sls@headwidth}{\LaTeXraggedright\@title}% + \hfill + \parbox[b]{.45\sls@headwidth}{\LaTeXraggedleft\headmark}% + } + (\textwidth,.1pt) +}{ + {\pagemark} + {\hfill\pagemark} + {\hfill\pagemark} +} +\pagestyle{HsHheadings} \automark{section} -\ohead{\headmark} -\ihead{\@title} -\ofoot*{\pagemark} %% floats \renewcommand{\fps@figure}{h!t} diff --git a/src/HsH-report.cls b/src/HsH-report.cls index 24d670ceb6f08633243e80e5c75f91d592a369d8..f37c7d9673611274efaaae586c50af05a159c2e4 100644 --- a/src/HsH-report.cls +++ b/src/HsH-report.cls @@ -119,13 +119,23 @@ \upsubscripts %% header and footer -\pagestyle{scrheadings} -\clearpairofpagestyles +\newpagestyle{HsHheadings}{ + {\parbox{\sls@headwidth}{\LaTeXraggedright\@title}} + {\parbox{\sls@headwidth}{\LaTeXraggedleft\leftmark}} + { + \parbox[b]{.45\sls@headwidth}{\LaTeXraggedright\@title}% + \hfill + \parbox[b]{.45\sls@headwidth}{\LaTeXraggedleft\headmark}% + } + (\textwidth,.1pt) +}{ + {\pagemark} + {\hfill\pagemark} + {\hfill\pagemark} +} +\pagestyle{HsHheadings} \automark{chapter} -\renewcommand*{\chapterpagestyle}{scrheadings} -\ohead{\headmark} -\ihead{\@title} -\ofoot*{\pagemark} +\renewcommand*{\chapterpagestyle}{HsHheadings} %% floats \renewcommand{\fps@figure}{h!t} diff --git a/test.pdf b/test.pdf index 04663ca2cb3cc03f562569ee8015479b93ad6095..8f5b8883e0ffdd130cba7763a2498dc9f6b7adb7 100644 Binary files a/test.pdf and b/test.pdf differ diff --git a/test.tex b/test.tex index cd95176182f5a36545b9919980658af39aed05a1..b47e105f56b2df4c903103b02443cb7900a1a30d 100644 --- a/test.tex +++ b/test.tex @@ -18,7 +18,7 @@ } \titlehead{titlehead} \subject{Subject} -\title{Title} +\title{long and elaborate title that just goes on and on witout stopping} \subtitle{Subtitle} \date{\today} \professor{Professor} @@ -40,7 +40,7 @@ \cleardoublepage % unbedingt erforderlich bei Doppelseitigem layout vor neuer Seitennummerierung! \pagenumbering{arabic} % Seitennummerierung normale zahlen -\chapter{one} +\chapter{very precice chapterheading with a bounch of important information} \label{chap: one} {\color{red}test} und stuff \begin{figure}