1

(hoping that neither my reviewers nor anybody in my field is going to read this) I would like to put an easter egg in my Ph.D. thesis (written using the amazing classicthesis template). I would like to change the header of page 42 with Answer to the Ultimate Question of Life, the Universe, and Everything instead of the default section title. Is it possible to do so? I understood that it is possible to change the header at some point of the tex (by for example using fancyhdr and defining a pagestyle), but can I address exactly page 42 no matter what content is into it?

Thanks in advance for any help!

alecive
  • 13
  • 4
  • 1
    Add an if-condition in header? It then checks whether it is P42 everytime. – Symbol 1 Feb 03 '15 at 17:02
  • This might help http://tex.stackexchange.com/q/220800 – karlkoeller Feb 03 '15 at 17:21
  • 1
    Hi and welcome, out of pure interest: How long are you using classicthesis? You seem to be the first one that isn't annoyed by the this badly and outdated template. – Johannes_B Feb 03 '15 at 17:34
  • Hi @Johannes_B ! I started approximatively a month ago. I experienced a number of problems (some of which are still present, like a significant number of bad hyphenated lines), but I kinda like it :) Is there anything better to your knowledge? Honestly, I did not do a thorough research, so probably there are better choices out there. – alecive Feb 04 '15 at 09:14
  • Right now i am in some kind of holy war concerning templates. There is some kind of misunderstanding due to a lack of common nomenclature or misused terms. classicthesis (the original template) used KOMA-script for its great functionality (according to the doc of ct); but right at the same time broke several KOMA-stuff due to questionable implementation. IMHO it needs a complete fix along with some tidying up. – Johannes_B Feb 04 '15 at 14:11
  • Have a look at Nicola Talbots LaTeX for complete novices which introduces you to LaTeX in general and the KOMA-classes specifically. There is a volume two: Using LaTeX to Write a PhD Thesis. You should just use the bits and pieces you need that ct provides, check if its gone obsolete and maybe search for modern alternatives. For example, the original template uses a not really up to date bibliography management. – Johannes_B Feb 04 '15 at 14:15

1 Answers1

1

You can use an if in your header. For example this changes the header on page 3 with the classicthesis definitions:

\documentclass[fontsize=11pt,paper=a4,pagesize,twoside]{scrreprt}
\usepackage[linedheaders]{classicthesis}
\newcommand{\replaceText}{\spacedlowsmallcaps{Answer to the Ultimate Question of Life, the Universe, and Everything}}
\lehead{\mbox{\llap{\small\thepage\kern2em}\ifnum\value{page}=3\replaceText\else\headmark\fi\hfil}}
\rohead{\mbox{\hfil{\ifnum\value{page}=3\replaceText\else\headmark\fi}\rlap{\small\kern2em\thepage}}}
\pagestyle{scrheadings}

\usepackage{blindtext}
\begin{document}
\chapter{First Chapter}
\blindtext[60]
\end{document}

OLD ANSWER if you are not using classicthesis:

You can use an if in your header. For example this changes the header on page 3:

\documentclass{report}

\usepackage[automark]{scrlayer-scrpage}
\pagestyle{scrheadings}
\clearpairofpagestyles
\ohead{\ifnum\value{page}=3{Answer to the Ultimate Question of Life, the Universe, and Everything }\else\headmark\fi}
\ofoot[\pagemark]{\pagemark}

\usepackage{blindtext}

\begin{document}
\Blinddocument
\end{document}
Juri Robl
  • 4,763