4

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?

3

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

  • 2
    Afraid I haven't made myself clear in the post. I can insert numerical references without problem, but was hoping there was a command that would insert the actual name of the author or year of the publication, rather than the numerical reference. I'm new to LaTeX, but it seems like something it should be able to do. – user28848 Apr 11 '13 at 10:08
  • you could, by using natbib and using a different \bibliographystyle and then writing \citet{mario2013} to cite, but by doing so you'll be non-comnpliant with vancouver style. – Mario S. E. Apr 11 '13 at 10:14
  • It's odd because I can use the vancouver style, and have in fact modified it to get rid of urls in article references. Is biber an alternative package to natbib? Or is it just a different protocol for writing a .bib file? I.e. is there another package besides natbib that has more citation commands that include inserting author names rather than an actual formal citation? – user28848 Apr 11 '13 at 10:27
  • I'm modifying my answer to include what you want to do – Mario S. E. Apr 11 '13 at 11:39
  • 2
    What I really want to be able to do is both, but perhaps I am being greedy! I'd like to be able to LaTeX code that produces: 'In 2013, Smith described the first use of multivariate logistic regression for mortality after removal of a carrot from the eye[1]' with code that looks like 'In \citeyear{Smith2013}, \citeauthor{Smith2013} described the first use of multivariate logistic regression for mortality after removal of a carrot from the eye\cite{Smith2013}.' Though, as I write this, it seems perhaps a little pointless, given the fact I'd need to mention the author & year in the reference... – user28848 Apr 11 '13 at 12:00
2

I recently created a bibstyle file vancouver-authoryear.bst that allows you to use natbib style authoryear citations with vancouver style references.

This was done to match the referencing style for the journal Computers and Chemical Engineering.

Follow the following instructions to include this file in your project:

  1. Download the file vancouver-authoryear.bst and save it with your main tex document.
  2. Include the natbib package in your tex file:
     \usepackage{natbib}
    
  3. Include the bibliography style vancouver-authoryear in your tex file:
     \bibliographystyle{vancouver-authoryear}
    

The complete working tex file is shown below:

 
\documentclass[a4paper,12pt,twoside]{report}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=3cm]{geometry}
\usepackage{natbib}
\begin{document}
\chapter*{Vancouver bibliography style with authoryear style citations}
I modified a bibliography style compatible with natbib package to include vancouver style references. 
The motivation behind this was to submit an article for the journal Computers and Chemical Engineering which asks for an \emph{authoryear} citation style in conjunction with vancouver style reference lists.
\\
\\
This is a journal article on drop shapes: \cite{bhutani2013determination}.
\
The same article \citep{bhutani2013determination} can also be cited in parenthesis.
\\
\\
This is an awesome book on population balance modelling by Prof. Ramkrishna: \cite{ramkrishna2000population}.
\\
\\
People are welcome to add conference proceedings, thesis and other references here to test them.
Please feel free to improve and contribute.
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{vancouver-authoryear}
\bibliography{references}
\end{document}

It produces the following output:

enter image description here


  • This enhancement to vancouver.bst is awesome- thanks @gaurav. Note if \usepackage[numbers,sort]{natbib} is executed, it functions very close to the Vancouver specification; \cite{smith77} produces "[1]", \citep{smith77} produces "[1]", \citet{smith77} produces "Smith [1]", and \citeauthor{smith77} produces "Smith". In order to optimise vancouver-authoryear.bst for the Vancouver specification (support the doi flag, orders references by appearance, etc) I performed a number of further modifications. – user2585501 Jan 19 '16 at 9:39
1

This is just a modification of @gaurav-bhutani's solution. I created a version of vancouver.bst/vancouver-authoryear.bst which retains various Vancouver specification options (doi flag, order references by appearance, etc) while enabling the following commands;

  • \cite{smith77} produces "[1]"
  • \citep{smith77} produces "[1]"
  • \citet{smith77} produces "Smith [1]"
  • \citeauthor{smith77} produces "Smith"
  • \citeyear{smith77} produces "1977"

e.g. 'In 2013, Smith described the first use of multivariate logistic regression for mortality after removal of a carrot from the eye [1]' is produced by the code; 'In \citeyear{Smith2013}, \citeauthor{Smith2013} described the first use of multivariate logistic regression for mortality after removal of a carrot from the eye \cite{Smith2013}'.

To include this file in your project:

  1. Download the modified version of vancouver-authoryear.bst and save it with your main tex document.
  2. Include the natbib package in your tex file: \usepackage[numbers,sort]{natbib}
  3. Include the bibliography style vancouver-authoryear in your tex file: \bibliographystyle{vancouver-authoryear}

A complete working tex file is shown below:

\documentclass[a4paper,12pt,twoside]{report}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=3cm]{geometry}
\usepackage[numbers,sort]{natbib}

\begin{document}

\chapter*{Vancouver bibliography style with support for author references (citet)}

I modified a bibliography style produced by gbhutani for producing Vancouver references with support for explicit author references (citet). This version of vancouver-authoryear.bst is a combination of the original vancouver-authoryear.bst released by gbhutani and the official vancouver.bst style. It has been optimised for the Vancouver specification, and includes the following changes: 

\begin{itemize}
\item a) add doi support (restore relevant `\% urlbst' code from vancouver.bst)
\item b) order references by appearance (remove both references to the SORT command)
\item c) restore all code required to produce Vancouver compatible references (restore output.nonnull and reference formatting code from vancouver.bst)
\end{itemize}

This version of vancouver.bst allows the author name to be automatically generated and inserted into the document where necessary (via citet). To invoke the Vancouver numeric referencing system, ensure to add usepackage[numbers,sort]\{natbib\} or usepackage[numbers,sort&compress]\{natbib\} to your tex file. It supports the following set of references;

\begin{itemize}
\item cite\{smith77\} produces ``[1]'' in the text
\item citep\{smith77\} produces ``[1]'' in the text
\item citet\{smith77\} produces ``Smith [1]'' in the text
\item citeauthor\{smith77\} produces ``Smith'' in the text
\end{itemize}

A journal article \cite{ramkrishna2000population} can be cited as normal using the cite command.

The same article by \citet{ramkrishna2000population} can be cited using the citet command.

Note that journal articles are ordered by appearance (rather than alphabetically), e.g. \cite{bhutani2013determination}.

People are welcome to use this code in other styles. Please feel free to improve and contribute.

\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{vancouver-authoryear}
\bibliography{references}

\end{document}
0

natbib uses another citation command than the standard \cite{}. Page 7 in the natbib documentation shows how it's applied:

enter image description here

It should be noted that you have to use one of three possible natbib bibliography styles: plainnat, abbrvnat or unsrtnat. As Mario S. E. points out, natbib doesn't work with the Vancouver reference style.

  • Tried using \citep and all I get is a superscript reference number. Tried using \citet and it shows (author?) with superscript reference number after. (Texmaker didn't seem to recognise \citet in the same was as \cite or \citep by giving a list of authors from my .bib file) – user28848 Apr 11 '13 at 9:59
  • @user28848 See update! – Holene Apr 11 '13 at 10:14
  • For some reason, it seems to work! – user28848 Apr 11 '13 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.