我正在尝试导入引文,但出现以下错误。它显示作者?代替author-year
。
document1.snw
:
\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage{float}
\usepackage{mathtools}
\usepackage{eso-pic}
\usepackage{array}
\usepackage{shortvrb}
\usepackage{tikz}
\usepackage{tabularx}
\usepackage{listings}
\usepackage{amsmath}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{natbib}
\begin{document}
the possible future events \citet{Test12}.
\bibliographystyle{plainnat}
\bibliography{References_trial}
\end{document}
References_trial.bib
:
@article{Test12,
author = {{John Smith}},
title = {Test Article},
year = {2012},
journal = {The Test Journal}
}
答案1
一些评论和意见:
如果您想要使用
\citet
生成“文本样式”作者年份类型的引用标注,请务必使用natbib
选项authoryear
和加载引用包round
。无论您做什么,都请更改
author = {{John Smith}},
为author = {John Smith},
或author = {Smith, John},
。确保运行完整的编译循环(LaTeX、BibTeX 和 LaTeX 两次以上)以解决
\cite
相关的交叉依赖问题。
\documentclass[a4paper]{article}
\begin{filecontents}[overwrite]{References_trial.bib}
@article{Test25,
author = {John Smith},
title = {Test Article},
journal= {The Test Journal},
year = {2525},
volume = {1},
number = {2},
pages = {3-4},
}
\end{filecontents}
\usepackage[authoryear,round]{natbib}
\bibliographystyle{plainnat}
\begin{document}
\noindent
\citet{Test25}
\bibliography{References_trial}
\end{document}