我正在用 latex 写论文,遇到了一个小问题。我怎样才能在以章节标题开头的页面上打印页眉?这些页面上缺少页眉。
这是我的设置的一个小例子:
\documentclass[12pt,oneside,a4paper, headings=small]{scrbook}
\usepackage[top=25mm, bottom=20mm,left=40mm,right=20mm]{geometry}
\usepackage{scrhack}
\usepackage{blindtext}
\usepackage[automark,headsepline]{scrlayer-scrpage}
\automark{chapter}
\ihead{DAS STANDARDISIERTE UNBEWUSSTE}
\chead{}
\ohead{\thepage}
\ifoot*{}
\cfoot[\thepage]{}
%Überschriften Apa-konform
\setcounter{secnumdepth}{-1}
\renewcommand\raggedchapter{\centering}
\RedeclareSectionCommand[
beforeskip=.25\baselineskip,
afterskip=1sp plus -1sp minus 1sp
]{chapter}
\RedeclareSectionCommand[
beforeskip=3.5ex plus 1ex minus .2ex,
afterskip=1sp plus -1sp minus 1sp
]{section}
\RedeclareSectionCommands[
afterskip=-1em,
indent=2em
]{subsection,subsubsection,paragraph}
\renewcommand{\sectioncatchphraseformat}[4]{%
\hskip #2#3#4.%
}
\addtokomafont{disposition}{\rmfamily}
\setkomafont{subsection}{\normalsize}
\setkomafont{subsubsection}{\normalsize\itshape}
\setkomafont{paragraph}{\normalsize\mdseries\itshape}
\cfoot*{}
\ofoot*{}
\pagestyle{scrheadings}
\begin{document}
\chapter{Einleitung}
\blindtext \newpage
\blindtext
\end{document}
非常感谢derlu
答案1
默认情况下,章节页面采用 pagestyle plain
。使用 KOMA-Script 类,您可以更改此行为:
\renewcommand*\chapterpagestyle{scrheadings}
例子:
\documentclass[12pt,oneside,a4paper, headings=small]{scrbook}
\usepackage[top=25mm, bottom=20mm,left=40mm,right=20mm]{geometry}
\usepackage{scrhack}
\usepackage{blindtext}% only for dummy text
\usepackage[headsepline]{scrlayer-scrpage}% activates pagestyle scrheadings automatically
\automark{chapter}
\clearpairofpagestyles
\ihead{DAS STANDARDISIERTE UNBEWUSSTE}
\ohead{\pagemark}
\setkomafont{pagenumber}{}
\renewcommand\chapterpagestyle{scrheadings}
%Überschriften Apa-konform
\setcounter{secnumdepth}{-1}
\renewcommand\raggedchapter{\centering}
\RedeclareSectionCommand[
beforeskip=.25\baselineskip,
afterskip=1sp plus -1sp minus 1sp
]{chapter}
\RedeclareSectionCommand[
beforeskip=3.5ex plus 1ex minus .2ex,
afterskip=1sp plus -1sp minus 1sp
]{section}
\RedeclareSectionCommands[
afterskip=-1em,
indent=2em
]{subsection,subsubsection,paragraph}
\renewcommand{\sectioncatchphraseformat}[4]{%
\hskip #2#3#4.%
}
\addtokomafont{disposition}{\rmfamily}
\setkomafont{subsection}{\normalsize}
\setkomafont{subsubsection}{\normalsize\itshape}
\setkomafont{paragraph}{\normalsize\mdseries\itshape}
\begin{document}
\chapter{Einleitung}
\Blindtext
\end{document}
结果:
或者,您可以使用带星号的版本\ihead
和\ohead
来获取相同的 pagestyle 条目plain
。然后,您必须使用选项在纯页面上激活 headsepline plainheadsepline
:
\usepackage[headsepline,plainheadsepline]{scrlayer-scrpage}% activates pagestyle scrheadings automatically
\automark{chapter}
\clearpairofpagestyles
\ihead*{DAS STANDARDISIERTE UNBEWUSSTE}
\ohead*{\pagemark}
\setkomafont{pagenumber}{}
例子:
\documentclass[12pt,oneside,a4paper, headings=small]{scrbook}
\usepackage[top=25mm, bottom=20mm,left=40mm,right=20mm]{geometry}
\usepackage{scrhack}
\usepackage{blindtext}% only for dummy text
\usepackage[headsepline]{scrlayer-scrpage}% activates pagestyle scrheadings automatically
\automark{chapter}
\clearpairofpagestyles
\ihead*{DAS STANDARDISIERTE UNBEWUSSTE}
\ohead*{\pagemark}
\setkomafont{pagenumber}{}
%Überschriften Apa-konform
\setcounter{secnumdepth}{-1}
\renewcommand\raggedchapter{\centering}
\RedeclareSectionCommand[
beforeskip=.25\baselineskip,
afterskip=1sp plus -1sp minus 1sp
]{chapter}
\RedeclareSectionCommand[
beforeskip=3.5ex plus 1ex minus .2ex,
afterskip=1sp plus -1sp minus 1sp
]{section}
\RedeclareSectionCommands[
afterskip=-1em,
indent=2em
]{subsection,subsubsection,paragraph}
\renewcommand{\sectioncatchphraseformat}[4]{%
\hskip #2#3#4.%
}
\addtokomafont{disposition}{\rmfamily}
\setkomafont{subsection}{\normalsize}
\setkomafont{subsubsection}{\normalsize\itshape}
\setkomafont{paragraph}{\normalsize\mdseries\itshape}
\begin{document}
\chapter{Einleitung}
\Blindtext
\end{document}