我已经使用 JabRef 软件创建了一个.bib
名为的文件,并通过以下myreferences.bib
行将其导入到我的.tex
文件中:mypaper.tex
\bibliography{myreferences}
在文件末尾mypaper.tex
紧接着以下行:
\bibliographystyle{mnras}
并且就在以下几行之前:
\bsp
\label{lastpage}
\end{document}
以下是文件开头的所有行mypaper.tex
:
\documentclass[a4paper,fleqn,usenatbib]{mnras}
\usepackage{newtxtext,newtxmath}
\usepackage[T1]{fontenc}
\usepackage{ae,aecompl}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{mathrsfs}
在此之前,我从未遇到过更新myreferences.bib
文件和编译的问题mypaper.tex
文件的问题。然而从今天开始,我注意到输出中的所有引用都标有?标记任何新添加到myreferences.bib
文件中的引用。我做的第一件事是禁用防病毒软件的防火墙,然后更新 MikTeX 程序,然后启用防火墙。(我这样做是因为在更新 MikTeX 时,我在禁用防火墙之前收到了错误消息)。更新 MikTex 后,我再次启用了防病毒防火墙。但问题仍未解决。非常感谢您的帮助。
这是一个最小的工作示例:
mypaper.tex 文件:
\documentclass[a4paper,fleqn,usenatbib]{mnras}
\usepackage{newtxtext,newtxmath}
\usepackage[T1]{fontenc}
\usepackage{ae,aecompl}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{mathrsfs}
\title[]{The Title of the Paper}
\author[A. Lastname et al.]{
Andrew Smith,$^{1}$\thanks{E-mail: [email protected]}
Andrea Robertson,$^{2}$\thanks{E-mail: [email protected]}
Asher Aaronson$^{2,3}$\thanks{E-mail: [email protected]}
\\
$^{2}$Department of Astronomy/Steward Observatory, University of Arizona, 933 North Cherry Avenue, Tucson, AZ 85721, USA\\
$^{3}$Department of Physics and Atmospheric Sciences, University of Arizona, 2381 E. Fourth Street, Phoenix, AZ 85721, USA\\
$^{1}$California Institute of Technology, 1600 East California Blvd, Pasadena, CA 91125, USA}
\date{Accepted XXX. Received YYY; in original form ZZZ}
\pubyear{2016}
\begin{document}
\label{firstpage}
\pagerange{\pageref{firstpage}--\pageref{lastpage}}
\maketitle
\begin{figure}
\includegraphics[width=\columnwidth]{Figure4}
\caption{This is taken from \citet{2016arXiv160608440M} and \citet{2016ApJ...824..110C}.}
\label{fig:Figure 4}
\end{figure}
\bibliographystyle{mnras}
\bibliography{myreferences2}
\appendix
\bsp
\label{lastpage}
\end{document}
myreferences2.bib 文件:(我仅包含有问题的两个新参考文献。这就是我创建仅包含这两个新参考文献的第二个 .bib 文件的原因。)
% Encoding: UTF-8
@Article{2016ApJ...824..110C,
author = {{Crone Odekon}, M. and {Koopmann}, R.~A. and {Haynes}, M.~P. and {Finn}, R.~A. and {McGowan}, C. and {Micula}, A. and {Reed}, L. and {Giovanelli}, R. and {Hallenbeck}, G.},
title = {{The HI Content of Galaxies in Groups and Clusters as Measured by ALFALFA}},
journal = {\apj},
year = {2016},
volume = {824},
pages = {110},
month = jun,
adsnote = {Provided by the SAO/NASA Astrophysics Data System},
adsurl = {http://adsabs.harvard.edu/abs/2016ApJ...824..110C},
archiveprefix = {arXiv},
doi = {10.3847/0004-637X/824/2/110},
eid = {110},
eprint = {1604.08862},
file = {:2016ApJ...824..110C.pdf:PDF},
keywords = {galaxies: clusters: general, galaxies: evolution, galaxies: groups: general, galaxies: ISM, galaxies: spiral, galaxies: statistics }
}
@Article{2016arXiv160608440M,
author = {{Martindale}, H. and {Thomas}, P.~A. and {Henriques}, B.~M. and {Loveday}, J.},
title = {{A consistent model for both the HI and stellar mass functions of galaxies}},
journal = {ArXiv e-prints},
year = {2016},
month = jun,
adsnote = {Provided by the SAO/NASA Astrophysics Data System},
adsurl = {http://adsabs.harvard.edu/abs/2016arXiv160608440M},
archiveprefix = {arXiv},
eprint = {1606.08440},
file = {2016arXiv160608440M.pdf:2016arXiv160608440M.pdf:PDF;:2016arXiv160608440M.pdf:PDF},
keywords = {Astrophysics - Astrophysics of Galaxies}
}
并且成功以 pdf 格式创建了带有标题的输出(即图 4)。在图片的标题中,除了实际引用的文章author et al. (year)
(显示为问号“?”,没有引号)外,其他所有文章都存在:
这是从“? 和?”中取出来的。
答案1
感谢大家对理解问题的贡献。我学到的第一件事是运行脚本的顺序的重要性,顺序应如下:(如用户名 cfr 所述)
1. Typsetting .tex file (e.g. pdfLatex mypaper.tex)
2. Running myreferences.bib file
3. Running pdfLatex
4. Running padfLatex
但是,只有在我从工作目录中删除了所有中间文件和辅助文件(即 .bbl、.out、.synctex、.bib.bak 等,只留下两个文件mypaper.tex
和myreferences.bib
文件)后,我才能通过这些步骤解决问题;似乎较旧的辅助文件正在干扰myreferences.bib
文件更新。)我还必须在上面的列表中添加一个步骤:。
5. Running pdfLatex+makeIndex+bibTeX all three together as the final step