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.

3
  • Welcome to TeX.SX. Commented Mar 28, 2013 at 16:51
  • The url can be in its own field url={}, instead of inside note={}, although I don't think that is the main culprit here. Have you run latex multiple times?
    – cryptic0
    Commented Mar 28, 2013 at 16:55
  • Thank you for your welcome, Claudio. crypticO, yes ! I know that I have to « clean » my BIB files and remove some unnecessary brackets and quotes. Well, thanks anyway, for looking at my case. :)
    – eddyte
    Commented Mar 28, 2013 at 17:44

1 Answer 1

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

4
  • 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
    Commented Mar 28, 2013 at 17:33
  • 1
    @eddyte Yes, hyperref usually comes last, and multibib has to come after natbib.
    – mafp
    Commented Mar 28, 2013 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
    Commented Mar 28, 2013 at 18:00
  • Natbib changes the behavior of multibib. They are not so compatible I would say. Commented Jul 5, 2022 at 20:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .