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.

I have a problem, where all my googeling has left me standing alone. Currently I am preparing my thesis and I am using biblatex in conjunction with biber.

When dealing with the entrytype set everything worked quite well. Now the following Problem has occurred: I am citing a book first and thereafter this book shall be part of a set, where I can add an comment to this and some other references. For example:

Here is where the book is cited.[foo] Some other Text, with some more citations.[baz,biz,buz] Then some more text and reference to a set of references.[foobar]

Now the bibliography should show like this:

[foo] The Author, The Title...

[baz] The Author, The Title...

[biz] The Author, The Title...

[buz] The Author, The Title...

[foobar] a) [foo] b) a comment c) The Author, The Title... (of [bar1]) d) The Author, The Title... (of [bar2]) d) ...

Apparently this is not possible, as the output changes automatic to citing members of the set:

Here is where the book is cited.[foobar-a] Some other Text, with some more citations.[baz,biz,buz] Then some more text and reference to a set of references.[foobar]

and the bibliography:

[baz] The Author, The Title...

[biz] The Author, The Title...

[buz] The Author, The Title...

[foobar] a) The Author, The Title... (of [foo]) b) a comment c) The Author, The Title... (of [bar1]) d) The Author, The Title... (of [bar2]) d) ...

I know one can work-around this problem with creating misc type entries, where the note command references the actual book:

@MISC{foo-ref,
  note = {\cite{foo}}
}

and including these into the set. I could work with that, but I would rather find a more elegant solution.

Browsing the biblatex manual I couldn't find an option which completes my goal, or maybe I missed it (It is kind of huge.)

Therefore I would be very grateful if anyone has a better solution.

Edit: Here is a MWE:

\RequirePackage{filecontents}
\begin{filecontents}{test.bib}
@BOOK{foo,
  title = {Foo},
  publisher = {the Press},
  year = {3000},
  author = {the Foo},
}

@ARTICLE{baz,
  author = {the Baz},
  title = {Baz},
  journal = {J. of Baz},
  year = {3001},
  volume = {1},
  pages = {22},
}

@ARTICLE{buz,
  author = {the Buz},
  title = {Buz},
  journal = {J. of Buz},
  year = {3001},
  volume = {1},
  pages = {22},
}

@MISC{comment,
  note = {a comment},
}

@BOOK{bar,
  title = {Bar},
  publisher = {the Press},
  year = {3002},
  author = {the Bar},
}

@SET{foobar,
  entryset = {foo,comment,bar},
}
\end{filecontents}

\documentclass[12pt,final]{scrreprt}               

\usepackage[ngerman]{babel}                   
\usepackage[utf8]{inputenc}                   
\usepackage[T1]{fontenc}                      

\usepackage[german=quotes
           ]{csquotes}
\usepackage[backend=biber,
            sorting=none,
            style=numeric-comp,
            style=chem-angew,
            subentry=true,
            maxcitenames=5,mincitenames=4,
            maxbibnames=99,
            backref=true,
            natbib=true
            ]{biblatex}

\addbibresource{test.bib}

\begin{document}
Here is where the book is cited.\autocite{foo}
Some other Text, with some more citations.\autocite{baz,buz} 

Then some more text and reference to a set of references.\autocite{foobar}

\printbibliography
\end{document}

That results in attached picture (top). With the workaround I get what I want (bottom). But this is clearly not an elegant solution as one can see with the backreferences, which are pointing to the bibliography entry of 1. (But I could live with that.) enter image description here

share|improve this question
2  
Can you give a MWE? I suspect people will need to tinker with some settings to solve this. –  PLK Jul 9 '13 at 11:14
1  
A MWE would help. Instead of entry sets, the related entries feature introduced in biblatex 2.0/biber 1.0 might be more appropriate here. –  Audrey Jul 9 '13 at 11:25
    
I have added a MWE. @Audrey I have as you suggested looked at the related entries option. I am a little surprised I overlooked that. But it would not solve the problem completely as I still need another key. What it clearly makes better is that the backreference is correct. But what it does not is, that it compresses all the data to [1] (or again i missed something). –  Martin Jul 10 '13 at 9:43

1 Answer 1

up vote 5 down vote accepted

