natbib 使用時の「著者?」エラー

natbib 使用時の「著者?」エラー

引用をインポートしようとしましたが、次のエラーが発生します。著者?の代わりに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を使用して「テキスト スタイル」の authoryear タイプの引用コールアウトを生成する場合は、必ずnatbibオプションauthoryearとを使用して引用パッケージをロードしてくださいround

  • 何をするにしても、 または に変更しauthor = {{John Smith}},ます。author = {John Smith},author = {Smith, John},

  • \cite関連の相互依存関係を解決するには、必ず完全なコンパイル サイクル (LaTeX、BibTeX、LaTeX をさらに 2 回) を実行してください。

ここに画像の説明を入力してください

\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}    

関連情報