引用参考文献错误

引用参考文献错误

有人能帮我弄清楚为什么每次我尝试引用参考文献时我的 Tex 都无法运行吗?如果没有引用参考文献,我的整个 Tex 文件都会构建(运行)。

这是乳胶文件

\documentclass[preprint,3p, review,times]{elsarticle}
\usepackage[colorlinks=true]{hyperref}
\usepackage{epsfig}
\usepackage{amssymb}
\usepackage{setspace}
\usepackage{amsthm}
\usepackage[running]{lineno}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{amsbsy}
\usepackage{color}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{float}
\usepackage{moreverb}
\usepackage{adjustbox}
\usepackage[english]{babel}
\usepackage{cite}
\usepackage{amscd}
\usepackage{epsfig}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{fancyhdr}
\newtheorem{definition}{Definition}
\newtheorem{notation}{Notation}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\setlength{\unitlength}{0.8cm}
\theoremstyle{remark}
\newtheorem*{remark}{Remark}
\usepackage{natbib}
\usepackage{cite}
\usepackage[utf8]{inputenc}

\begin{document}
Cramer's rule was named after a Swiss mathematician Gabriel Cramer
(1704-1752) \cite{Cramer}. Historically, an Italian mathematician
Gerolamo Cardano gave a rule called \textit{regula de modo}- mother of rules, in his ``\textit{ars magna''}. Though his
methods were practically based on $2\times 2$ resultants.  \cite{Gardano}.

\noindent \textbf{References}
\bibliography{ok}
\bibliographystyle{model1-num-names}
\end{document}

这是 bibtex 文件

@book{cramer1750introduction,
  title={Introduction a l'analyse des lignes courbes algebriques par Gabriel Cramer...},
  author={Cramer and Gabriel and Cramer fr{\`e}res \& Philibert and Claude},
  year={1750},
  publisher={chez les freres Cramer \& Cl. Philibert}
}


@article{cardano1968ars,
  title={Ars magna (1545)},
  author={Cardano, Girolamo and Spon, C},
  journal={Opera Omnia},
  volume={4},
  pages={221--302},
  year={1968}
}

答案1

您的代码包含两条\cite指令:\cite{Cramer}\cite{Gardano}。但是,bib 文件中的两个条目具有以下键:cramer1750introductioncardano1968ars。这不可能顺利进行。您需要更改指令的参数\cite或书目条目的键。然后再重新运行 LaTeX、BibTeX 和 LaTeX 两次。

您的序言中还有一个问题:您同时加载了cite包(实际上是两次!——为什么?)和natbib包。您应该加载一个或另一个引文管理包,但并非两者兼而有之。我建议您删除该cite包并加载natbib带有选项的包numbers

修复内容bib 文件(我咨询了 Google Books)并将序言精简到最低限度会产生以下可编译代码。

在此处输入图片描述

\RequirePackage{filecontents}
\begin{filecontents}{ok.bib}
@book{Cramer,
  title    = {Introduction {\`a} L'Analyse des Lignes Courbes Alg{\'e}briques},
  author   = {Cramer, Gabriel},
  year     = {1750},
  publisher= {Fr{\`e}res Cramer \& Cl.\ Philibert},
  address  = {Geneva},
}
@incollection{Cardano,
  title    = {{Ars Magna} (1545)},
  author   = {Cardano, Girolamo},
  editor   = {Sponi, Charles},
  booktitle= {Opera Omnia},
  volume   = {4},
  pages    = {221--302},
  year     = {1663},
}
\end{filecontents}

\documentclass[preprint,3p,review,times]{elsarticle}
\usepackage[english]{babel}
\usepackage[numbers]{natbib}
\bibliographystyle{model1-num-names}
\usepackage[colorlinks=true]{hyperref}

\begin{document}
Cramer's Rule is named after the Swiss mathematician Gabriel Cramer (1704--1752), who
hinted that resultants (determinants) might be useful in analytical geometry~\cite{Cramer}. 
Earlier, the Italian mathematician Gerolamo Cardano, in 1545, gave a rule for solving a 
system of two linear equations which he called \textit{regula de modo}---mother of 
rules---in his \textit{Ars Magna}. However, his methods were in practice based on 
$2\times2$ resultants. The rule later gave what we essentially know as Cramer's 
Rule~\cite{Cardano}.

\bigskip\noindent 
\textbf{References}
\bibliography{ok}
\end{document}

相关内容