The biber-only related entries feature was introduced to biblatex 2.0. It provides a flexible way to group entries. The default output is similar to that of entry sets with subentry disabled, but it can be customized via the relatedtype field. This field specifies the localization string, formatting directive and bibliography macro used to set the entries given in the related field. In the example below a new relatedtype key called set is defined.

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=chem-angew,backref,subentry,citetracker]{biblatex}
\usepackage[colorlinks]{hyperref}

% Access internal back-reference command
\makeatletter
\newcommand*{\mkbibbackref}[1]{\blx@backref{#1}}
\makeatother

% Customize output for related entries of the type set
\newbibmacro*{related:set}[1]{%
  \ifbool{bbx:subentry}
    {\printtext[parens]{\alph{bbx:relatedcount}}%
     \printunit*{\addnbspace}}
    {}%
  \entrydata{#1}{%
    \ifentryseen{\thefield{clonesourcekey}}
      {\entrydata{\thefield{clonesourcekey}}{%
         \mkbibbackref{\thefield{entrykey}}%
         \printtext[brackets]{\printfield{prefixnumber}\printfield{labelnumber}}}}
      {\usedriver{}{\thefield{entrytype}}}}}

% Move back-references for related entries of the type set to the end of the item
\AtEveryBibitem{%
  \iffieldequalstr{relatedtype}{set}
    {\renewcommand*{\relateddelim}{\addsemicolon\space}%
     \savelist*{pageref}{\savedpageref}%
     \clearlist{pageref}}
    {}}
\renewbibmacro*{finentry}{%
  \restorelist{pageref}{\savedpageref}%
  \setunit*{\space}%
  \usebibmacro{pageref}%
  \finentry}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{foo,
  title = {Foo},
  publisher = {the Press},
  year = {3000},
  author = {the Foo}}
@ARTICLE{baz,
  author = {the Baz},
  title = {Baz},
  journal = {J. of Baz},
  year = {3001},
  volume = {1},
  pages = {22}}
@ARTICLE{buz,
  author = {the Buz},
  title = {Buz},
  journal = {J. of Buz},
  year = {3001},
  volume = {1},
  pages = {22}}
@MISC{comment,
  note = {a comment}}
@BOOK{bar,
  title = {Bar},
  publisher = {the Press},
  year = {3002},
  author = {the Bar}}
@MISC{foobar,
  related = {foo,comment,bar},
  relatedtype = {set}}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
Here is where the book is first cited.\autocite{foo} \clearpage
Reference to a set of references.\autocite{foobar} \clearpage
More citations.\autocite{baz,buz} \clearpage
Another citation to the book.\autocite{foo}
\printbibliography
\end{document}

enter image description here

The output of each related entry is customized by the new related:set bibliography macro. It prints the related entry counter ("(a)", "(b)", etc.) when subentry is enabled and, depending on the entry's citation status, either the entry's numeric label or its "verbose" label given by \usedriver.

When the related entry set foobar is cited, three bbl entries are generated for foo, comment and bar. These entries are "cloned" and given new hash-generated entry keys to avoid conflict with direct citations. So the bbl file here has two separate entries for foo - one generated by a citation directly to foo and a second arising from the citation to foobar. The original key for a cloned entry is provided by the field clonesourcekey, which was introduced to biblatex 2.6.

Note that the new related:set provides subentry-like numbers, but these are not accessible via the citation label numbers; individual related entries will have to be cited directly as with the entry foo above.

share|improve this answer
    
I really like your solution, unfortunately it introduces something I cannot resolve myself. If you compare entry sets [1-3] with [4], you will notice that the reference 'siehe' is not in parens in [4]. However I could easily live with that. But in every citation after [4] there are additional (wrong) pagenumbers as backreferences. I figured out that it has something to do with the finentry macro, as if it is uncommented the original behaviour is restored, but backrefs of [4] are missing. –  Martin Jul 11 '13 at 12:43
    
@Martin Your sample didn't have parentheses, which is why I left them out. For the second problem I forgot an \undef. I'll post a fix in a bit. –  Audrey Jul 11 '13 at 13:41
    
I apologize for that. I just noticed that backrefs without parentheses is the default behaviour for citing a set. I totally overlooked that. Thank you very much for your coding, it is now working very well. –  Martin Jul 12 '13 at 8:28
    
@Martin No problem. Now that I think of it, the \undef business is unnecessary if the back-references are saved locally instead of globally. I'll make one last edit to address that. –  Audrey Jul 12 '13 at 17:05

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.