如何在 KOMA Script 的章节页面上添加页脚分隔线?

如何在 KOMA Script 的章节页面上添加页脚分隔线?

我正在使用 KOMA-Script。我想在章节页面上添加页脚分隔线。我尝试过使用\renewcommand*{\chapterpagestyle}{scrheadings},但它也给出了标题和页眉分隔线,而我不想要这些。

% KOMA-Script code for header and footer font
\setkomafont{pageheadfoot}{\normalfont} %font for header
\setkomafont{pagefoot}{\normalfont} %font for footer
\setkomafont{pagenumber}{\normalfont\rmfamily} %font for page numbers

% Define width of header
\setheadwidth[0pt]{textwithmarginpar}

% Define with of header line
\setheadsepline{0.4pt}

% Define width of footer
\setfootwidth[0pt]{text}

% Define with of footer line 
\setfootsepline[text]{0.4pt}

% Define content of header and footer

% Using some scrpage2 commands here. The scrpage2 package is loaded here: 01_Preamble/KOMA-Script-Packages.tex

% Clear all defaults
\ohead{\text{\headmark}}

% Left (even page numbers) 
\lefoot%

[% scrplain style (begin)
\pagemark

]% scrplain style (end)

{
\pagemark
}% scrheadings style (end)

% Right (odd page numbers) 
\rofoot%

[% scrplain style (begin)
\pagemark

]% scrplain style (end)

{% scrplain style (begin)

\pagemark

}% scrplain style (end)

%
% #######################
% End: Header and Footer Customization
% #######################

答案1

默认情况下,类选项​​也会footsepline在页面页脚上方添加规则plain

\documentclass[footsepline]{scrreprt}
\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}

但看起来你加载了包scrlayer-scrpage。然后你必须添加包选项plainheadsepline

\documentclass[footsepline]{scrreprt}
\usepackage{blindtext}
\usepackage[plainheadsepline]{scrlayer-scrpage}
\begin{document}
\blinddocument
\end{document}

附加说明:scrlayer-scrpage还提供了具有不同语法的选项footsepline- 您可以使用包选项调整规则的粗细和长度(请参阅文档)。如果您在类或包选项中设置footsepline或,则使用规则的默认设置。footsepline=truescrheadings


更新(在问题中添加了代码片段)

使用您问题中的代码片段,我建议切换到包scrlayer-scrpage

\documentclass{scrbook}
\usepackage{blindtext}% only for dummy text

\usepackage[
  automark,
  headsepline,
  footsepline,plainfootsepline,
  headwidth=textwithmarginpar
  ]{scrlayer-scrpage}
\setkomafont{pageheadfoot}{\normalfont}
\clearpairofpagestyles
\ohead{\headmark}
\ofoot*{\pagemark}
\begin{document}
\blinddocument
\end{document}

相关内容