From 36751e63ea79f15a6f8e68df1f4d186e76b41ceb Mon Sep 17 00:00:00 2001 From: gasse Date: Mon, 17 Oct 2016 18:29:56 +0200 Subject: [PATCH] Fix an issue with hyperref, bookmark and footer/header of unnumbered chapters with more than 1 page. --- cleanthesis.sty | 11 ++++++++--- content/abstract.tex | 3 +-- content/acknowledgement.tex | 3 +-- content/declaration.tex | 3 +-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cleanthesis.sty b/cleanthesis.sty index 6b6fb08..8799655 100644 --- a/cleanthesis.sty +++ b/cleanthesis.sty @@ -364,9 +364,14 @@ \renewcommand{\chaptermark}[1]{% \markboth{% \footnotesize% - % use \@chapapp instead of \chaptername to avoid 'Chapter A Appendix ...', thanks to @farbverlust (issue #47) - {\color{ctcolorfootermark}\textbf{\@chapapp\ \thechapter}}% - \quad% + % http://tex.stackexchange.com/questions/290400/remove-chapter-0-from-header-in-frontmatter-chapters-with-fancyhdr/290403 + \ifnum \c@secnumdepth > \m@ne% + \if@mainmatter% + % use \@chapapp instead of \chaptername to avoid 'Chapter A Appendix ...', thanks to @farbverlust (issue #47) + {\color{ctcolorfootermark}\textbf{\@chapapp\ \thechapter}}% + \quad% + \fi% + \fi% \ifct@cthesis@wrapfooter% {\color{ctcolorfootertitle}\protect\parbox[t]{.7\textwidth}{#1}}% \else% diff --git a/content/abstract.tex b/content/abstract.tex index dfa2dc9..05278b4 100644 --- a/content/abstract.tex +++ b/content/abstract.tex @@ -1,7 +1,6 @@ % !TEX root = ../my-thesis.tex % -\pdfbookmark[0]{Abstract}{Abstract} -\chapter*{Abstract} +\addchap*{Abstract} \label{sec:abstract} \vspace*{-10mm} diff --git a/content/acknowledgement.tex b/content/acknowledgement.tex index 87dd580..9636044 100644 --- a/content/acknowledgement.tex +++ b/content/acknowledgement.tex @@ -1,7 +1,6 @@ % !TEX root = ../my-thesis.tex % -\pdfbookmark[0]{Acknowledgement}{Acknowledgement} -\chapter*{Acknowledgement} +\addchap*{Acknowledgement} \label{sec:acknowledgement} \vspace*{-10mm} diff --git a/content/declaration.tex b/content/declaration.tex index 50ca474..d1c3ca7 100644 --- a/content/declaration.tex +++ b/content/declaration.tex @@ -3,8 +3,7 @@ %************************************************ % Declaration %************************************************ -\pdfbookmark[0]{Declaration}{Declaration} -\chapter*{Declaration} +\addchap*{Declaration} \label{sec:declaration} \thispagestyle{empty}