![如何获取按字母顺序编号且包含(作者,年份)引文的参考书目](https://linux22.com/image/313508/%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E6%8C%89%E5%AD%97%E6%AF%8D%E9%A1%BA%E5%BA%8F%E7%BC%96%E5%8F%B7%E4%B8%94%E5%8C%85%E5%90%AB%EF%BC%88%E4%BD%9C%E8%80%85%EF%BC%8C%E5%B9%B4%E4%BB%BD%EF%BC%89%E5%BC%95%E6%96%87%E7%9A%84%E5%8F%82%E8%80%83%E4%B9%A6%E7%9B%AE.png)
我确信这个问题的各种变体已被问过几十次,但我找不到任何针对我的情况的具体内容。
我想要一种能够实现以下四个目标的书目格式:
- 获取 (作者,年份) 格式的引用
- 获取编号书目
- 按字母顺序获取参考书目。
- 如果可能的话,使用 natbib 包
我还没有看到任何可以将这三件事同时完成的解决方案。
答案1
以下解决方案采用biblatex
:
\documentclass{article}
\usepackage[
natbib=true,
style=authoryear,
labelnumber,
]{biblatex}
\addbibresource{references.bib}
\DeclareFieldFormat{labelnumberwidth}{[#1]}
\defbibenvironment{bibliography} % from numeric.bbx
{\list
{\printtext[labelnumberwidth]{%
\printfield{prefixnumber}%
\printfield{labelnumber}}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}
\begin{filecontents}{references.bib}
@article{Smith:01,
author = {Smith, John},
year = {2001},
title = {Article title},
journal = {Journal title},
volume = {13},
pages = {1--2}
}
@book{Mueller:02,
author = {M{\"u}ller, Hans},
year = {2002},
title = {Book title},
publisher = {Publisher},
address = {Address}
}
\end{filecontents}
\begin{document}
\cite{Smith:01}, \cite{Mueller:02}
\printbibliography
\end{document}
编辑:当然,如果您对标准数字样式感到满意,那么还有一个更简单的解决方案biblatex
,即,因为可以区分citestyle
和bibstyle
。
\documentclass{article}
\usepackage[
natbib=true,
citestyle=authoryear,
bibstyle=numeric,
]{biblatex}
\addbibresource{references.bib}
\begin{filecontents}{references.bib}
@article{Smith:01,
author = {Smith, John},
year = {2001},
title = {Article title},
journal = {Journal title},
volume = {13},
pages = {1--2}
}
@book{Mueller:02,
author = {M{\"u}ller, Hans},
year = {2002},
title = {Book title},
publisher = {Publisher},
address = {Address}
}
\end{filecontents}
\begin{document}
\cite{Smith:01}, \cite{Mueller:02}
\printbibliography
\end{document}