[Tex/LaTex] cite author name or year in text when using vancouver style

bibtexnatbib

I'm new to this, so please be gentle!

I have loaded natbib, babel and url in the preamble. I am using BibTeX and a modified vancouver style.

When I type \cite{Smith2013} it inserts a superscript number for that reference.

Is there a command that will insert the author's name or the year of the paper into the text, rather than the actual reference number?

Best Answer

I'm surprised you didn't get an error like this:

pdflatex> ! Package natbib error: Bibliography not compatible with author-year citations.

the vancouver style is not compatible with natbib. Now, you have two possibilities:

1) Use natbib and try to find a bibliography style that somewhat resembles vancouver

2) Simply remove \usepackage{natbib} of your code and you'll be able to use \bibliographystyle{vancouver}.

Example by following 2):

\documentclass{article}

\usepackage[english]{babel}
\usepackage{url}
%\usepackage{natbib}

\begin{document}
Hello\cite{mario2013}


\bibliographystyle{vancouver}
\bibliography{refs}

\end{document}

refs.bib file looks like this:

@article{mario2013,
author={mario},
title={Marito and Friends},
journal={My Journal},
year = {2013},
}

And the output should look like this:

enter image description here

If you want to use author-year citations, you could load the natbib package along with a bibliography style of your choice (e.g. IEEEtranSN):

\documentclass{article}

\usepackage[english]{babel}
\usepackage{url}
\usepackage{natbib}

\begin{document}

According to \citet{mario2013} this is what the IEEEtranSN should look like

\bibliographystyle{IEEEtranSN}
\bibliography{refs}

\end{document}

The output will look something like this:

enter image description here