2

Please can someone help me figure why my Tex does not run whenever I try cite the references. Without reference citing, my whole Tex file will build(run).

Here is the latex file

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

and here is the bibtex file

@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}
}
2

Your code features two \cite instructions: \cite{Cramer} and \cite{Gardano}. The two entries in the bib file, though, have the following keys: cramer1750introduction and cardano1968ars. This cannot possibly go well. You need to change either the arguments of the \cite instructions or the keys of the bibliographic entries. Then re-run LaTeX, BibTeX, and LaTeX twice more.

Your preamble features an additional problem: You load both the cite package (twice actually! -- why?) and the natbib package. You should load one or the other citation management package, but not both. I suggest you drop the cite package and load the natbib package with the option numbers.

Fixing up the contents of the bib file (I consulted Google Books) and stripping the preamble down to a bare minimum yields the following compilable code.

enter image description here

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.