From 5a3d532c859afb51424388436e509c5d6feb3dc6 Mon Sep 17 00:00:00 2001 From: Frederik Beimgraben Date: Thu, 30 Oct 2025 01:27:01 +0100 Subject: [PATCH] Korrigiere Textausrichtung auf Blocksatz mit Silbentrennung --- HSRTReport/Config/PageSetup.tex | 91 ++++++++++++++++++++++++++++---- HSRTReport/Config/Typography.tex | 19 ++++--- 2 files changed, 94 insertions(+), 16 deletions(-) diff --git a/HSRTReport/Config/PageSetup.tex b/HSRTReport/Config/PageSetup.tex index acccb31..efd5e4d 100644 --- a/HSRTReport/Config/PageSetup.tex +++ b/HSRTReport/Config/PageSetup.tex @@ -7,6 +7,12 @@ % License: Creative Commons CC BY 4.0 % ============================================================================== +% ============================================================================== +% Required Packages +% ============================================================================== +\usepackage{lastpage} % For "Page X of Y" functionality +\usepackage{fancyhdr} % Already loaded, but ensure it's available + % ============================================================================== % Page Style Configuration % ============================================================================== @@ -28,22 +34,89 @@ % Clear all header and footer fields \fancyhf{} -% Configure header -\fancyhead[L]{\color{gray}\blenderfont \@title} % Document title on left -\fancyhead[R]{\pagemark} % Page number on right +% ------------------------------------------------------------------------------ +% Header Configuration +% ------------------------------------------------------------------------------ +% Left header: Chapter number and title +% Right header: Empty (no page number in header as per requirements) +\fancyhead[L]{% + \color{gray}\blenderfont% + \ifnum\value{chapter}>0% + \thechapter\quad\leftmark% + \fi% +} +\fancyhead[R]{} % Empty right header -% Clear footer -\fancyfoot[C]{} +% Update chapter marks to show only chapter name without "Chapter" prefix +\renewcommand{\chaptermark}[1]{\markboth{#1}{}} +\renewcommand{\sectionmark}[1]{} % Don't show sections in header + +% ------------------------------------------------------------------------------ +% Footer Configuration +% ------------------------------------------------------------------------------ +% Footer format: Author Name | Module Name | Page X of Y +% The footer is centered and uses proper spacing +\fancyfoot[C]{% + \color{gray}\blenderfont% + \@author% + \quad|\quad% + \ifdef{\modulename}{\modulename}{Modul-Name}% + \quad|\quad% + Seite~\thepage~von~\pageref{LastPage}% +} + +% ============================================================================== +% Plain Page Style (for chapter pages) +% ============================================================================== +% Define the plain page style (used on chapter start pages) +\fancypagestyle{plain}{ + \fancyhf{} + % No header on chapter start pages + \fancyhead[L]{} + \fancyhead[R]{} + % Same footer as regular pages + \fancyfoot[C]{% + \color{gray}\blenderfont% + \@author% + \quad|\quad% + \ifdef{\modulename}{\modulename}{Modul-Name}% + \quad|\quad% + Seite~\thepage~von~\pageref{LastPage}% + } + \renewcommand{\headrulewidth}{0pt} +} % ============================================================================== % Fancy Page Style Definition % ============================================================================== -% Define the fancy page style explicitly +% Explicitly define the fancy page style \fancypagestyle{fancy}{ \fancyhf{} - \fancyhead[L]{\color{gray}\blenderfont \@title} - \fancyhead[R]{\pagemark} - \fancyfoot[C]{} + \fancyhead[L]{% + \color{gray}\blenderfont% + \ifnum\value{chapter}>0% + \thechapter\quad\leftmark% + \fi% + } + \fancyhead[R]{} + \fancyfoot[C]{% + \color{gray}\blenderfont% + \@author% + \quad|\quad% + \ifdef{\modulename}{\modulename}{Modul-Name}% + \quad|\quad% + Seite~\thepage~von~\pageref{LastPage}% + } +} + +% ============================================================================== +% Chapter Start Configuration +% ============================================================================== +% Ensure chapters start on a new page +\let\originalchapter\chapter +\renewcommand{\chapter}[1]{% + \clearpage% + \originalchapter{#1}% } % ============================================================================== diff --git a/HSRTReport/Config/Typography.tex b/HSRTReport/Config/Typography.tex index 02dfc21..f6967e0 100644 --- a/HSRTReport/Config/Typography.tex +++ b/HSRTReport/Config/Typography.tex @@ -21,14 +21,19 @@ % ============================================================================== % Text Alignment % ============================================================================== -% Set left-justified text with ragged right edge (Flattersatz) -% This applies to the main text body -\raggedright +% Use justified text (Blocksatz) - this is the default in LaTeX +% No \raggedright command needed -% Enable hyphenation for better text distribution -% Even with ragged right, hyphenation improves readability -\hyphenpenalty=750 -\exhyphenpenalty=750 +% Enable hyphenation for better text distribution in justified text +% Lower penalties encourage more hyphenation for better spacing +\hyphenpenalty=500 +\exhyphenpenalty=500 +\tolerance=1000 +\emergencystretch=3em + +% Prevent excessive word spacing in justified text +\spaceskip=0.3em plus 0.2em minus 0.1em +\xspaceskip=0.6em plus 0.3em minus 0.15em % ============================================================================== % Widow and Orphan Control