Scrbook 中的页眉存在问题

Scrbook 中的页眉存在问题

我正在尝试使用 编写一本书/报告scrbook。我使用了我自己的页眉/页脚。我曾调用\bibliographystyle{ieetr}bib 文件以及\bibliography{list_of_references.bib}thispagestyle{empty}以便我的页眉/页脚不会干扰我的参考文献。但是,页眉/页脚似乎仍然存在。我也尝试使用\newpage& \clearpage,但没有成功。错误如下所示

在此处输入图片描述

有没有办法去掉这个标题?或者是一个错误?

示例代码:

\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}

答案1

如果章节页面应使用页面样式,empty请添加

\renewcommand{\chapterpagestyle}{empty}

到序言部分。那么就不需要\thispagestyle{empty}\chapter{...}

在下面的例子中,我删除了所有不相关的内容,用 KOMA-Script 选项替换了fancyhdrpackage和scrlayer-scrpagepackage 。tocbibindlistof=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}

在此处输入图片描述

在此处输入图片描述

相关内容