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 am having my biblatex defaults to switch to 'et al.' rather late (past three authors). Now I have occasions where the repeated mention of an author asks for a short form 'Author et al.', irrespective of the number of co-authors. I already use a custom name format like this:

\DeclareNameFormat{idem}{%
  \usebibmacro{name:last}{#1}{#3}{#5}{#7}%
  \usebibmacro{name:andothers}}

How would I create another name format, say with \DeclareNameFormat{short} that always resorts to 'et al.' if there is more than one author; without changing my global biblatex style settings (maxnames -- don't want to touch it!). Is there any other macro than name:andothers that I can use?


The answer of @lockstep gets close. But I want to have \citeauthor{A01} behave normally, except for cases where I repeat the authors multiple times. I can of course add a duplicate entry with this technique; still I wonder if I can get the following 'naive' idea taken from that answer to work:

\newcommand{\personshort}[1]{\defcounter{maxnames}{1}\citeauthor{#1}}

This 'works' but seems to overwrite maxnames for the rest of the document. how would I encapsulate the defcounter to be effective only inside this \newcommand?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

Instead of defining a special name format, I suggest the following:

  • Define a new bibliography category and add the "special occasion" keys to it,

  • Use \AtEveryCitekey to test for this category and, if true, set maxnames to 1 locally (using \defounter from the etoolbox package, which is loaded by biblatex).


\documentclass{article}

\usepackage[style=authoryear]{biblatex}

\DeclareBibliographyCategory{alwaysetal}
\addtocategory{alwaysetal}{A01}

\AtEveryCitekey{%
  \ifcategory{alwaysetal}{%
    \defcounter{maxnames}{1}%
  }{%
  }%
}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {A and B and C},
  year = {2001},
  title = {Alpha},
}
@misc{D02,
  author = {D and E and F},
  year = {2002},
  title = {Bravo},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\cite{A01}

\cite{D02}

\printbibliography

\end{document}

enter image description here

share|improve this answer
    
Thank you, lockstop. The defcounter seems to do the trick, but can I use it within a dedicated command instead of adding particular bibliography entries to a category (see my edited question)? –  Emit Taste Jun 26 '12 at 10:10

Using the above answer along with another related answer from @lockstep, I arrived at the following, which seems to be what I want:

\newcommand{\personshort}[1]{\begingroup%
\defcounter{maxnames}{1}\citeauthor{#1}%
\endgroup}

This temporarily sets the maxnames count to one, and I have a dedicated command \personshort for the occasions where I want the fallback to 'at al.' immediately.


In my wider context I use a \person command with two arguments, the latter being the name format (called \formatname in this answer). I was able then to change that do conditionally use the above command instead of a name format:

\newcommand*{\person}[2]{%
  \ifstrequal{#2}{short}{\personshort{#1}}{\citename{#1}[#2]{author}}%
}

So I have for example \person{miller1960plans}{sci} for the longest format, using initials and up to three names, then \person{miller1960plans}{idem} for normal repetitions, leaving out the initials, and \person{miller1960plans}{short} for the coercion to 'et al' despite a number of co-authors smaller than or equal to maxnames.

  • sci: G. A. Miller, E. Galanter and K. H. Pribram
  • idem: Miller, Galanter and Pribram
  • short: Miller et al.
share|improve this answer

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.