Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I was wondering how I can 'split' up a latex document into 'volumes'. The final TOC should read something like this:

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

the following code gives me the correct chapter numbering, but unfortunately the parts get numbered too

\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}

this is the result:

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

Questions:

  1. How do I get rid of the 'I.' and 'II.' in the TOC?
  2. Each part page now reads "part I. Volume 1" - how can I get rid of the "part I"?
  3. is there a way to customize the look of the part page? For each part I would like to put a few lines of text below

EDIT:

Quick and dirty solution to question #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}
share|improve this question
    
Generally, you should not edit answers into the original question, but write a separate answer -- this helps to keep the site tidy and may yield you additional rep. Your answer at hand doesn't work because \part* won't reset the chapter counter. –  lockstep Dec 3 '11 at 17:06
add comment

migrated from stackoverflow.com Dec 3 '11 at 15:41

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 2 down vote accepted

Either get rid of the number replacing \part by \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}

You have to reset the chapter counter in this case, because the part counter would not be increased.

Or you may replace part by 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}

But in this case you will have 1 Volume instead of Volume 1 at the table of contents.

I would use a modified 1st solution:

\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}

To add some text below the part head \setpartpreamble{…} has been used. See the KOMA-Script manual (page 91f at the current version of scrguien.pdf) for more information.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.