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.

Problem

I am writting a paper where I mostly analize 2 papers written by different authors on different years and I am using a couple of other sources. Citations are done via \textcite or \parencite commands using biblatex. I want to ommit the author in these in text citations for the main papers, but not affect the rest of the bibliographic entries.

Example

Instead of

The author mentions, that it is hard to find an example (Author, 2009, p.83). However, another mentions, that it can be even more difficult (Author2, 2008, p.77).

I want

The author mentions, that it is hard to find an example (2009, p.83). However, another mentions, that it can be even more difficult (2008, p.77).

I think as long as I do not include more papers in this naming scheme, it might be okay? What others have to say about it? However, in the bibliography list, I want the author fields to be present (i.e. unchanged).

Question

Does anybody know if there is an elegant way of doing it? Maybe there is some general way of customizing particular entries using biblatex?

share|improve this question
    
It depends on the style, but with the standard ones you can override all or part of the citation label with the shorthand or label fields. This previous post provides some details. –  Audrey Dec 10 '12 at 16:35
    
Maybe I am too thick to understand, but how can I use the shorthands to ommit the Author field only in the in text citations? I am not very familiar with the use of shorthands.... –  gns-ank Dec 10 '12 at 17:38
3  
shorthand is a field you add to the bib file. It overrides the whole citation label. Referring to your two main papers only by year is a little ambiguous, but you can do this by clearing the labelname list. Again, the answer depends on your style (authoryear?) and exactly what output you're wanting to achieve. You should add an example to your question to clarify all this. –  Audrey Dec 10 '12 at 17:51
    
sorry for not adding a specific example, hope, that you find the above helpful. –  gns-ank Dec 10 '12 at 21:35
add comment

1 Answer

up vote 2 down vote accepted

There are a couple ways to suppress labelname in citations. The hook

\AtEveryCitekey{\clearname{labelname}}

will delete the labelname list in every citation, but styles typically resort to printing fallback values. The authoryear style, for example prints the labeltitle field when labelname is unavailable. Suppressing all fallback values often results in spurious whitespace or punctuation.

One easy way around all this is to save labelyear into the shorthand field.

\documentclass{article}
\usepackage[style=authoryear]{biblatex}

\DeclareBibliographyCategory{citeyear}
\addtocategory{citeyear}{companion,knuth:ct:a}

\AtEveryCitekey{%
  \ifcategory{citeyear}
    {\edef\cbxlabel{\thefield{labelyear}}%
     \restorefield{shorthand}{\cbxlabel}}
    {}}

\addbibresource{biblatex-examples.bib}
\begin{document}
\textcite[10--11]{companion} showed that...
Filler \parencite[e.g.][10--15]{knuth:ct:a}.
Filler \textcite[10--11]{kant:ku}.
Filler \parencite[e.g.][10--15]{kant:kpv}.
\printbibliography
\end{document}

enter image description here

Note that the labelname still appears in \textcite. This is intentional. \textcite is analogous to \citeasnoun in the Harvard styles. Suppressing labelname in \textcite would be like omitting the noun in \citeasnoun. It makes no sense.

labelyear isn't a very meaningful citation label. So I would recommend using a shorthand based on the title or authors of the work. The above document cites two entries with shorthands from biblatex-examples.bib. Here's an excerpt from this file.

@inbook{kant:kpv,
  shorthand = {KpV},
  author = {Kant, Immanuel},
  title = {Kritik der praktischen Vernunft},
  shorttitle = {Kritik der praktischen Vernunft},
  booktitle = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},
  maintitle = {Kants Werke. Akademie Textausgabe},
  volume = {5},
  publisher = {Walter de Gruyter},
  location = {Berlin},
  date = {1968},
  pages = {1--163},
}
@inbook{kant:ku,
  shorthand = {KU},
  author = {Kant, Immanuel},
  title = {Kritik der Urtheilskraft},
  booktitle = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},
  maintitle = {Kants Werke. Akademie Textausgabe},
  volume = {5},
  publisher = {Walter de Gruyter},
  location = {Berlin},
  date = {1968},
  pages = {165--485},
}
share|improve this answer
add 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.