latex设置citation显示作者+年份

如果是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之后就没有绿框了

在这里插入图片描述

  • 10
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值