2

I have an @inbook reference in my bibtex library with an unknown year. Since I use the bibLaTeX authoryear citation style with some customizations my normal citations (with known year) look like:

Author1/Author2/Author3 (year)

But when there is no year defined it will display the title of the reference where it should be:

Author1/Author2/Author3

What do I have to redefine in order to change this behavior?

2

You can load the xpatch package and then "patch" the cite bib macro as follows:

\xpatchbibmacro{cite}{\usebibmacro{cite:label}}{\printnames{labelname}}{}{}

CAVEAT: It might be possible to have bibliography entries where there is no author nor year. In such cases, what you propose result in an empty reference (nothing is going to be printed). A more substantial change is need to handle such cases, namely:

\newbibmacro*{cite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
       {\ifnameundef{labelname}
          {\usebibmacro{cite:label}}
          {\printnames{labelname}}%
          \setunit{\addspace}}
       {\printnames{labelname}%
        \setunit{\nameyeardelim}}%
     \usebibmacro{cite:labelyear+extrayear}}
    {\usebibmacro{cite:shorthand}}}

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.