報告/書籍:如何自訂\部分外觀(頁面本身和目錄中的列表)?

報告/書籍:如何自訂\部分外觀(頁面本身和目錄中的列表)?

我想知道如何將乳膠文檔“拆分”成“卷”。最終的目錄應該是這樣的:

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

問題:

  1. 我怎樣才能擺脫「我」呢?和“二”。在目錄中?
  2. 每個部分頁面現在都顯示“第一部分,第 1 卷” - 我怎麼能擺脫“第一部分”?
  3. 有沒有辦法自訂零件頁面的外觀?對於每個部分,我想在下面添加幾行文字

編輯:

問題#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}

在這種情況下,您必須重置章節計數器,因為部分計數器不會增加。

或者您可以替換partvolume

\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{…}請使用該部件。scrguien.pdf有關詳細信息,請參閱 KOMA-Script 手冊(當前版本的第 91f 頁)。

相關內容