![在 Book 类中使用作者年份引用样式](https://linux22.com/image/377210/%E5%9C%A8%20Book%20%E7%B1%BB%E4%B8%AD%E4%BD%BF%E7%94%A8%E4%BD%9C%E8%80%85%E5%B9%B4%E4%BB%BD%E5%BC%95%E7%94%A8%E6%A0%B7%E5%BC%8F.png)
我在 Book 类中使用了作者年份引用样式,如果我们查看生成的 PDF,它似乎运行良好,但文本编辑器(在我们的例子中是 Texmaker)返回一些错误:
! Undefined control sequence.
<argument> \citeauthoryear
{Arasaratnam and Haykin}{ 2009}
l.15 ...au est la structure \cite{Arasaratnam2009}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
[1{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}
]
! Undefined control sequence.
<argument> \protect \citeauthoryear
{Arasaratnam and Haykin}{ 2009}
l.20 ...atnam and Haykin}{ 2009}]{Arasaratnam2009}
Arasaratnam, I., Haykin, ...
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
我该如何解决这个问题?
梅威瑟:
\documentclass[a4paper,french,11pt,oneside,natbib]{book}
\usepackage[left=20mm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{graphicx}
%--------------------------------------------------------------------------------
\usepackage[colorlinks=true,linkcolor=blue, citecolor=cyan]{hyperref}
%--------------------------------------------------------------------------------
\begin{document}
%------------ ----PAGE DE GARDE ---------------------------------------
Le cerveau est la structure \cite{Arasaratnam2009}
\begin{thebibliography}{}
% and use \bibitem to create references. Consult the Instructions for authors for reference list style.
\bibitem[\protect\citeauthoryear{Arasaratnam and Haykin}{ 2009}]{Arasaratnam2009} Arasaratnam, I., Haykin, S.: Cubature Kalman filters. IEEE Trans. Autom. Control. 54, 1254--1269 (2011)
\end{thebibliography}
\end{document}
答案1
您提出的问题与 (a) 的可选参数中提供的信息的结构\bibitem
以及 (b) 无法natbib
正确加载引文管理包有关。恐怕指定名为的文档类选项natbib
不起作用。
另外:我很熟悉这样一句话:品味是无可争议的。(De gustibus non est ...)不过,您可能想重新考虑使用青色作为引文标注颜色是否明智。:-)
\documentclass[a4paper,french,11pt,oneside]{book}
\usepackage[left=20mm]{geometry} % what about the other 3 margins?
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{graphicx}
\usepackage[authoryear]{natbib} % <-- new
\usepackage[colorlinks=true, linkcolor=blue, citecolor=cyan]{hyperref}
\begin{document}
Le cerveau est la structure \citep{Arasaratnam2009}.
Ou: \citet{Arasaratnam2009} ont dit que \dots
\begin{thebibliography}{9}
\bibitem[Arasaratnam and Haykin(2009)]{Arasaratnam2009}
Arasaratnam, I., Haykin, S.: Cubature Kalman filters.
IEEE Trans. Autom. Control. 54, 1254--1269 (2011)
\end{thebibliography}
\end{document}