From 2203fd8a0d4b494ff8a63fdeb8cf00b888f243d5 Mon Sep 17 00:00:00 2001 From: Roland Hieber <rohieb@rohieb.name> Date: Fri, 11 Jan 2013 01:46:40 +0100 Subject: [PATCH] =?UTF-8?q?LaTeX-Package:=20vertikale=20Abst=C3=A4nde=20im?= =?UTF-8?q?=20Inhaltsverzeichnis=20angepasst,=20=C3=9Cberschriften=20in=20?= =?UTF-8?q?einer=20aufw=C3=A4rtskompatiblen=20Weise=20redefiniert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Notiz: Der section-Counter muss nicht zweimal auf -1 gesetzt werden ;-) --- stratum0doc.sty | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/stratum0doc.sty b/stratum0doc.sty index 53f2ce4..17255c0 100644 --- a/stratum0doc.sty +++ b/stratum0doc.sty @@ -3,14 +3,16 @@ \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{stratum0doc} +\RequirePackage{tocloft} %% Package options \makeatletter \DeclareOption{transcript}{% - \def\@sndsectionmark{TOP}% - \setcounter{section}{-1}% start with TOP 0 for more geekness + \def\@sndsectionmark{TOP\ }% + } + \DeclareOption{legal}{ + \def\@sndsectionmark{§\ } } - \DeclareOption{legal}{\def\@sndsectionmark{§}} \ExecuteOptions{transcript} \ProcessOptions\relax \makeatother @@ -33,8 +35,14 @@ \makeatletter \renewcommand{\labelenumi}{(\arabic{enumi})} \renewcommand{\labelitemi}{--} -\renewcommand{\thesection}{% - \@sndsectionmark\ \@arabic\c@section + +% set table of contents number field to max width of section numbers +\settowidth{\cftsecnumwidth}{\@sndsectionmark 10 } +\settowidth{\cftsubsecnumwidth}{\@sndsectionmark 1.10 } + +\let\theoldsection\thesection +\renewcommand*{\thesection}{% + \@sndsectionmark\theoldsection } \setcounter{section}{-1} % Hacker fangen ab 0 an zu zählen. \makeatother -- GitLab