How to use volumes package

I want to separate my book into different volumes, I searched this site and there is no satisfied solution. I tried to work around with a package called volumes

ftp://ftp.dante.de/tex-archive/macros/latex2e/contrib/volumes/volumes.pdf

However, after reading the mannual, I still have no idea about how to use it, so can anyone just give me a concrete and compilable example.

Replay

The key part is getting the file names right, and compiling correctly. A minimal example looks like the following:

\documentclass{book}
\usepackage{lipsum}
\title{volumes is fun}
\author{me}

\usepackage{volumes}
\volumename{chapter}

\begin{document}
    \input{frontmatter}
    \include{chapter1}
    \include{chapter2}
\end{document}

with the following additional files: frontmatter.tex

\maketitle
\tableofcontents

and chapter1.tex:

\chapter{one}
\lipsum[1]

and chapter2.tex:

\chapter{two}
\lipsum[2]

The volumes package only works on \include's, thus, to always include the frontmatter.tex, we use \input instead. Then, as our files are called chapterX.tex, the \volumename must be set to chapter.

About compiling: First, you have to compile the document as usual. That way, all chapters are typeset and included. So far, the volumes package doesn't do much (if anything...). Now, that the relevant information on the document (page numbers, ...) is saved in the .aux files, you can exclude the parts you want. You can do that by adding e.g.

\onlyvolume[2]

before the \begin{document}. Now, simply recompile the document, and Chapter 1 will be excluded.

Category: packages Time: 2016-07-29 Views: 0
Tags: packages

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.207 (s). 12 q(s)