I am trying to get the page layout of my thesis sorted out. I am using fancyhdr
to give me the page number in the top right and chapter name in the top left with a horizontal rule under, and sectsty
to give me sans-serif font for all my section/subsection/etc headings.
I don't like the large gap above the words "Chapter X" with the horizontal rule under the header, so I'd like to reduce this. I have implemented the answer to this question: How to decrease spacing before chapter title? but I am rather unsatisfied: as you can see from my MWE below I have to redefine all of the ToC/LoF/LoT/Bibliography commands, and chapter*
seems to have reverted to the serif font also.
In short, it seems very cumbersome. Is there really not a more elegant way? And if not, could someone with more knowhow than me explain how to get the chapter*
heading into sffamily
?
\documentclass[12pt, a4paper, oneside, fleqn]{report}
\headheight 28pt
\headsep 24pt
\usepackage{lmodern} % gives bold italic font
\usepackage[toc]{glossaries} % add a glossary
\makeindex
\makeglossaries
%Sectioning and headings
%------------------------
\usepackage{fancyhdr}
\fancypagestyle{plain}{ %
\fancyhf{} %clear all header/footer fields
\rhead{\sffamily{\thepage}}}
\usepackage{appendix} % allow formatting of appendix titles
\usepackage{sectsty} % put section headings in sans-serif font
\allsectionsfont{\sffamily}
\chapterfont{\LARGE\sffamily}
\makeatletter % remove hideous gap from above the chapter title
\def\@makechapterhead#1{%
%%%%\vspace*{50\p@}% %%% removed!
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\LARGE\sffamily\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\interlinepenalty\@M
\LARGE\sffamily\bfseries #1\par\nobreak
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
%%%%%\vspace*{50\p@}% %%% removed!
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\makeatother
%reformat some of the page titles
\renewcommand{\abstractname}{\textsf{Abstract}}
\renewcommand{\appendixpagename}{\textsf{Appendices}}
\renewcommand{\bibname}{\textsf{Bibliography}}
\renewcommand{\contentsname}{\textsf{Table Of Contents}}
\renewcommand{\listfigurename}{\textsf{List of Figures}}
\renewcommand{\listtablename}{\textsf{List of Tables}}
\makeatletter
\newcommand*{\myappendixpage}{%remove page number from the Appendix page
\begingroup
\let\ps@plain\ps@empty
\appendixpage
\endgroup}
\makeatother
\begin{document}
\pagenumbering{gobble}
\pagestyle{empty}
\renewcommand{\headrulewidth}{0pt}
%title page stuff
\begin{center}
\sffamily{\Huge{\textbf{This is the full title of my Thesis}}}
\end{center}
%end title page
%This stuff at the front with roman numbering
%--------------------------------------------
\pagestyle{plain}
\pagenumbering{roman}
\newpage
Copyright statement
\begin{abstract}
here is my abstract
\end{abstract}
\chapter*{Acknowledgements}
I'd like to acknowledge some help from some people here.
\tableofcontents
\listoffigures
\listoftables
\newglossaryentry{Term}
{
name={Term},
description={Description of my term}
}
\glsaddall
\printglossary[title=\textsf{Glossary}]
%Main thesis text with arabic numbering
%--------------------------------------
\pagenumbering{arabic}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\sffamily{\MakeUppercase{\thechapter.\ #1}}}{}}
\lhead{\leftmark}
\chead{}
\rhead{\sffamily{\thepage}}
\renewcommand{\headrulewidth}{0.1pt}
\fancyfoot{}
\chapter{Introduction with some \textit{italic text}}
Here is my chapter
%Appendices and bibliography
%---------------------------
\appendix
\myappendixpage
\chapter{My appendix}
some stuff here
\end{document}
plain
page style causes the main chapter pages to have a header (typically this is not the case). Is this what you want?titlesec
as in the question linked above, but egreg's answer told me why it didn't work.