![在 natbib 中插入逗号分隔的引用参考](https://linux22.com/image/372457/%E5%9C%A8%20natbib%20%E4%B8%AD%E6%8F%92%E5%85%A5%E9%80%97%E5%8F%B7%E5%88%86%E9%9A%94%E7%9A%84%E5%BC%95%E7%94%A8%E5%8F%82%E8%80%83.png)
我试图在 natbib 中使用方括号进行引用,其中以逗号分隔作者和年份,如下所示:
[Einstein, 1905]
在文本中我成功做到了:
\usepackage{natbib}
\bibliographystyle{dinat}
\setcitestyle{authoryear,open={[},close={]}}
但是当使用 \bibliography{sample} 打印参考文献时,作者和年份之间没有逗号。我在 macOS High Sierra 上使用 XeLaTex 和 BibTex 编译文档。
示例.tex:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{natbib}
\bibliographystyle{dinat}
\setcitestyle{authoryear,open={[},close={]}}
\title{Bibliography management: \texttt{natbib} package}
\author{Share\LaTeX}
\date { }
\begin{document}
\maketitle
This document is an example of \texttt{natbib} package using in bibliography
management. Three items are cited: \textit{The \LaTeX\ Companion} book
\citep{latexcompanion}, the Einstein journal paper \citep{einstein}, and the
Donald Knuth's website \citep{knuthwebsite}. The \LaTeX\ related items are
\citep{latexcompanion,knuthwebsite}.
\medskip
\bibliography{sample}
\end{document}
示例.bib:
@article{einstein,
author = "Albert Einstein",
title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
journal = "Annalen der Physik",
volume = "322",
number = "10",
pages = "891--921",
year = "1905",
DOI = "http://dx.doi.org/10.1002/andp.19053221004"
}
@book{latexcompanion,
author = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
title = "The \LaTeX\ Companion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@misc{knuthwebsite,
author = "Donald Knuth",
year = 2019,
title = "Knuth: Computers and Typesetting",
url = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
}
要想在作者和年份之间添加逗号,必须怎么做?
编辑:
示例取自分享乳胶。