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.

Here's the deal: I have a biblatex bibliography with a prenote. The prenote contains a citation with a lot of authors. I want it to behave as if it were obeying maxnames=3. But I want my bibliography to behave as if maxnames=99. Is there a way to set the value of maxnames locally for that one citation?

More generally, is there a procedure for locally setting biblatex options?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

This is the first time I encountered a citation command within the bibliography. Note: \defcounter (an etoolbox macro) instead of \setcounter allows for local redefinition of counters. (EDIT: I used the same hack in my answer to Adding an [AuthorYear] block at the beginning of bibliography entries .)

\documentclass{article}

\usepackage[style=authoryear,maxnames=99,maxcitenames=3]{biblatex}

\newcounter{mymaxcitenames}
\AtBeginDocument{%
  \setcounter{mymaxcitenames}{\value{maxnames}}% i.e., 3 (!)
}

\defbibnote{recommended}{If you don't have time to read anything else, read
  \begingroup
  \defcounter{maxnames}{\value{mymaxcitenames}}%
  \textcite{A01}.%
  \endgroup
}

\usepackage{filecontents}

\begin{filecontents}{biblatextest.bib}
@misc{A01,
  author = {Author, A. and Buthor, B., and Cuthor, C. and Duthor, D.},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}

\addbibresource{biblatextest.bib}

\begin{document}

If you don't have time to read anything else, read \textcite{A01}.

\printbibliography[prenote=recommended]

\end{document}
share|improve this answer
    
@lockstep the reason for the citation in the prenote is to reference where the figures in the paper are originally found. I'd have thought that wasn't that uncommon... –  Seamus Mar 7 '11 at 14:31
    
@Seamus: If my answer wasn't useful for you, I'd like to hear how to sharpen it up. –  lockstep Mar 8 '11 at 17:56
    
@lockstep I actually think maxcitenames will solve my problem on its own, won't it? I don't think my version of biblatex has it though, so I will have to update... I'll check back later. –  Seamus Mar 8 '11 at 19:04
    
@Seamus: For versions <1.1, delete the maxnames and maxcitenames preamble options, add [maxnames=99] to \printbibliography and try again. –  lockstep Mar 8 '11 at 19:12
    
@lockstep I've updated to 1.2a. Citations in the prenote inherit their cite style from the printbibliography command, so annoyingly, a \cite inside the prenote prints all the authors. I'll try your solution in a while... –  Seamus Mar 9 '11 at 11:19
show 1 more comment

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.