目录
首先准备bib文件:
@book{toth2002vehicle,
title={The vehicle routing problem},
author={Toth, Paolo and Vigo, Daniele},
year={2002},
publisher={SIAM}
}
@book{golden2008vehicle,
title={The vehicle routing problem: latest advances and new challenges},
author={Golden, Bruce L and Raghavan, Subramanian and Wasil, Edward A},
volume={43},
year={2008},
publisher={Springer Science \& Business Media}
}
1 数字标号型参考文献
测试源码:
\documentclass{article}
\begin{document}
The Vehicle Routing Problem (VRP) \cite{toth2002vehicle},\cite{golden2008vehicle} calls for the determination of the optimal set of routes to
be performed by a fleet of vehicles to serve a given set of customers, and it is one of the most
important, and studied, combinatorial optimization problems.
\bibliographystyle{unsrt}
\bibliography{references}
\end{document}
运行效果:
2 基于natbib包的参考文献引用
2.1 案例
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
%Import the natbib package and sets a bibliography and citation styles
\usepackage{natbib}
\bibliographystyle{abbrvnat}
\setcitestyle{authoryear,open={((},close={))}} %Citation-related commands
\title{Natbib Example}
\begin{document}
The Vehicle Routing Problem (VRP) \citep{toth2002vehicle},\cite{golden2008vehicle} calls for the determination of the optimal set of routes to be performed by a fleet of vehicles to serve a given set of customers, and it is one of the most
important, and studied, combinatorial optimization problems.
\bibliography{references}\footnotesize
\end{document}
2.2 命令解析
\setcitestyle{authoryear, open={((},close={))}
2.2.1 数字引用格式
环境设置:
\bibliographystyle{abbrvnat}
\setcitestyle{numbers,open={[},close={]}}
引用文献代码:
The Vehicle Routing Problem (VRP) \citep{toth2002vehicle},\cite{golden2008vehicle} calls for the determination of the optimal set of routes to be performed by a fleet of vehicles to serve a given set of customers, and it is one of the most
important, and studied, combinatorial optimization problems.
\textbf{Expression 1:} \cite{golden2008vehicle} \par
\textbf{Expression 2:} \cite*{toth2002vehicle} \par
\textbf{Expression 3:} \citep{golden2008vehicle} \par
\textbf{Expression 4:} \citep*{toth2002vehicle} \par
\textbf{Expression 5:} \citet{golden2008vehicle} \par
\textbf{Expression 6:} \citet*{toth2002vehicle} \par
效果:
2.2.2 错误处理
你会发现参考文献2 先被引用之后才是参考文献1,这是不对的;解决方案如下:
- 删除tex目录下参考文献相关的文件
- 环境引用修改成 unsrt,重新编译
\bibliographystyle{unsrt}
\setcitestyle{numbers,open={[},close={]}}
修改后运行效果如下:
2.2.3 命令解析
\setcitestyle{authoryear, open={((},close={))} 参数列表:
- 引用模式:作者年份模式(
authoryear)
, 数字编码模式(numbers),上标模式(
super)
- 开合字符:
open={char},close={char}
. - 参考文献的分割符号:Citation separator:
semicolon
,comma
. - Separator between author and year:
aysep{char}
. - Separator between years with common author:
yysep={char}
. - Text before post-note:
notesep={text}
.
\textbf{Expression 1:} \cite{golden2008vehicle} \par
\textbf{Expression 2:} \cite*{toth2002vehicle} \par
\textbf{Expression 3:} \citep{golden2008vehicle} \par
\textbf{Expression 4:} \citep*{toth2002vehicle} \par
\textbf{Expression 5:} \citet{golden2008vehicle} \par
\textbf{Expression 6:} \citet*{golden2008vehicle} \par
\textbf{Expression 7:} \citeauthor{toth2002vehicle} \par
\textbf{Expression 8:} \citeyear{toth2002vehicle} \par
\textbf{Expression 9:} \cite{toth2002vehicle,golden2008vehicle} \par
3 引用语法解析
根据引用模式,还有其他附加引用命令。例如,在上面的例子中,命令 \cite[see][chap 2]{latexcompanion} 需要两个额外的参数;
- 第一个可选参数 see 打印在引用标记之前,
- 第二个可选参数 chap 2 打印在引用标记之后
4 不同的引用模式探讨
4.1 当参考文献位于句首时
应该使用 \cite{} 进行文献引用
\cite{sbihi2007relationship},\cite{sbihi2010combinatorial},\cite{sbihi2007relationship} presented some research gaps that link the VRP with Green Logistics issues, such as employing the Time-dependent VRP as an approach to deal with the minimization of emissions during traveling.
4.2 当参考文献位于句末时
使用 \citep*{} 进行引用
Green Logistics deals with the activities of measuring the environmental effects of different distribution strategies, reducing the energy consumption, recycling refuse and managing waste disposal \citep*{sbihi2007relationship}
4.3 同一作者不同年份文献的引用
环境组合:
\bibliographystyle{apalike}
\setcitestyle{authoryear,open={(},close={)},semicolon={;}}
源代码:
\cite{sbihi2007combinatorial,sbihi2007relationship,sbihi2010combinatorial} presented some research gaps that link the VRP with Green Logistics issues, such as employing the Time-dependent VRP as an approach to deal with the minimization of emissions during traveling.
本节完整源码
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
%Import the natbib package and sets a bibliography and citation styles
\usepackage{natbib}
% \bibliographystyle{unsrt}
% \bibliographystyle{abbrvnat}
\bibliographystyle{apalike}
% \setcitestyle{numbers,open={[},close={]}}
\setcitestyle{authoryear,open={(},close={)},semicolon={;}}
%Citation-related commands
\title{Natbib Example}
\begin{document}
The Vehicle Routing Problem (VRP) \citep{toth2002vehicle},\cite{golden2008vehicle} calls for the determination of the optimal set of routes to be performed by a fleet of vehicles to serve a given set of customers, and it is one of the most
important, and studied, combinatorial optimization problems.
\textbf{Expression 1:} \cite{golden2008vehicle} \par
\textbf{Expression 2:} \cite*{toth2002vehicle} \par
\textbf{Expression 3:} \citep{golden2008vehicle} \par
\textbf{Expression 4:} \citep*{toth2002vehicle} \par
\textbf{Expression 5:} \citet{golden2008vehicle} \par
\textbf{Expression 6:} \citet*{golden2008vehicle} \par
\textbf{Expression 7:} \citeauthor{toth2002vehicle} \par
\textbf{Expression 8:} \citeyear{toth2002vehicle} \par
\textbf{Expression 9:} \cite{toth2002vehicle,golden2008vehicle} \par
\cite{sbihi2007relationship},\cite{sbihi2010combinatorial},\cite{sbihi2007relationship} presented some research gaps that link the VRP with Green Logistics issues, such as employing the Time-dependent VRP as an approach to deal with the minimization of emissions during traveling.
Green Logistics deals with the activities of measuring the environmental effects of different distribution strategies, reducing the energy consumption, recycling refuse and managing waste disposal \citep*{sbihi2007relationship}
\cite{sbihi2007combinatorial,sbihi2007relationship,sbihi2010combinatorial} presented some research gaps that link the VRP with Green Logistics issues, such as employing the Time-dependent VRP as an approach to deal with the minimization of emissions during traveling.
\bibliography{references}\footnotesize
\end{document}
参考资料:
Choosing a BibTeX Style - CIS Help Desk - Reed Collegehttps://www.reed.edu/cis/help/LaTeX/bibtexstyles.htmlHow to Reference in Latex - 7 Steps to Bibliography with BibTeXhttps://www.scijournal.org/articles/reference-in-latex