我在使用 natbib 引用时遇到了一些问题。这是我的代码:
\documentclass[a4paper,11pt]{article}
\pdfoutput=1 % if your are submitting a pdflatex (i.e. if you have
% images in pdf, png or jpg format)
\usepackage{jcappub} % for details on the use of the package, please
% see the JCAP-author-manual
\usepackage[T1]{fontenc} % if needed
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{caption}
\bibliographystyle{achemso}
\usepackage[authoryear]{natbib}
\bibliography{mybib.bib}
\usepackage{tikz}
\begin{document}
\section{Introduction}
\citep{Mondal2020}
\end{document}
这是我的.bib
文件:
@ARTICLE{Mondal2020,
author = {{Mondal}, Sushovan and {Ali}, Saif and {S}, Shanima and {Banerjee}, Narayan and {Mortuza Hossain}, Golam},
title = "{Propagation of gravitational waves in various cosmological backgrounds}",
journal = {arXiv e-prints},
keywords = {General Relativity and Quantum Cosmology},
year = 2020,
month = apr,
eid = {arXiv:2004.13554},
pages = {arXiv:2004.13554},
archivePrefix = {arXiv},
eprint = {2004.13554},
primaryClass = {gr-qc},
adsurl = {https://ui.adsabs.harvard.edu/abs/2020arXiv200413554M},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
为什么当我尝试创建 PDF 时,我收到的不是引文 [?]?任何帮助都将不胜感激。谢谢。
答案1
您的测试文档存在几个问题:
最重要的是,不要将
\bibliography
指令放在序言中,而是放在document
您希望排版格式化参考书目的环境中。通常,这是在文档的末尾。包会自动
jcappub
加载natbib
。如果您想要作者年份样式的引文标注,则需要将该authoryear
选项放置在文档类选项中。条目类型
@article
不适合当前的条目。它确实应该是@misc
。
\documentclass[a4paper,11pt,authoryear]{article}
\begin{filecontents}[overwrite]{mybib.bib}
@misc{Mondal2020,
title={Propagation of gravitational waves in various cosmological backgrounds},
author={Sushovan Mondal and Saif Ali and Shanima S and Narayan Banerjee
and Golam Mortuza Hossain},
year={2020},
eprint={2004.13554},
archivePrefix={arXiv},
url={https://arxiv.org/abs/2004.13554},
primaryClass={gr-qc}
}
\end{filecontents}
\usepackage[T1]{fontenc}
\usepackage{xurl}
\usepackage{jcappub} % this package loads 'natbib' automatically
\bibliographystyle{achemso}
\begin{document}
\section{Introduction}
\citep{Mondal2020}
\bibliography{mybib}
\end{document}