# \citeauthor and \citeyear not working correct with multibib and natbib

I have this minimal document (doc.tex):

\documentclass[10pt]{scrreprt}

\usepackage{natbib}
\usepackage{multibib}
\newcites{book}{References}
\bibpunct[; ]{(}{)}{;}{a}{,}{,~}

\begin{document}

Some senseless text with citation \citepbook{book}.
And another text with citation (\citeauthor{book}, \citeyear{book} and \citeauthor{book2}, \citeyear{book2}).

\bibliographystylebook{apalike2}
\bibliographybook{sourcesBook}

\end{document}


And this .bib file:

@Misc{book,
author= {{Book}},
year={2017},
}

@Misc{book2,
author= {{Book 2}},
year={2016}
}


When I generate the document now, I will get a failure for the second entry of the bib file. The log says:

Package natbib Warning: Citation book2' on page 1 undefined on input line 13.

The output of the PDF looks like this:

Anyone an idea what is wrong here? I need the multibib because I have to generate a bibliography for books and online sources.

• have you tried running bibtex-->pdflatex-->bibtex-->pdflatex? – santimirandarp Jun 6 '17 at 14:30
• Yes ... I run pdflatex multiple times before and after the bibtex command – berlin104 Jun 6 '17 at 14:31
• When I look into the book.aux file I see only the \citation{book} and in the doc.aus file I see both \citation{book} and \citation{book2} – berlin104 Jun 6 '17 at 14:41
• do you have .bib file with spaces in its name? – santimirandarp Jun 6 '17 at 15:24
• No, the bibfiles are named "sourceBook.bib" or "sourceOnline.bib", for example. – berlin104 Jun 6 '17 at 15:26

As you have already noted in a comment to your own answer, you have to use one of the multibib variants of the usual cite commands before you can use \citeyear and \citeauthor, for which there is no multibib variant, unfortunately.

However, there is a multibib variant for the \nocite command, which technically causes a citation but is invisible. Thus, if \citealpbook is not an option, you can avoid adding additional useless citations and do this instead:

Some senseless text with citation \citepbook{book}.
And another text with citation (\citeauthor{book}, \citeyear{book}
and \nocitebook{book2}\citeauthor{book2}, \citeyear{book2}).

• Nice. +1 for this solution. I will give it a try. – berlin104 Oct 26 '18 at 19:07

I found a workaround for my issue.

I that case the natbib command \citealpbook{book2} works for me. The result looks like I will need it:

In the document I now have:

Some senseless text with citation \citepbook{book}.
And another text with citation (\citeauthor{book}, \citeyear{book}; \citealpbook{book2}, p. 7).

• I also found out that you will need a "normal" cite anywhere before using citeauthor and citeyear` if you are using multibib. – berlin104 Jun 8 '17 at 5:54