and\NAT@force@numbers{}\NAT@force@numbers 错误

and\NAT@force@numbers{}\NAT@force@numbers 错误

我正在尝试使用 unsrt 格式,其中包括方块和数字。我使用了以下代码,但每次我都会遇到此错误或 [作者,年份] 格式。你能帮帮我吗?

\documentclass[final,3p,times,twocolumn,authoryear]{elsarticle}
%% \documentclass[final,5p,times,authoryear]{elsarticle}
%% \documentclass[final,5p,times,twocolumn,authoryear]{elsarticle}

%% For including figures, graphicx.sty has been loaded in
%% elsarticle.cls. If you prefer to use the old commands
 \usepackage{epsfig}
\usepackage[pagebackref=false,colorlinks,linkcolor=blue,citecolor=magenta]{hyperref}
%% The amssymb package provides various useful mathematical symbols
\usepackage{amssymb}
\usepackage{float}
\usepackage{setspace}
%\usepackage[english]{babel}
%\usepackage{titling}
\usepackage{hyperref}
\usepackage{fixltx2e}
\usepackage[T1]{fontenc}
\usepackage[table]{x color}
\usepackage{mathpazo}
%\usepackage[nottoc]{tocbibind}
%\usepackage[english]{babel}
\usepackage{amsmath,amssymb}
\usepackage{mhchem}
\usepackage{blindtext}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{parskip}
\usepackage{url}
\usepackage{mathtools}
\usepackage{subfig}
\usepackage{pdfpages}
\usepackage[utf8x]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage{newunicodechar}
%\usepackage[round, sort, compress, authoryear]{natbib}
\usepackage{natbib}
\setcitestyle{square, comma, numbers,sort&compress, super}
\usepackage[italian,english]{babel}
\usepackage[autostyle]{csquotes}
\usepackage{fancyheadings}
\usepackage{fancyhdr}
\usepackage{lscape}
\usepackage{adjustbox}
\usepackage{array}
\usepackage{csquotes}
\usepackage[T1]{fontenc}
\usepackage[tableposition=top]{caption}
\usepackage{tabularx}
\usepackage{makecell}
\usepackage{multirow}
\usepackage{epsfig}
\usepackage{enumerate}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amscd}
\usepackage{newtxtext,newtxmath}
\usepackage{etoolbox}
\usepackage{setspace}
%\usepackage[square,numbers]{natbib}

%% The amsthm package provides extended theorem environments
%% \usepackage{amsthm}

%% The lineno packages adds line numbers. Start line numbering with
%% \begin{linenumbers}, end it with \end{linenumbers}. Or switch it on
%% for the whole article with \linenumbers.
\usepackage{lineno}

\journal{Applied Energy}

\begin{document}



\bibliographystyle{unsrt}
\bibliography{articleref}
\end{document}

答案1

首先,请清理您的前言,并仅使用您真正需要的软件包。作为初学者,最好在每个软件包上方写一个简短的注释,解释它的作用或为什么您需要它。一些软件包甚至被加载多次。

mathpazo并且newtxtext,newtxmath可能不应在同一文档中加载。我会使用enumitemnot enumerate。颜色包称为xcolornot x color

您正在加载几个不应再使用的软件包,包括epsfigfancyheadings

除少数例外,hyperref它始终是最后加载的包。

回到您的实际问题:BibTeX 样式unsrt不兼容natbib并且不提供预期格式的数据natbib,因此出现错误。

相反使用unsrtnat

相关内容