4

I am using the multibib and hyperref packages.
I would like to create clickable citations for my bibliographies.
It works for the first one (biblio.bib) but not the second one (awebsite.bib)

Here is my minimal working example.

\documentclass[utf8]{article}
\usepackage[english]{babel}

\usepackage{multibib}
\newcites{awebsite}{Another bibliography}

\usepackage[colorlinks=true]{hyperref}

\begin{document}
The quick brown fox \cite[p.4]{article} jumps over
\cite[p.5]{articleweb} the lazy dog \citeawebsite[p.6]{articleweb}.

\bibliographystyle{plain}
\bibliography{biblio}

\bibliographystyleawebsite{plain}
\bibliographyawebsite{awebsite}

\end{document}

The two BIB files (biblio.bib and awebsite.bib) are herebelow.

@inproceedings{article, title = "{Title}", author = "Authors", booktitle = "{BT}"}

...

@article{articleweb, author = {A}, title = "{Title2}", year = {2013}, note = {\url{URL}}}

And there is the result (PDF)...


The quick brown fox [1, p.4] jumps over [2, p.5] the lazy dog [2, p.6].

References

[1] Authors. Title. In BT.

Another bibliography

[2] A. Title2. 2013. URL.


The first link to References [1] is created but not the two others. Why ?

Thanks in advance for any suggestions on how to fix this.

lockstep
  • 250,273
eddyte
  • 43

1 Answers1

4

Since multibib supports natbib, and natbib supports hyperref, load natbib, too.

\documentclass{article}
\usepackage[english]{babel}

\usepackage{filecontents}
\begin{filecontents}{biblio.bib}
  @inproceedings{article, title = "{Title}", author = "Authors", booktitle = "{BT}"}
\end{filecontents}
\begin{filecontents}{awebsite.bib}
  @article{articleweb, author = {A}, title = "{Title2}", year = {2013}, note = {\url{URL}}}
\end{filecontents}

\usepackage{natbib}         %% load this, too
\usepackage{multibib}
\newcites{awebsite}{Another bibliography}

\usepackage[colorlinks=true]{hyperref}

\begin{document}
The quick brown fox \cite[p.4]{article} jumps over
\cite[p.5]{articleweb} the lazy dog \citeawebsite[p.6]{articleweb}.

\bibliographystyle{plain}
\bibliography{biblio}

\bibliographystyleawebsite{plain}
\bibliographyawebsite{awebsite}
\end{document}

gives

sample output

mafp
  • 19,096
  • Fantastic ! It works ! Thank you very much. I tried to use natbib but it didn't work. In fact, natbib must be called before multibib and hyperref. If not, an error « Extra \else, Use of @citex doesn't match its definition » occurs. Thank you, thank you, thank you for your help. :) – eddyte Mar 28 '13 at 17:33
  • 1
    @eddyte Yes, hyperref usually comes last, and multibib has to come after natbib. – mafp Mar 28 '13 at 17:39
  • I am used to classifying the packages in alphabetical order. Well, given that kind of problem, this is really a bad habit I'll try to get over. Thank you mafp. :) – eddyte Mar 28 '13 at 18:00
  • Natbib changes the behavior of multibib. They are not so compatible I would say. – Beni Bogosel Jul 05 '22 at 20:45