I'm using biblatex with a biber backend to create a cumulative bibliography, subdivided by chapter. My (simplified) main file (main.tex) is:
\documentclass{book}
\usepackage[refsection=chapter, backend=biber]{biblatex}
\defbibheading{bibbook}[\bibname]{\chapter{#1}}
\defbibheading{subbib}[\refname\space\chaptername\space%
\ref*{refsection:\therefsection}]{%
\setcounter{secnumdepth}{0}%
\section{#1}}
\addbibresource{biblatex-examples.bib}
\usepackage{hyperref}
\includeonly{bar}
\begin{document}
\mainmatter
\include{foo}
\include{bar}
\backmatter
\printbibheading[heading=bibbook]
\bibbysection[heading=subbib]
\end{document}
foo.tex is:
\chapter{Foo}
\label{cha:foo}
\nocite{cms}
and bar.tex is:
\chapter{Bar}
\ref{cha:foo}
\nocite{glashow}
According to this answer the benefit of using \include is that
"There will be a filename.aux file which contains all counter values, like page and chapter numbers etc., at the begin of the filename. This way the file can be compiled alone but still has the correct page and chapter etc. numbers. Such part aux files are read by the main aux file".
I expect the refsection counter to behave the same way. However when using \includeonly{some chapter} I get the following warning:
LaTeX Warning: Label `refsection:01' multiply defined.
LaTeX Warning: There were multiply-defined labels.
If I remove the includeonly command then the warning disappears but is there a way to avoid that warning when using the includeonly command?
Apparently the only way to eliminate the warning is by deleting the aux files of the chapters (not the main file) after each compilation. However in that way counter values are lost.
I know this is just a warning, not an error, and will not be an issue in the final (full) document. However I would like to understand why the warning appears and if possible to eliminate it.
EDIT: Before the bounty ends I want to make clear that I can tell my text editor (vim) not to show the warning. As I said before, what I really want to know why the warning appears when one of the advantages of using include is that it stores counter values.