TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a question about a problem that I am facing. I have a document composed by two different and independent parts in two where the second parts refers to just some elements of the first one. Both the parts shares a common information as for example bibliography.

What I would like to generate is a document where the numbering of each parts start from 1 (also Figures, Table etc. follow the same numbering...). For example:

Part I

Chapter 1 Section 1.x Sub Section 1.x.y

Chapter 2 Section 2.x Sub Section 2.x.y -->Fig. 2.x.1


Part II

Chapter 1 Section 1.x Sub Section 1.x.y

Chapter 2 Section 2.x Sub Section 2.x.y -->Fig. 2.x.1


As I said, the second part refers somehow to elements in the first one. Therefore, inside the Part II -Chapter 2 -Section 2.x, I can have for example, a reference to Section 2.x of Part I (lets say Fig. 2.x.1)

Is it possible to do?

share|improve this question
Did you check tex.stackexchange.com/q/17127 or tex.stackexchange.com/q/2445 ? Do the solutions provided there solve your problem? If so, this is a possible duplicate. – Count Zero Sep 4 '12 at 14:31

Compared to the class book, chapters are reset at the begin of a new part and figures and tables are reset at the start of a new section. There are several methods to do that, see the links in the comment of Count Zero above.

It remains the problem, that the numbering is not unique and it is not clear, to which part figure 2.1.1 belong to, for example. The following example adds the part, if the reference points outside the current part:


Each reference is prefixed by \p@<counter> that is redefined to expand to \RefPart with the current part number. \RefPart is defined using \DeclareRobustCommand, because it must not be expanded, when the label is written to the .aux file. This way the \RefPart is executed at time of \ref that can be called in both parts generating different references (with and without part prefix).

Additionally the example is tested with hyperref.



% numbering of chapters inside part:
% numbering of figure/table inside section:


\part{First part}
\chapter{Chapter A}
Reference inside part: \ref{figE}\\
reference to other part: \ref{figEE}
\chapter{Chapter B}
\section{Section C}
\subsection{Subsection D}
\caption{Figure E}

\part{Second part}
\chapter{Chapter AA}
Reference to other part: \ref{figE}\\
reference inside part: \ref{figEE}   
\chapter{Chapter BB}
\section{Section CC}
\subsection{Subsection DD}
\caption{Figure EE}

share|improve this answer

Your Answer


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.