I have a problem when using the fancy header (\pagestyle{fancy}). When I include it, the text overlaps in the upper part as shown in this image:
I tried to use the geometry package, but it didn't work. I think the problem should be in this part of the code:
\fancypagestyle{plain}{
\renewcommand{\headrulewidth}{0.0pt}
\fancyfoot{}
\fancyfoot[RO, LE]{\thepage}
\fancyhead{}
}
\pagestyle{fancy}
I also include the whole code here, in case there is any other problem:
\documentclass[pdftex,11pt,openright,headsepline]{book}
\usepackage{paralist} % List environment
\usepackage{color} % For colored text
\usepackage{times}
\usepackage{amsfonts} % Additional math fonts
\usepackage{amsmath} % Math symbols
\usepackage{latexsym}
\usepackage{graphicx} % For including images
% \usepackage{listings} % If listings are needed
% \usepackage{mydefs} % Some of our own definitions
% \usepackage{wrapfig} % To wrap images
% \usepackage{algorithmic} % Nice algorithm environment
% \usepackage{algorithm}
\usepackage{fancyhdr} % Produce the nice header
\usepackage{fullpage} % Use the full page
\usepackage{textcomp}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage[hidelinks]{hyperref}
\usepackage{mathtools}
% Change the appearance of the header. Here \MakeUppercase is hard-coded, so renewing this command allows to elegantly change the header appearance.
\renewcommand{\MakeUppercase}{\scshape}
% Set the headings' appearance in the ``fancy'' pagestyle
\fancyhead{}
\fancyhead[RO, LE]{\leftmark}
\fancyfoot{}
\fancyfoot[RO, LE]{\thepage}
% The first pages shall be empty, even no page numbering
\begin{document}
\pagestyle{empty} % even no page number
\fancypagestyle{plain}{
\renewcommand{\headrulewidth}{0.0pt}
\fancyfoot{}
\fancyhead{}
}
% Title page, modify accordingly
\input{title.tex}
\cleardoublepage
\input{abstract.tex}
%% Input here any acknowledgements
%\input{ack.tex}
%\cleardoublepage
%\newpage
% % Chapter-pages etc. use the ``plain'' pagestyle - since we don't want to have a heading at all at chapter-pages, redefine plain accordingly. Don't forget the page number.
\fancypagestyle{plain}{
\renewcommand{\headrulewidth}{0.0pt}
\fancyfoot{}
\fancyfoot[RO, LE]{\thepage}
\fancyhead{}
}
\pagestyle{fancy}
\pagenumbering{Roman}
% Insert table of contents
\tableofcontents
% Insert list of figures
\listoffigures
\cleardoublepage
% Insert list of tables
\listoftables
\cleardoublepage
\newpage
\pagenumbering{arabic}
%% ----------------------------------------------------------------------------
% Actual text comes here - defer it to other files and use \input{bla.tex}, ..
%% ----------------------------------------------------------------------------
\input{intro.tex}
\input{relatedwork.tex}
\input{materialsandmethods.tex}
\input{experimentsandresults.tex}
\input{discussion.tex}
\input{conclusion.tex}
%% ----------------------------------------------------------------------------
% If Appendix is needed
%% ----------------------------------------------------------------------------
\appendix
\input{appendix.tex}
%% ----------------------------------------------------------------------------
% Bibliography is stored in references.bib file, and can often be found
% online on webpages like dblp.uni-trier.de
%
% To include it in your thesis, run
% pdflatex main
% bibtex main
% pdflatex main
% pdflatex main
%
% This ensures all references are done correctly.
%% ----------------------------------------------------------------------------
\bibliographystyle{plain}
\bibliography{/home/alvaroeg/SemesterProject/Report/Bibliography/SlidingBoundaries}
\end{document}
Thanks in advance
Best Answer
I see no reason whatsoever for loading the
fullpage
package. It's a package thought for very different purposes than typesetting a thesis.Since it sets
\headheight
and\headsep
both to zero, it's obvious that you don't want this. Neither using theheadings
option is satisfying.Beware that
\renewcommand{\MakeUppercase}{\scshape}
is a gross mistake: remove it from your code as soon as possible. I add in the code below the good method for getting the header in small capitals.There is no
headsepline
option to thebook
class;openright
is default andpdftex
should never be specified.You can use
geometry
and get the same effect asfullpage
, but with correct headers.