Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}

\defbibheading{subbibheading}{
  \section*{References for Section \ref{refsegment:\therefsection\therefsegment}}
}
\addbibresource{biblatex-examples.bib}

\begin{document}

\section{Foo}
\newrefsegment
\textcite{reese}
\printbibliography[segment=\therefsegment, heading=subbibheading]

\section{Bar}
\newrefsegment
\textcite{glashow}
\printbibliography[segment=\therefsegment, heading=subbibheading]

\printbibliography[heading=bibintoc]
\end{document}
share|improve this question
2  
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

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
    
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

Your Answer

 
discard

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.