1

I am using the classic thesis template and in my document, I have modified the header to include the chapter heading in the top right of each page, from the advice given here 1. However, on the last page of the chapter, the name in the header changes to that of the next chapter. How do I ensure the modified header is applied to all pages within the same chapter?

I've included a MWE and a screenshot of the problem. Any advice would be greatly appreciated!

\documentclass[12pt,a4paper,headinclude=true,footinclude]{report}% or book for the standard book class
\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc}
\usepackage[dottedtoc]{classicthesis}
%\usepackage{url}
\usepackage{color}
\usepackage{graphicx, epstopdf}
\graphicspath{{../Visuals/}{../Visuals/Chapter_1/}{../Visuals/Chapter_2/}{../Visuals/Chapter_3/}{../Visuals/Chapter_4/}{../Visuals/Chapter_5/}{../Visuals/Chapter_6/}}
\usepackage{gensymb}
\usepackage{times}
\usepackage{chemformula} % Formula subscripts using \ch{}
\usepackage{adjustbox}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[backend=bibtex, citestyle=ieee, bibstyle=ieee]{biblatex}
\addbibresource{Libraryv1.69,test}%multiple .bib files here for different chapters
%\addbibresource{test}
\usepackage[section]{placeins}%Allows you to permanently fix figures. 
\usepackage{titleps}%fancy page borders? 
\usepackage[left=4.0cm, right=4cm, top=3.5cm, bottom=3.5cm]{geometry}
\captionsetup{format=plain, font={small,it}, labelfont=bf}
\usepackage{microtype}
\usepackage{wallpaper}
\usepackage{setspace}
\usepackage{amsmath}
\usepackage{lipsum}
\setcounter{secnumdepth}{3}

\sloppy%Makes sure that none of the text exceeds text width. Useful if have long chemical words. 

\DeclareUnicodeCharacter{2212}{-}

\pagestyle{scrheadings} % <--- Affects the page header 
% and page number in the footer.
\clearscrheadfoot
\ohead{\leftmark}  % comment out to 

\cfoot[\pagemark]{\pagemark}

