8

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

10

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}}}
6

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}}}
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.