0

I am trying to do a book/report using scrbook. I have used my own headers/footers. I had invoked \bibliographystyle{ieetr} along with my bib file \bibliography{list_of_references.bib} , along with thispagestyle{empty} so that my headers/footers don't interfere with my references. But, the headers/footers seem to persist. I also tried used \newpage & \clearpage, but it didn't work out. The error is as shown below

enter image description here

Is there a way to get rid of this Header? or is a bug perhaps?

Sample Code:

\documentclass[chapterprefix=true, oneside, a4paper,egregdoesnotlikesansseriftitles]{scrbook}
\usepackage{lipsum}

\RedeclareSectionCommand[
beforeskip=0pt,
innerskip=0pt,
afterskip=1\baselineskip
]{chapter}
\usepackage{cite}
\usepackage{etoolbox}
\newcommand\titlerule[1][1pt]{\noindent\rule{\linewidth}{#1}\par}
\preto\chapterformat{\IfUsePrefixLine{\vspace{-\baselineskip}\titlerule}{}}
\preto\chapterheadendvskip{\titlerule}

\usepackage{xcolor}
\definecolor{auburn}{rgb}{0.43, 0.21, 0.1}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand\HRule{\rule{\textwidth}{0.5pt}}
\usepackage[symbol]{footmisc}
\usepackage[nottoc]{tocbibind}
\usepackage{xcolor} %for choosing color
\usepackage{empheq} % for boxes
\pagestyle{fancyplain}% <- use fancyplain instead fancy
\fancyhf{}
\fancyfoot[L]{}% <- added
\fancyfoot[R]{}
\fancyfoot[C]{}
\fancyhead[R]{}
\fancyhead[L]{Effects of weather}
\let\oldfootrule\footrule% Copy \headrule into \oldheadrule
\renewcommand{\footrule}{\color{auburn}\oldfootrule}% Add colour to \headrule
\let\oldheadrule\headrule% Copy \headrule into \oldheadrule
\renewcommand{\headrule}{\color{auburn}\oldheadrule}% Add colour to \headrule
\renewcommand{\headrulewidth}{2.5pt}
\renewcommand{\footrulewidth}{2.5pt}
\newlength\FHleft
\newlength\FHright
\setlength\FHright{0.6cm}
\newbox\FHline
\setbox\FHline=\hbox{\hsize=\paperwidth%
    \hspace*{\FHleft}%
    \rule{\dimexpr\headwidth-\FHleft-\FHright\relax}{\headrulewidth}\hspace*{\FHright}%
}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,% make the links colored 
    linkcolor = blue 
    %   linktoc=none% <- no links in ToC
}
\geometry{
    a4paper,
    left=1.25in,
    top=1in,
    bottom=1in,
    right=0.75in,
    headheight=.4in,headsep=12pt,heightrounded
}  
\usepackage{Times}
\usepackage{ragged2e}
\begin{document}
    \addchap{Abstract}
    \pagenumbering{roman}
    \thispagestyle{empty}
    \addchap{Acknowledgment}
    \thispagestyle{empty}
    \tableofcontents
    %\addcontentsline{toc}{chapter}{Bonofide Certificate}
    %   \addtocontents{toc}{~\hfill\textbf{Page}\par}
    %   \addchap{Bonofide Certificate}
    \thispagestyle{empty}
    \listoffigures
    \thispagestyle{empty}
    \listoftables
    \thispagestyle{empty}
    \chapter{Introduction}
    \pagenumbering{arabic}
    \thispagestyle{empty}
    \section{Introduction}
\lipsum[1-2]\cite{diffie1976new}\lipsum[1-2]\cite{EC_BW} 
    \chapter{Theory}
    \thispagestyle{empty}
    \lipsum
    \chapter{Implementation}
    \thispagestyle{empty}
    \lipsum
    \chapter{Inference}
    \thispagestyle{empty}
    \lipsum
    \chapter{Future Scope}
    \thispagestyle{empty}
    \lipsum
    \newpage
    \medskip
    \thispagestyle{empty}
    %\clearpage
    \newpage
    \bibliographystyle{ieeetr}
    \bibliography{list_of_references.bib} 
\end{document}
0

1 Answer 1

1

If the chapter pages should use page style empty add

\renewcommand{\chapterpagestyle}{empty}

to the preamble. Then there is no need of \thispagestyle{empty} next to \chapter{...}.

In the following example I remove all the unrelated stuff, replace package fancyhdr by scrlayer-scrpage and package tocbibind by the KOMA-Script options listof=totoc, bibliography=totoc, index=totoc.

\begin{filecontents}{example-bib.bib}
@book{aristotle:physics,
  author       = {Aristotle},
  title        = {Physics},
  date         = 1929,
  translator   = {Wicksteed, P. H. and Cornford, F. M.},
  publisher    = {G. P. Putnam},
  shorttitle   = {Physics},
}
\end{filecontents}

\documentclass[chapterprefix=true, oneside, a4paper,
  sfdefaults=false, % replaces egregdoesnotlikesansseriftitles, needs version 3.39 or newer
  listof=totoc,
  bibliography=totoc,
  index=totoc
]{scrbook}
\usepackage{blindtext}% only for dummy text

\RedeclareSectionCommand[
  beforeskip=0pt,
  innerskip=0pt,
  afterskip=1\baselineskip,
  afterindent=true% or afterindent=false?
]{chapter}
\usepackage{cite}
\usepackage{etoolbox}
\newcommand\titlerule[1][1pt]{\noindent\rule{\linewidth}{#1}\par}
\preto\chapterformat{\IfUsePrefixLine{\vspace{-\baselineskip}\titlerule}{}}
\preto\chapterheadendvskip{\titlerule}

\usepackage{tikz}% loads xcolor
\usetikzlibrary{calc}
\definecolor{auburn}{rgb}{0.43, 0.21, 0.1}

\usepackage[headsepline=2.5pt,footsepline=2.5pt]{scrlayer-scrpage}
\clearmainofpairofpagestyles
\ihead{Effects of weather}
\addtokomafont{pageheadfoot}{\normalfont}
\addtokomafont{headsepline}{\color{auburn}}
\addtokomafont{footsepline}{\color{auburn}}

\usepackage{geometry}
\geometry{
    a4paper,
    left=1.25in,
    top=1in,
    bottom=1in,
    right=0.75in,
    headheight=.4in,headsep=12pt,heightrounded
}
\usepackage{newtxtext,newtxmath}
\usepackage{ragged2e}

\usepackage{hyperref}% load as last package
\hypersetup{
    colorlinks=true,
    linkcolor = blue 
   %linktoc=none% <- no links in ToC
}
\renewcommand{\chapterpagestyle}{empty}% <- sets page style of chapter pages

\bibliographystyle{ieeetr}

\begin{document}
\frontmatter
\addchap{Abstract}
\addchap{Acknowledgment}
\tableofcontents
\listoffigures
\listoftables

\mainmatter
\chapter{Introduction}
\section{Introduction}
\Blindtext[2]\cite{aristotle:physics}
\Blindtext[2]
\begin{figure}
\caption{A figure}
\end{figure}
\begin{table}
\caption{A table}
\end{table}

\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument

\bibliography{example-bib.bib}
\end{document}

enter image description here

enter image description here

You must log in to answer this question.

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