我收到一个错误“包 natbib 错误:参考书目与作者年份引用不兼容。(natbib)按以继续使用数字引用样式。”
我要在文本中生成参考编号,它效果很好,并且在 PDF 上给我带来了良好的结果,但仍然出现错误!
%%%%%%%%%%%%%Elsevier template %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[5p,preprint,authoryear]{elsarticle}
\journal{Energy}
\setcitestyle{square}
\usepackage{times}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{amsmath}
\usepackage{circuitikz}
\usetikzlibrary{patterns}
\usepackage{array,booktabs}
\usepackage{natbib}
\usepackage{tikz}
\usepackage{float}
\begin{document}
\begin{frontmatter}
\begin{abstract}
Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex
\end{abstract}
\end{frontmatter}
\section{Introduction}
Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex Latex \cite{nazari2019optimal}.
\biboptions{sort&compress}
\bibliographystyle{elsarticle-num}
\bibliography{citation.bib}
\end{document}
\endinput
%%
%% End of file `elsarticle-template-harv.tex'.
我的引文
@article{nazari2019optimal,
title={Optimal energy management for a mild hybrid vehicle with electric and hybrid engine boosting systems},
author={Nazari, Shima and Siegel, Jason and Stefanopoulou, Anna},
journal={IEEE Transactions on Vehicular Technology},
volume={68},
number={4},
pages={3386--3399},
year={2019},
publisher={IEEE}
}
答案1
由于您似乎想要作者年份样式的引用标注,因此您应该更改
\bibliographystyle{elsarticle-num}
到
\bibliographystyle{elsarticle-harv}
在你这样做的同时,你也许还应该改变
\setcitestyle{square}
到
\setcitestyle{round}
然后,删除所有辅助文件并执行完整的重新编译循环 - LaTeX、BibTeX 和 LaTeX 再两次。