1

I'm write a document of type tufte-handout, and wanted to use Vancouver reference style for bibliography, however I get the following error:

Package natbib Error: Bibliography not compatible with author-year citations.

This doesn't stop the document from generating, and references are also created fine, but they use plane bib style. How can I stop this error from occurring, and what does it actually mean? Is there a way to force Vancouver style?

EDIT: Added MVE. I should also mention I'm using BasicTeX. Minimum working example:

\documentclass{tufte-handout}

\usepackage{lipsum}

\begin{document}

\lipsum[1] \cite{Lucas:2006}

\bibliographystyle{vancouver}
\nobibliography{test-refs}

\end{document}

Content of bib file:

@inbook{Lucas:2006,
Author = {Adam Lucas},
Date-Added = {2016-03-01 22:05:32 +0000},
Date-Modified = {2016-03-01 22:05:32 +0000},
Number = {90-04-14649-0},
Pages = {65},
Publisher = {Brill Publishers},
Title = {Wind, Water, Work: Ancient and Medieval Milling Technology},
Year = {2006}}
2
  • 1
    Please show us the exact code with which you load the natbib package and specify the bibliography style.
    – Mico
    Commented Mar 1, 2016 at 22:03
  • @Mico I don't load the natbib myself. However, I've added code for minimum verifiable example. Thanks @egreg :)
    – user14492
    Commented Mar 1, 2016 at 22:11

1 Answer 1

2

It appears that the natbib package is being loaded with the option authoryear. In contrast, the vancouver bibliography style is designed to generate numeric-style rather than authoryear-style citation call-outs. To enable this behavior, it is necessary to override the default setting. This may be accomplished by issuing the instruction

\setcitestyle{numbers} 

after the \documentclass instruction.

6
  • Using a new example project from ShareLatex, if I set \bibliographystyle{vancouver} and add \setcitestyle{numbers} just after \usepackage{natbib}, I get an error due to the presence of ` url={whatever},` in an entry of bib file.
    – mmj
    Commented Nov 26, 2016 at 10:20
  • @mmj - Your issue is completely unrelated to the natbib package or the vancouver style. To use the \url macro, the url and/or the hyperref packages must be loaded. Is this the case in your document?
    – Mico
    Commented Nov 26, 2016 at 10:35
  • Actually no, but I get no error if I use \usepackage{natbib} and \bibliographystyle{plain} (however the url field of the bib entry is unused).
    – mmj
    Commented Nov 26, 2016 at 11:02
  • @mmj - The reason you get no url-related error message if you use the plain bibliography style is yet a separate matter: The plain style simply ignores a field named url! In contrast, the vancouver style does not ignore such a field. However, in order to typeset the contents of the url field properly, the url and/or hyperref packages must be loaded by your document, since a macro named \url must be available. Is there a (valid!) reason for being reluctant to load these packages?
    – Mico
    Commented Nov 26, 2016 at 11:27
  • No reluctance of course, I'll load hyperref, just wanted to understand why before I got no error. Thanks!
    – mmj
    Commented Nov 26, 2016 at 11:32

You must log in to answer this question.

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