我想加宽书的外边距,以便留出更多空间来添加旁注。此外,页脚应横跨文本和页边距的整个宽度。更改应仅限于目录和章节,也就是说,标题页和部分页面的页面布局应保持不变。
我已经成功构建了一个最小工作示例。但是,该解决方案并不实用(也不简洁),因为例如,必须在每个新部分\full
之前和\margin
之后插入。这可以自动化吗?
我尝试使用 但etoolbox
没有\patchcmd
结果
\makeatletter
\patchcmd{\scr@startpart}{\full}{}{}{}
\patchcmd{\scr@startchapter}{\margin}{}{}{}
\makeatother
没有产生期望的输出。
梅威瑟:
\documentclass[openany]{scrbook}
\usepackage{showframe}
\usepackage{blindtext}
\usepackage{calc}
\usepackage{scrlayer-scrpage}
\pagestyle{scrheadings}
\renewcommand*{\partpagestyle}{empty}
\BeforeRestoreareas{\clearpage}
\begin{document}
\storeareas\full
\newlength{\addition}\setlength{\addition}{3cm} % for example
\areaset[-.5\addition]{\textwidth-\addition}{\textheight}
\KOMAoptions{footwidth=textwithmarginpar}
\storeareas\margin
\full
\title{Title}
\author{Author}
\maketitle
\margin
\tableofcontents
\full
\addpart{First part}
\margin
\blinddocument
\full
\addpart{Second part}
\margin
\blinddocument
\end{document}
答案1
你可以修补\partheadstartvskip
并\partheademptypage
\documentclass[open=any]{scrbook}
\usepackage{showframe}
\usepackage{blindtext}
\usepackage{calc}
\usepackage{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\renewcommand*{\partpagestyle}{empty}
\BeforeRestoreareas{\clearpage}
\AtBeginDocument{
\storeareas\full
%
\newlength{\addition}\setlength{\addition}{3cm} % for example
\areaset[-.5\addition]{\textwidth-\addition}{\textheight}%
\KOMAoptions{footwidth=textwithmarginpar}%
\storeareas\margin
}
\usepackage{xpatch}
\xpretocmd\partheadstartvskip{\full}{}{\PatchFailed}
\xapptocmd\partheademptypage{\margin}{}{\PatchFailed}
\xpretocmd\maketitle{\full}{}{\PatchFailed}
\xapptocmd\maketitle{\margin}{}{\PatchFailed}
\begin{document}
\title{Title}
\author{Author}
\maketitle
\tableofcontents
\addpart{First part}
\blinddocument
\addpart{Second part}
\blinddocument
\end{document}
答案2
只需重新定义命令\addpart
即可\tableofcontents
:
\documentclass[openany]{scrbook}
\usepackage{showframe}
\usepackage{blindtext}
\usepackage{calc}
\usepackage{scrlayer-scrpage}
\pagestyle{scrheadings}
\renewcommand*{\partpagestyle}{empty}
\BeforeRestoreareas{\clearpage}
\newlength{\addition}\setlength{\addition}{3cm} % for example
\let\oldtoc\tableofcontents
\renewcommand{\tableofcontents}{%
\areaset[-.5\addition]{\textwidth-\addition}{\textheight}
\KOMAoptions{footwidth=textwithmarginpar}
\oldtoc
\typearea{current}%
}
\let\oldaddpart\addpart
\renewcommand{\addpart}[1]{%
\typearea{current}
\oldaddpart{#1}
\areaset[-.5\addition]{\textwidth-\addition}{\textheight}
\KOMAoptions{footwidth=textwithmarginpar}%
}
\begin{document}
\title{Title}
\author{Author}
\maketitle
\tableofcontents
\addpart{First part}
\blinddocument
\addpart{Second part}
\blinddocument
\end{document}