我对此还很陌生,所以请温柔一点!
我在序言中加载了 和。natbib
我使用的是 BibTeX 和修改后的样式。babel
url
vancouver
当我输入时,\cite{Smith2013}
它会为该参考插入一个上标数字。
是否有一个命令可以将作者姓名或论文年份插入文本中,而不是实际的参考编号?
答案1
我很惊讶你没有收到这样的错误:
pdflatex> ! 包 natbib 错误:参考书目与作者年份引用不兼容。
样式vancouver
与 不兼容natbib
。现在,您有两种可能性:
1)使用natbib
并尝试找到一种类似于vancouver
2)只需删除\usepackage{natbib}
您的代码即可使用\bibliographystyle{vancouver}
。
参照以下2)的示例:
\documentclass{article}
\usepackage[english]{babel}
\usepackage{url}
%\usepackage{natbib}
\begin{document}
Hello\cite{mario2013}
\bibliographystyle{vancouver}
\bibliography{refs}
\end{document}
refs.bib
文件如下所示:
@article{mario2013,
author={mario},
title={Marito and Friends},
journal={My Journal},
year = {2013},
}
输出应如下所示:
如果您想使用作者年份引用,您可以将natbib
包与您选择的参考书目样式一起加载(例如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}
输出将会像这样:
答案2
这只是 @gaurav-bhutani 解决方案的修改。我创建了一个 vancouver.bst/vancouver-authoryear.bst 版本,它保留了各种 Vancouver 规范选项(doi 标志、按外观排序参考文献等),同时启用了以下命令;
- \cite{smith77} 生成“[1]”
- \citep{smith77} 生成“[1]”
- \citet{smith77} 生成“Smith [1]”
- \citeauthor{smith77} 生成“Smith”
- \citeyear{smith77} 生成“1977”
例如“2013 年,Smith 首次使用多元逻辑回归分析从眼睛中取出胡萝卜后的死亡率 [1]”由代码生成;“在 \citeyear{Smith2013} 中,\citeauthor{Smith2013} 描述了首次使用多元逻辑回归分析从眼睛中取出胡萝卜后的死亡率 \cite{Smith2013}”。
要将此文件包含到您的项目中:
- 下载修改后的版本温哥华作家年.bst并将其与您的主 tex 文档一起保存。
- 在你的 tex 文件中包括 natbib 包:\usepackage[numbers,sort]{natbib}
- 在你的 tex 文件中包括书目样式 vancouver-authoryear:\bibliographystyle{vancouver-authoryear}
完整的工作 tex 文件如下所示:
\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}
答案3
我最近创建了一个 bibstyle 文件温哥华作家年.bst允许你使用natbib
风格authoryear
vancouver
带有风格参考的引用。
这样做是为了符合《计算机与化学工程》杂志的引用风格。
按照以下说明将此文件包含在您的项目中:
- 下载文件温哥华作家年.bst并将其与您的主 tex 文档一起保存。
- 在你的 tex 文件中包括 natbib 包:
\usepackage{natbib}
- 在你的 tex 文件中包括参考书目样式 vancouver-authoryear:
\bibliographystyle{vancouver-authoryear}
完整的工作 tex 文件如下所示:
\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}
它产生以下输出:
答案4
natbib
使用与标准不同的引用命令\cite{}
。第 7 页文档natbib
展示其应用方式:
需要注意的是,您必须使用以下三种可能的natbib
书目样式之一:plainnat
或abbrvnat
。unsrtnat
正如 Mario SE 指出的那样,natbib
不适用于温哥华参考文献样式。