# Refsegment wrong numbering

The following MWE prints a cumulative bibliography, subdivided by chapter, using biblatex. However there seems to be a problem with the \therefsegment counter because I'm getting "References Chapter 2" instead of "References Chapter 1".

\documentclass{book}
\usepackage[refsegment=chapter, backend=bibtex]{biblatex}

\begin{document}

\frontmatter
\tableofcontents
\chapter{Preface}

\mainmatter
\chapter{First}
\nocite{*}

\backmatter
\setcounter{secnumdepth}{0}

\end{document}

• refsegment=chapter is the rough equivalent of invoking \newrefsegment before \chapter. Part of this issue was brought up in another question. For an example that achieves correct numbering see the manual or this post. – Audrey May 30 '13 at 0:31
• @Audrey That solved my problem! Should I delete my question or you prefer to post your comment as an answer? – petobens May 30 '13 at 20:00

Reference segment numbering starts at zero. The option setting refsegment=chapter is the rough equivalent of invoking \newrefsegment before \chapter. This ensures that citations in the chapter titles don't get assigned to the previous reference segment.

The section entitled "Multiple Bibliographies" in the biblatex manual demonstrates how the chapter and reference segment/section numbering can be kept in sync. Here is an excerpt, adapted to your example.

\documentclass[openany]{book}
\usepackage[defernumbers,backend=bibtex]{biblatex}
\usepackage{hyperref}

[\refname\ for Chapter \ref{refsegment:\therefsection\therefsegment}]

\begin{document}
\frontmatter
\tableofcontents
\chapter{Preface}

\mainmatter

\chapter{First chapter}
\begin{refsegment}
\nocite{glashow,bertram,markey}
\end{refsegment}

\chapter{Second chapter}
\begin{refsegment}
\nocite{companion,ctan,cms}
\end{refsegment}

\backmatter
\chapter{Appendix}