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.
In your given code and bib file are several errors, for example the order of calling packages (hyperref
should be the last one in your case, or do not write ,,
in your bib entrys, ,
is needed ...).
Because I do not have your used class and style I changed them to class article
and style plainnat
and I added option numbers
to natbib
to get numbered bib entrys in your bibliography.
Please study my changes in the following MWE (package filecontents
is only used to have a compilable MWE with bib file and TeX code):
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{R1,
title = "A Guide to Latex",
journal = "Addison-Wesley",
volume = "1",
number = "1",
pages = "1 - 2",
year = "2003",
author = "Kopka H and Daly PW",
}
@article{R2,
title = "LaTeX: a Document Preparation System",
journal = "Addison-Wesley",
volume = "1",
number = "1",
pages = "1 - 2",
year = "1994",
author = "Lamport",
}
@article{R3,
title = "The LaTeX Companions",
journal = "Addison-Wesley",
volume = "1",
number = "1",
pages = "1 - 2",
year = "1994",
author = "Mittelbach F and Goossens M",
}
\end{filecontents}
\documentclass{article}%[Afour,sageh,times]{sagej}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{url}
\usepackage[numbers]{natbib}
\usepackage[%
colorlinks,bookmarksopen,bookmarksnumbered,citecolor=red,urlcolor=red
]{hyperref}
\newcommand\BibTeX{{\rmfamily B\kern-.05em \textsc{i\kern-.025em
b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\def\volumeyear{2016}
\begin{document}
\section{Introduction}
A very very very long introduction.
\section{Figure}
\begin{figure}[htb!]
\centering
\begin{subfigure}[t]{1\linewidth}
\centering
\includegraphics[scale=0.23,clip]{example-image-a}
\caption{f1 cap}
\label{fig:f1}
\end{subfigure}
\qquad
\begin{subfigure}[t]{1\linewidth}
\centering
\includegraphics[scale=0.21,clip]{example-image-b}
\caption{f2 cap}
\label{fig:f2}
\end{subfigure}
\caption{ f1 and f2}
\label{fig:f1f2}
\end{figure}
\section{Table}
\begin{table}[ht]
\small\sf\centering
\caption{abc\label{tab1}}
\begin{tabular}{llll}
\toprule
abc&a &b & c \\
\midrule
\texttt{1}&1 &1 & 1 \\
\texttt{2}&2 & 2 & 2\\
\texttt{3}&3 & 3 & 3 \\
\bottomrule
\end{tabular}\\[10pt]
\end{table}
Citing reference \cite{R1}, reference \cite{R2} and reference \cite{R3}.
\bibliographystyle{plainnat} % sageV
\bibliography{\jobname}
\end{document}
and the resulting pdf file:
Best Answer
You haven't told us which bibliography style you use, but it would appear to be one that generates a numeric citation style by default.
If the bibliography style is not completely incompatible with authoryear-style citations (a big if, given the first error message you report...), you could try issuing the command
after loading
natbib
so that\citet
and\citep
can create citations in the desired authoryear style. After adding the command given above, be sure to wipe out the .aux file and rerun LaTeX, BibTeX, and LaTeX (twice more) .If your bibliography style does turn out to be incompatible with authoryear-style citations, you either need to find another, compatible style file or create your own custom .bst style file from scratch. Fortunately, the latter method isn't as difficult as it might seem, thanks to the existence of the custom-bib package (which was created, incidentally, by the author of the
natbib
package).