以下是@Mike Renfro 提供的乳胶代码在参考文献中添加序列号
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{refs.bib}
@BOOK
{KandR,
AUTHOR = "Kernighan, Brian W. and Ritchie, Dennis M.",
TITLE = "{The C Programming Language Second Edition}",
PUBLISHER = "Prentice-Hall, Inc.",
YEAR = 1988
}
\end{filecontents*}
\usepackage[bibstyle=numeric,citestyle=authoryear,backend=bibtex]{biblatex}
\addbibresource{refs.bib}
\defbibenvironment{bibliography}
{\enumerate{}
{\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{-\leftmargin}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}}
{\endenumerate}
{\item}
\renewcommand*{\nameyeardelim}{\addcomma\space}
\begin{document}
In 1988 C was totally awesome. \autocite{KandR}
\printbibliography
\end{document}
然而,如果我必须同时在文中使用(Kernighan and Ritchie,1988)并且在某些地方使用 Kernighan and Ritchie(1988),那么第二种情况的引用风格会是什么。
此外,在参考文献中,我还需要它们像这样出现:
- Kernighan, BW 和 Ritchie, DM,《C 编程语言》第二版。Prentice-Hall, Inc.,1988 年。
即姓氏首先出现,因此所有参考文献都按照第一作者的姓氏的字母顺序排列。
如何做?请帮忙。
答案1
您需要sorting
在加载时指定选项(您可能需要nty
:“name-title-year”和nyt
:“name-year-title”,有关更多排序选项,请参阅第 44 页biblatex
文档以及从那里链接的部分)。
然后调用biblatex
将会读取(按“名称-年份-标题”排序)
\usepackage[bibstyle=numeric,citestyle=authoryear,backend=bibtex,sorting=nyt]{biblatex}
要更改名称格式,请使用
\DeclareNameAlias{default}{last-first}
完整 MWE
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@BOOK
{KandR,
AUTHOR = "Kernighan, Brian W. and Ritchie, Dennis M.",
TITLE = "{The C Programming Language Second Edition}",
PUBLISHER = "Prentice-Hall, Inc.",
YEAR = 1988
}
\end{filecontents*}
\usepackage[bibstyle=numeric,citestyle=authoryear,backend=bibtex,sorting=nyt]{biblatex}
\addbibresource{\jobname.bib}
\defbibenvironment{bibliography}
{\enumerate{}
{\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{-\leftmargin}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}}
{\endenumerate}
{\item}
\DeclareNameAlias{default}{last-first}
\renewcommand*{\nameyeardelim}{\addcomma\space}
\begin{document}
In 1988 C was totally awesome. \autocite{KandR}
\printbibliography
\end{document}