我想知道如何将乳胶文档“拆分”为“卷”。最终的目录应如下所示:
Volume 1 2
1. chapter 1 of volume 1 3
2. chapter 2 of volume 2 15
Volume 2 35
1. chapter 1 of volume 2 36
2. chapter 2 of volume 2 40
下面的代码给了我正确的章节编号,但不幸的是部分编号也
\documentclass[openright]{scrreprt}
% enforces that chapter numbering restarts after each 'part'
\makeatletter\@addtoreset{chapter}{part}\makeatother%
\usepackage{lipsum}% for dummy text
\begin{document}
\tableofcontents
\part{Volume 1}
\chapter{chapter 1 of volume 1}
\lipsum[1-10]
\chapter{chapter 2 of volume 1}
\lipsum[1-10]
% volume 2 starts with its own chapter numbering
\part{Volume 2}
\chapter{chapter 1 of volume 2}
\lipsum[1-10]
\chapter{chapter 2 of volume 2}
\lipsum[1-10]
\end{document}
结果如下:
I. Volume 1 2
1. chapter 1 of volume 1 3
2. chapter 2 of volume 2 15
II. Volume 2 35
1. chapter 1 of volume 2 36
2. chapter 2 of volume 2 40
问题:
- 如何去掉目录中的“I.”和“II.”?
- 现在每个部分页面都写着“第一部分,第 1 卷”——我怎样才能摆脱“第一部分”?
- 有没有办法自定义零件页面的外观?对于每个零件,我想在下面放几行文字
编辑:
问题 #1 的快速解决方案:
\documentclass[openright]{scrreprt}
% enforces that chapter numbering restarts after each 'part'
\makeatletter\@addtoreset{chapter}{part}\makeatother%
\renewcommand\partname{Volume}
\usepackage{lipsum}% for dummy text
% show chapter & section in TOC, no subsection
\setcounter{tocdepth}{1}
\begin{document}
\tableofcontents
% don't add Volume 1 to TOC
\part*{this is volume 1}
% add manual entry for volume 1
\addcontentsline{toc}{part}{this is volume 1}
\chapter{chapter 1 of volume 1}
\lipsum[1-10]
\section{sdfg}
\end{document}
答案1
删除该数字\part
并用以下方法替换\addpart
:
\documentclass[openright]{scrreprt}
\usepackage{lipsum}% for dummy text
\begin{document}
\tableofcontents
\addpart{Volume 1}\setcounter{chapter}{0}
\chapter{chapter 1 of volume 1}
\lipsum[1-10]
\chapter{chapter 2 of volume 1}
\lipsum[1-10]
% volume 2 starts with its own chapter numbering
\addpart{Volume 2}\setcounter{chapter}{0}
\chapter{chapter 1 of volume 2}
\lipsum[1-10]
\chapter{chapter 2 of volume 2}
\lipsum[1-10]
\end{document}
在这种情况下,您必须重置章节计数器,因为部分计数器不会增加。
或者你可以替换part
为volume
:
\documentclass[openright]{scrreprt}
% enforces that chapter numbering restarts after each 'part'
\makeatletter\@addtoreset{chapter}{part}\makeatother%
\renewcommand*{\thepart}{\arabic{part}}
\renewcommand*{\partname}{Volume}
\usepackage{lipsum}% for dummy text
\begin{document}
\tableofcontents
\part[Volume]{}
\chapter{chapter 1 of volume 1}
\lipsum[1-10]
\chapter{chapter 2 of volume 1}
\lipsum[1-10]
% volume 2 starts with its own chapter numbering
\part[Volume]{}
\chapter{chapter 1 of volume 2}
\lipsum[1-10]
\chapter{chapter 2 of volume 2}
\lipsum[1-10]
\end{document}
但在这种情况下,您将1 Volume
在Volume 1
目录中看到。
我将使用修改后的第一个解决方案:
\documentclass[openright]{scrreprt}
\usepackage{lipsum}% for dummy text
\newcommand*{\volume}[1][]{% optional argument: additional text
\cleardoublepage\refstepcounter{part}%
\setpartpreamble{#1}% add this preamble below the heading
\addpart{Volume \thepart}
}
\renewcommand*{\thepart}{\arabic{part}}
% enforces that chapter numbering restarts after each 'part'
\makeatletter\@addtoreset{chapter}{part}\makeatother%
\begin{document}
\tableofcontents
\volume[{\begin{abstract}\lipsum[1]\end{abstract}}]% Volume with additional text below heading.
\chapter{chapter 1 of volume 1}
\lipsum[1-10]
\chapter{chapter 2 of volume 1}
\lipsum[1-10]
\volume
\chapter{chapter 1 of volume 2}
\lipsum[1-10]
\chapter{chapter 2 of volume 2}
\lipsum[1-10]
\end{document}
已使用在部分标题下方添加一些文本。有关详细信息,\setpartpreamble{…}
请参阅 KOMA-Script 手册(当前版本的 的第 91f 页)。scrguien.pdf