如果是bib文件分开放,并且每个引用都明确写了author和year,那么直接\citep
就可以,就能产生(abc et al., 2015) 这种格式, 如果你不想要圆括号,可以使用\usepackage[square]{natbib}
, 也可以使用\setcitestyle{authoryear,open={(},close={)}}
手动声明格式,你甚至可以声明一个大括号一个中括号,但注意后面这种方式,会覆盖掉前面的。
另外也可以分别\citeauthor{}
和 \citeyear{}
如果是reference放在tex文件里,比如用\begin{thebibliography}
加\bibitem
, 那么建议是用\citeauthor{}
和 \citeyear{}
。但注意,在reference中的\bibitem[]{}
需要显示声明呈现形式。比如\bibitem[abc et al.(2015)]{paper123}
在文中使用时 citeauthor{paper123}, \citeyear{paper123}
即可。记住要按[abc et al.(2015)]
格式把作者和年份区分出来,如果漏掉了,cite之后会出现问好(author?)。
如果还想用\citep
, 需要注意因为有时候\citep{}
不显示作者和年份,或者像\citet{}
的效果那样只显示作者,不显示年份。我后续代码单独开的新文件是可以成功的,但有时候写好的论文再修改格式,怎么改都改不出来,可能是有覆盖。暂时没研究细节了
暂时没找到更有效的方式了,如果有的话欢迎留言。
debug代码
\documentclass{article}
\usepackage[square]{natbib}
\usepackage{hyperref}
\usepackage{url}
\bibliographystyle{cell}
\setcitestyle{authoryear,open={(},close={)}}
\begin{document}
1\citep{abcd:2006a}
2\citep{abcd:2006b}
3\cite{abcd:2006b}
4\citeauthor{abcd:2006b}, \citeyear{abcd:2006b}
5\citeauthor{abcd:2006a}
6\citeyear{abcd:2006b}
7\citeauthor{gan2014}, \citeyear{gan2014}
8\citep{gan2014, Bridges2004}
\bibliography{cellcite}
\bibliography{cellcite}
\begin{thebibliography}{}
\bibitem[Goodfellow et al.(2014)]{gan2014} Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., ... & Bengio, Y. (2020). Generative adversarial networks. Communications of the ACM, 63(11), 139-144.
\bibitem[Bridges.(2004)]{Bridges2004} L. Bridges, Face Reading in Chinese Medicine. London, U.K.: Churchill Livingstone, 2004.
\end{thebibliography}
\end{document}
其中bib文件为:
@incollection{abcd:2006a,
author = "Torben G. Andersen and Tim Bollerslev and
Peter F. Christoffersen and Francis X.
Diebold",
title = "Volatility and correlation forecasting",
chapter = 15,
pages = "777--878",
editor = "Graham Elliott and Clive W. J. Granger and
Allan Timmermann",
booktitle = "Handbook of Economic Forecasting,
Volume~1",
publisher = "Elsevier",
address = "Amsterdam",
year = 2006,
}
@incollection{abcd:2006b,
author = "Torben G. Andersen and Tim Bollerslev and
Peter F. Christoffersen and Francis X.
Diebold",
title = "Practical volatility and correlation
modeling for financial market risk
management (with discussion)",
chapter = 11,
pages = "513--548",
editor = "Mark S. Carey and Ren{\'e} M. Stulz",
booktitle = "The Risks of Financial Institutions",
publisher = "University of Chicago Press",
address = "Chicago and London",
year = 2006,
}
再overleaf上预览效果就是这样. 那个绿色的框是可以关掉的,具体代码忘了,我这里默认关,转成pdf之后就没有绿框了