我想让章节和带星号的章节具有不同的beforeskip
和afterskip
。换句话说,我的摘要和参考书目应比编号章节多beforeskip
(约1\baselineskip
} 个,使每个章节中段落的第一行对齐。
我用过。KOMA -Script 中\RedeclareSectionCommand[options]{chapter}
是否有{chapter*}
类似的东西?或者有任何解决方法来实现上述功能?\RedeclareSectionCommand
我的MWE
\documentclass[12pt,a4paper,chapterprefix=true,headings=twolinechapter,
bibliography=totoc]{scrreprt}
\usepackage[a4paper,margin=1in]{geometry}
\usepackage{tinos}
\usepackage[authordate,backend=biber]{biblatex-chicago}
\usepackage{lipsum}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{test1,
author = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
title = {The LaTeX Companion},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\RedeclareSectionCommand[
beforeskip=0pt,
afterskip=2\baselineskip
]{chapter} %% Can I make starred chapter to have
%% different skips using \RedeclareSectionCommand???
\renewcommand*\raggedchapter{\centering}
\addtokomafont{disposition}{\rmfamily}
\setkomafont{chapter}{\large}
\setkomafont{chapterprefix}{\large}
% Make uppercase the chapterprefix.
\renewcommand\chapterlineswithprefixformat[3]{%
\MakeUppercase{#2#3}
}
\parindent=2em
\setlength\bibhang{1.5em}
\begin{document}
\chapter*{Abstract}
\lipsum[1]
\chapter{Introduction}
\lipsum[1]
This is the paragraph with citation \autocite{test1}. \lipsum[1]
\printbibliography
\end{document}
答案1
我认为你真正想要的是一个“幻影”章节前缀。
\documentclass[12pt,a4paper,chapterprefix=true,headings=twolinechapter,
bibliography=totoc]{scrreprt}
\usepackage[a4paper]{geometry}
\RedeclareSectionCommand[
beforeskip=0pt,
afterskip=2\baselineskip
]{chapter} %% Can I make starred chapter to have
%% different skips using \RedeclareSectionCommand???
\renewcommand*\raggedchapter{\centering}
\addtokomafont{disposition}{\rmfamily}
\setkomafont{chapter}{\large}
\setkomafont{chapterprefix}{\large}
\usepackage{etoolbox,lipsum}
\makeatletter
\renewcommand\chapterlineswithprefixformat[3] {%
\ifstrempty{#2}
{%
{\usekomafont{#1prefix}{\strut%
\setlength{\@tempskipa}{\csname scr@#1@innerskip\endcsname}%
\chapterheadmidvskip}}%
}
{%
\MakeUppercase{#2}%
}%
\MakeUppercase{#3}}%
\makeatletter
\begin{document}
\chapter*{Abstract}
\lipsum[1]
\chapter{Introduction}
\lipsum[1]
This is the paragraph with citation \lipsum[1]
\end{document}