如何设置 \documentclass{scrbook} 中带有水平线的页眉和页脚样式?

如何设置 \documentclass{scrbook} 中带有水平线的页眉和页脚样式?

我想为我的文件添加页眉和页脚\documentclass{scrbook},该怎么做?我现在只使用页眉,没有线条\pagestyle{headings},但不知道如何添加线条和页脚。

\documentclass{scrbook} % <= Druckversion: "scrbook", Bildschirmversion: "scrreprt"
\usepackage[hidelinks]{hyperref}
\newcommand\bcor{12mm} % <= Bindungskorrektur für Druckversion
\usepackage{osm-thesis}
\usepackage{longtable}
\usepackage{pgfplots}
\usepackage{tabularx}
\usepackage{multirow, makecell, booktabs}
\usepackage{placeins}

\def\tabularxcolumn#1{m{#1}}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\renewcommand{\arraystretch}{1.5}

\makeatletter
  \providecommand*\setfloatlocations[2]{\@namedef{fps@#1}{#2}}
\makeatother
\setfloatlocations{figure}{htbp}

\setfloatlocations{table}{htbp}


% DOCUMENT
%\KOMAoption{draft}{true} % <= z.B. zum "Debuggen" der Overfull-Boxes
\bibliography{thesis}


\begin{document}
    %\selectlanguage{ngerman}
    \selectlanguage{english}

% Einband
%\pagenumbering{alph}
%\ifisbook\include{content/coverpage}\fi
%\ifisbook\cleardoubleemptypage\fi

% (Haupt-)Titelseite, Abstract, ggf. Danksagung & Inhaltsverzeichnis
\pagenumbering{roman}
\include{content/titlepage}
% Eigenständigkeitserklärung
 



\ifisbook\pagestyle{plain}
\cleardoubleemptypage
\include{content/disclaimer}\fi
\ifisbook\cleardoubleemptypage\fi\include{content/abstract}
%\ifisbook\cleardoubleemptypage\fi\include{content/dedication}
%\tableofcontents


\tableofcontents


% Textteil
\pagenumbering{arabic}
\listoftables
\listoffigures
\pagestyle{headings}




\include{content/chapter1}
\include{content/chapter2}
\include{content/chapter3}
\include{content/chapter4}
\include{content/chapter5}
\include{content/chapter6}
\include{content/chapter7}
\include{content/chapter8}


\appendix\include{content/appendix} % example

% Bibliographie
\onecolumn{
\ifisbook\cleardoubleemptypage\fi
\phantomsection\addcontentsline{toc}{chapter}{\refname}
\printbibliography[category=cited, title={References}]}



\end{document}

答案1

要启用这些线条,您可以使用 KOMA 选项headseplinefootsepline

\documentclass{scrbook}
\KOMAoptions{headsepline,footsepline}
\usepackage{blindtext}% only for dummy text
\begin{document}
\Blinddocument
\end{document}

如果需要修改页脚,请加载包scrlayer-scrpage

\documentclass{scrbook}
\usepackage[automark]{scrlayer-scrpage}% sets page style scrheadings automatically
\KOMAoptions{%
  headsepline,footsepline,
  %plainheadsepline,% headsepline on plain pages too
  plainfootsepline
  }

\ifoot[plain page inner footer]{inner footer}
\cfoot*{centered footer}

\usepackage{blindtext}% only for dummy text
\begin{document}
\Blinddocument
\end{document}

注意:如果scrlayer-scrpage加载了包,页面样式headings仅仅是层页面样式的别名scrheadings

相关内容