\renewcommand{\sectionmark}[1]{\markright{\spacedlowsmallcaps{#1}}}
% Remove section number from heading

\sloppy%Makes sure that none of the text exceeds text width. Useful if have long chemical words. 

\DeclareUnicodeCharacter{2212}{-}

\doublespacing 
\begin{document}

%CHAPTER_1
\chapter{Introduction}

\lipsum

\chapter{Project 1}

%\printbibliography
\end{document}

enter image description here

3 Answers 3

1

Do not use more than one package for page header and footer! Package classicthesis loads package scrlayer-scrpage. Therefore you have to remove package titleps.

Example (I have removed all the unrelated stuff):

\documentclass[12pt,a4paper,headinclude=true,footinclude]{report}
\usepackage[T1]{fontenc}
\usepackage[dottedtoc]{classicthesis}% loads package scrlayer-scrpage and sets page style scrheadings

\usepackage{mathptmx}% replaces obsolete package times
\usepackage[doublespacing]{setspace}
\usepackage[british]{babel}

%\usepackage{titleps}% <- remove this package!!

\usepackage[left=4.0cm, right=4cm, top=3.5cm, bottom=3.5cm]{geometry}
\usepackage{microtype}
\usepackage{lipsum}

%\pagestyle{scrheadings}% <- not needed
\clearpairofpagestyles% <- replaces outdated \cleardscrheadfoot
\ohead{\leftmark}
\cfoot*{\pagemark}% <- short version of \cfoot[\pagemark]{\pagemark}

\begin{document}
\chapter{Introduction}
\lipsum
\chapter{Project 1}
\lipsum
\end{document}
1

There is a mix of classes, packages and options.

Option 1

Use \documentclass[12pt,a4paper]{report} and titleps to setup the headers.

Option 2

Use

\documentclass[12pt,paper=a4,dottedtoc, headinclude, footinclude=true]{scrreprt}, the KOMA-Script report, and its own way to specify the page headers and footers (and remove titleps !)

Option 1

a

\documentclass[12pt,a4paper]{report}% or book for the standard book class
\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc}
\usepackage[dottedtoc]{classicthesis}
%\usepackage{url}
\usepackage{color}
\usepackage{graphicx, epstopdf}
\graphicspath{{../Visuals/}{../Visuals/Chapter_1/}{../Visuals/Chapter_2/}{../Visuals/Chapter_3/}{../Visuals/Chapter_4/}{../Visuals/Chapter_5/}{../Visuals/Chapter_6/}}
\usepackage{gensymb}
%%%\usepackage{times} 
\usepackage{chemformula} % Formula subscripts using \ch{}
\usepackage{adjustbox}
\usepackage[british]{babel}
\usepackage{csquotes}
%\usepackage[backend=bibtex, citestyle=ieee, bibstyle=ieee]{biblatex}
%\addbibresource{Libraryv1.69,test}%multiple .bib files here for different chapters
%\addbibresource{test}
\usepackage[section]{placeins}%Allows you to permanently fix figures. 

%% ********************************************* added <<<<<<<<<<<<<<<<<
\usepackage{newcomputermodern} 
\usepackage{titleps}%fancy page borders? 
\newpagestyle{main}[\sffamily]{
    \sethead[\chaptertitle][][]% even pages if twoside
    {}{}{\chaptertitle} % odd pages
    \setfoot{}{\thepage}{}% 
} 
\pagestyle{main}

\renewpagestyle{plain}[\small\sffamily]{
    \setfoot{}{\thepage}{}}
%% *******************************************

\usepackage[left=4.0cm, right=4cm, top=3.5cm, bottom=3.5cm]{geometry}
\captionsetup{format=plain, font={small,it}, labelfont=bf}
\usepackage{microtype}
\usepackage{wallpaper}
\usepackage{setspace}
\usepackage{amsmath}
\usepackage{lipsum}
\setcounter{secnumdepth}{3}

\sloppy%Makes sure that none of the text exceeds text width. Useful if have long chemical words. 

%\DeclareUnicodeCharacter{2212}{-}

%   %\pagestyle{scrheadings} % <--- Affects the page header 
%   %% and page number in the footer.
%   %\clearscrheadfoot
%   %\ohead{\leftmark}  % comment out to 
%   %
%   %\cfoot[\pagemark]{\pagemark}
%   %
%   %\renewcommand{\sectionmark}[1]{\markright{\spacedlowsmallcaps{#1}}}
%   %% Remove section number from heading   

\sloppy%Makes sure that none of the text exceeds text width. Useful if have long chemical words. 

%\DeclareUnicodeCharacter{2212}{-}

\doublespacing 
\begin{document}
    
    %CHAPTER_1
    \chapter{Introduction}
    
    \lipsum
    
    \chapter{Project 1}
    
    %\printbibliography
\end{document}

Option 2

b

\documentclass[12pt,paper=a4,dottedtoc, headinclude, footinclude=true]{scrreprt}% KOMA-Script report

\usepackage[T1]{fontenc}

%\usepackage[utf8]{inputenc}
\usepackage[dottedtoc]{classicthesis}
%\usepackage{url}
\usepackage{color}
\usepackage{graphicx, epstopdf}
\graphicspath{{../Visuals/}{../Visuals/Chapter_1/}{../Visuals/Chapter_2/}{../Visuals/Chapter_3/}{../Visuals/Chapter_4/}{../Visuals/Chapter_5/}{../Visuals/Chapter_6/}}
\usepackage{gensymb}
\usepackage{newcomputermodern} % added <<<
%\usepackage{times}
\usepackage{chemformula} % Formula subscripts using \ch{}
\usepackage{adjustbox}
\usepackage[british]{babel}
\usepackage{csquotes}
%\usepackage[backend=bibtex, citestyle=ieee, bibstyle=ieee]{biblatex}
%\addbibresource{Libraryv1.69,test}%multiple .bib files here for different chapters
%%\addbibresource{test}
\usepackage[section]{placeins}%Allows you to permanently fix figures. 

%\usepackage{titleps}%fancy page borders?  REMOVE <<<<<<<<<<

\usepackage[left=4.0cm, right=4cm, top=3.5cm, bottom=3.5cm]{geometry}
\captionsetup{format=plain, font={small,it}, labelfont=bf}
\usepackage{microtype}
\usepackage{wallpaper}
\usepackage{setspace}
\usepackage{amsmath}
\usepackage{lipsum}
\setcounter{secnumdepth}{3}

\sloppy%Makes sure that none of the text exceeds text width. Useful if have long chemical words. 

%\DeclareUnicodeCharacter{2212}{-}

\pagestyle{scrheadings} % <--- Affects the page header  and page number in the footer.
\clearscrheadfoot
\ohead{\leftmark}  % comment out to     
\cfoot[\pagemark]{\pagemark}

\renewcommand{\sectionmark}[1]{\markright{\spacedlowsmallcaps{#1}}}
% Remove section number from heading

\sloppy%Makes sure that none of the text exceeds text width. Useful if have long chemical words. 

%\DeclareUnicodeCharacter{2212}{-}

\doublespacing 
\begin{document}
    
    %CHAPTER_1
    \chapter{Introduction}
    
    \lipsum
    
    \chapter{Project 1}
    
    %\printbibliography
\end{document}
3
  • Package classicthesis loads package typearea. Therefore options headinclude and footinclude=true are allowed. But classicthesis sets these options by default, if the class is not a KOMA-Script class. Note that classicthesis loads package titlesec that is incompatible with KOMA-Script classes.
    – esdd
    Aug 5, 2021 at 19:29
  • @esdd The OP is loading the report class + classicthesis + titleps (for page headers) Aug 5, 2021 at 19:37
  • classicthesis loads among others package scrlayer-scrpage and package titlesec. Your option 1 loads report + classicthesis + titleps, ie. report+scrlayer-scrpage+titleps. Your option 2 loads scrreprt + classicthesis, ie. scrreprt + titlesec.
    – esdd
    Aug 5, 2021 at 19:51
0

Solved. Not sure if this is the correct approach but by adding a \newpage before each \chapter solves the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.