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 would like to prevent biblatex from printing by (name of author) in the bibliography in only those cases where I have put OPTIONS = "useauthor=false" in the entry in the .bib file. I assume I can put a relatively straightforward command in my .tex preamble that will take care of this. Below a silly example:

\documentclass{article}
\usepackage{csquotes}
\usepackage[
        bibstyle = authoryear,
        citestyle = authoryear-comp,
        sorting = nyt,
        language = american,
        abbreviate = false,
        backend = biber]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{bible,
    AUTHOR = "God",
    EDITOR = "James, King",
    TITLE = "The {H}oly {B}ible",
    YEAR = "1611",
    OPTIONS = "useauthor=false, useeditor=true"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\noindent
Text \parencite{bible}.
\printbibliography
\end{document}

enter image description here

share|improve this question
add comment

2 Answers

up vote 8 down vote accepted

There are a bunch of ways you might do this; but a simple one (that doesn't involve fiddling with the bibliography drivers at all) is just to clear the author field if useauthor if false:

\AtEveryCitekey{\ifuseauthor{}{\clearname{author}}}
\AtEveryBibitem{\ifuseauthor{}{\clearname{author}}}
share|improve this answer
add comment

Redefine the byauthor bibmacro to do nothing.

\documentclass{article}
\usepackage{csquotes}
\usepackage[
        bibstyle = authoryear,
        citestyle = authoryear-comp,
        sorting = nyt,
        language = american,
        abbreviate = false,
        backend = biber]{biblatex}
\renewbibmacro*{byauthor}{}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{bible,
    AUTHOR = "God",
    EDITOR = "James, King",
    TITLE = "The {H}oly {B}ible",
    YEAR = "1611",
    OPTIONS = "useauthor=false, useeditor=true"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\noindent
Text \parencite{bible}.
\printbibliography
\end{document}

enter image description here

Compare the original version of byauthor:

\newbibmacro*{byauthor}{%
  \ifboolexpr{
    test \ifuseauthor
    or
    test {\ifnameundef{author}}
  }
    {}
    {\usebibmacro{bytypestrg}{author}{author}%
     \setunit{\addspace}%
     \printnames[byauthor]{author}}}
share|improve this answer
    
Since this doesn't refer to "useauthor=false", will this have no unwanted consequences for other bibliographical entries? –  Sverre Nov 20 '12 at 20:58
    
@Sverre byauthor itself refers to the state of useauthor. –  lockstep Nov 20 '12 at 21:01
    
Great, thanks. Since I can accept only one answer, I accepted Paul's, because I understood it right away. –  Sverre Nov 20 '12 at 21:03
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.