# Why do I need \newrefsegment when I already specify refsegment=section?

The following works well and shows exactly what I want. I am just wondering about this: Why do I have to use \newrefsegment, if I already specified refsegment=section? I expected everything to work without extra \newrefsegment commands. On the other hand, I can omit refsegment=section and it still works (which is somehow clear).

\documentclass{scrartcl}

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[american]{babel}
\usepackage{titlesec}
\usepackage[
backend=bibtex,
style=authoryear,
refsegment=section
]{biblatex}

\section*{References for Section \ref{refsegment:\therefsection\therefsegment}}
}

\begin{document}

\section{Foo}
\newrefsegment
\textcite{reese}

\section{Bar}
\newrefsegment
\textcite{glashow}

\end{document}

-
refsegment=section is the rough equivalent of setting \newrefsegment before \section. biblatex patches divisional commands this way to ensure that citations in titles don't get assigned to the previous reference segment or section. –  Audrey Feb 25 '13 at 21:30
Thanks, Audrey. Is it then possible to increase the counter by 1 globally so that only using refsegment=section leads to the correct output? I just tried \setcounter{therefsegment}{1} ... but that fails –  Marius Hofert Feb 25 '13 at 21:39

To obtain correct label references, you should adapt the examples given in the "Multiple Bibliographies" and "Subdivided Bibliographies" sections of the biblatex documentation. For your case this means omitting refsegment=section and either using \newrefsegment after \section or wrapping the section body in \begin{refsegment} and \end{refsegment}.

The refsegment=section setting is the rough equivalent of issuing \newrefsegment before \section. biblatex patches divisional commands this way to ensure that citations in titles don't get assigned to the previous reference segment or section.

To define the label after the section counter is incremented you can patch the relevant commands in your preamble. For example:

\makeatletter
\patchcmd{\refsegment}
{\label{refsegment:\the\c@refsection\the\c@refsegment}}{}{}{}
\apptocmd{\@sect}
{\label{refsegment:\the\c@refsection\the\c@refsegment}}{}{}
\makeatother


Although appending patches may interfere with other packages that format titles.

The titlesec package redefines the high-level divisional commands so any low-level patches done by biblatex are ignored; the refsegment and refsection options won't work at all.

-
Hi Audrey. Thanks for helping. I initially thought it works, but I load the package titlesec as well, and then it seems to break down. I update the minimal example accordingly. Do you know a solution for that? –  Marius Hofert Feb 25 '13 at 23:47
Thanks a lot, Audrey, just saw your updated answer. –  Marius Hofert Feb 26 '13 at 11:43