1
\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{array}
\usepackage{tabularx}
\usepackage{caption} 
\captionsetup[table]{skip=10pt}
\renewcommand{\arraystretch}{1.4}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{adjustbox}
\usepackage{rsc}
\usepackage{graphicx}
\usepackage{setspace}
\linespread{1.25}
\UseRawInputEncoding
\usepackage{geometry}
    \geometry{
    a4paper,
    left=40mm,
    right=20mm,
    top=40mm,
    bottom=50mm
    }
%header settings
\usepackage{fancyhdr}
\pagestyle{fancy}
   \fancyhf{}
\makeatletter
% copy of the original from report.cls with the \MakeUppercase dropped
\renewcommand{\chaptermark}[1]{
  \markboth
    {\ifnum \c@secnumdepth >\m@ne
       \@chapapp\ \thechapter. 
      \fi
     #1}
    {}}
\makeatother

\usepackage{etoolbox}
\patchcmd{\tableofcontents}
  {\MakeUppercase}
  {}
  {}{}
\patchcmd{\tableofcontents}
  {\MakeUppercase}
  {}
  {}{}

\patchcmd{\thebibliography}
  {\MakeUppercase}
  {}
  {}{}
\patchcmd{\thebibliography}
  {\MakeUppercase}
  {}
  {}{}

\fancyhead[L]{\itshape\leftmark}
\fancyhead[R]{\itshape Keiran Corbett}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
  \setlength{\headheight}{15pt}
  \setlength{\footskip}{50pt}  %page number spacing
\begin{document}
    \tableofcontents
    \chapter{Example chapter title}
     \newpage
     text
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \chapter{Example chapter title}
    \end{document}

So with this command, it looks how I would like but I have a table of contents and the header for that is Chapter 0. CONTENTS

So I have two questions 1. How do I make CONTENTS not capital 2. How can I get rid of the Chapter (Only for bib and contents section)

bibliography also has the same problem

There is an exmaple of how it should look on page 4 of the example latex file

3
  • I will try come up wtih a MWE. Just having difficulty as it is only on page 2 of the bibliography and page 2 of the contents. It has Chapter 0. CONTENTS as a header (for the second page of the contents) \documentclass[12pt,a4paper]{report}
    – Carl
    Mar 19, 2019 at 16:22
  • I cant get the u can use xampl.bib (which is installed on all systems with BibTeX) and \nocite{*} even within the actually document (Very silly error on my part). Thank you for your help
    – Carl
    Mar 19, 2019 at 16:36
  • Okay have recreated it another way anyway using the contents. Even if not very efficient
    – Carl
    Mar 19, 2019 at 16:41

1 Answer 1

1

I suggest a slight change to \chaptermark so that \leftmark contains the entire header ("Chapter 1. Example chapter title") and not just the chapter title ("Example chapter title"). That makes your \fancyhead[L] simpler and less susceptible to incorrect chapter numbers.

For a nice header in the ToC and bibliography I found no better way than patching the commands directly. See for example Headers of ToC and fancyhdr.

memoir or the KOMA classes would have more convenient interfaces for this.

\documentclass[12pt,a4paper]{report}

\usepackage{fancyhdr}
\pagestyle{fancy}
   \fancyhf{}

\makeatletter
% copy of the original from report.cls with the \MakeUppercase dropped
\renewcommand{\chaptermark}[1]{%
  \markboth
    {\ifnum \c@secnumdepth >\m@ne
       \@chapapp\ \thechapter. %
      \fi
     #1}
    {}}
\makeatother

\usepackage{etoolbox}
\patchcmd{\tableofcontents}
  {\MakeUppercase}
  {}
  {}{}
\patchcmd{\tableofcontents}
  {\MakeUppercase}
  {}
  {}{}

\patchcmd{\thebibliography}
  {\MakeUppercase}
  {}
  {}{}
\patchcmd{\thebibliography}
  {\MakeUppercase}
  {}
  {}{}

\fancyhead[L]{\itshape\leftmark}
\fancyhead[R]{\itshape NAME}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
  \setlength{\headheight}{15pt}


\begin{document}
\tableofcontents
\chapter{Example chapter title}
lorem
\newpage
ipsum
\newpage
dolor
\newpage
sit
\newpage
amet.
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}

\nocite{*}
\bibliographystyle{plain}
\bibliography{xampl}
\end{document}

Screenshot of the second page of the ToC. The header reads just "Contents" on the left side

Screenshot of the second page of the bibliography. The left hand side of the header reads "Bibliography".


The rsc package loads natbib and thus slightly changes the typesetting of the bibliography heading. In that case you need to patch the command \bibsection and not \thebibliography.

Add

\patchcmd{\bibsection}
  {\MakeUppercase}
  {}
  {}{}
\patchcmd{\bibsection}
  {\MakeUppercase}
  {}
  {}{}

to your preamble.

9
  • Thank you so much for this! Just one question. It works perfectly on my contents but not on the bibliography - it is still in capitals. I am using the \usepackage{rsc} bibliography style if that makes a difference?
    – Carl
    Mar 19, 2019 at 18:14
  • @Carl I get the same result for the bibliography heading even with \bibliographystyle{rsc} in the MWE. If it does not work for you, there must be something else that influences the bibliography. Do you load natbib or another bibliography package? Please add that to your MWE.
    – moewe
    Mar 19, 2019 at 20:24
  • \documentclass[12pt,a4paper]{report} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{booktabs} \usepackage{array} \usepackage{tabularx} \usepackage{caption} \captionsetup[table]{skip=10pt} \renewcommand{\arraystretch}{1.4} \usepackage{amsfonts} %\usepackage{breakcites} \usepackage{amssymb} \usepackage{adjustbox} \usepackage{rsc} \usepackage{graphicx} \usepackage{setspace} \linespread{1.25} \UseRawInputEncoding \usepackage{geometry} \geometry{ a4paper, left=40mm, right=20mm, top=40mm, bottom=50mm }
    – Carl
    Mar 20, 2019 at 8:08
  • @Carl See the edit, please.
    – moewe
    Mar 20, 2019 at 8:18
  • Done, I dont use natbib as it clashes with rsc
    – Carl
    Mar 20, 2019 at 8:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .