2

I feel desperate and about to give up LaTeX. I am new to it but I have done well until I reach the bibliography. Now I am stuck for days and I have a deadline. I am sure I have a problem with my codes, but I keep getting different error messages. Once it worked until the \cite{author} but worked on some and not the others. Now nothing works.

\documentclass[10pt, a4paper]{article}
\bibliographystyle{IEEEtr}
\usepackage[margin=1in,left=1.5in, includefoot]{geometry}
\usepackage{amsmath}
\usepackage{authblk}
\usepackage[english]{babel}
\usepackage{indentfirst}
\usepackage{parskip}
\setlength\parindent{24pt}
\setlength{\parskip}{\baselineskip}
\renewcommand{\baselinestretch}{1.08}
\usepackage{wrapfig}
\usepackage{caption}
\usepackage{placeins}
\usepackage{natbib}
\setcitestyle{numbers}
\usepackage{filecontents}


%Graphics preamble
\usepackage{graphicx}
\usepackage{float}
\setlength{\textfloatsep}{5pt}

%header and footer stuff
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyfoot[R]{ \thepage\ }

%
\begin{document}
\begin{titlepage}
   \centering
   \huge{\bfseries  mettle}\\
   \vspace{1 cm}
 \large\ Author 1, Author 2, Author 3\\
   \vspace{1 cm}
   \textsc{mysubtitle}\\

\end{titlepage}

% Abstract page
\pagenumbering{roman}
\section*{Abstract}\label{sec:abs}



\addcontentsline{toc}{section}{\numberline{}Abstract}
\cleardoublepage

% table of content page
\tableofcontents
\thispagestyle{empty}
\cleardoublepage

%list of figures
\listoffigures
\addcontentsline{toc}{section}{List of Figures}
\cleardoublepage

% Main document
\pagenumbering{arabic}
\setcounter{page}{1}
\section{Introduction}\label{sec:intro}

TEXT
\section{heading}
\section{conclusion}
\newpage

\section{References}
\bibliography{references}{}

\cleardoublepage
\end{document}
CarLaTeX
  • 62,716
Asma
  • 21
  • 1
    Welcome to TeX.SX! Your code as it stands will have no bibliography due to a lack of \cite or \nocite commands. If the issue is more than this, please add in some \cites and update your code in the question along with the associated bib entry. If you are getting errors, please either provide code (as a minimal working example with bibliography (MWEB)) which we can compile locally to replicate the errors or provide the text of the error. – Dai Bowen Feb 20 '17 at 10:48
  • 1
    "Nothing works" is not a sensible problem description. Check http://www.chiark.greenend.org.uk/~sgtatham/bugs.html to learn how to improve your question. – Ulrike Fischer Feb 20 '17 at 10:48
  • 2
    Have you run pdflatex, bibtex, and then again pdflatex twice? Please give us an example of your .bib file, I tried with an example .bib file and you code works. – CarLaTeX Feb 20 '17 at 11:08
  • bibtex error message: Warning--entry type for "Eurorec" isn't style-file defined --line 18 of file references.bib Warning--I didn't find a database entry for "(Bodenheimer" – Asma Feb 20 '17 at 11:44
  • Have you those entries in your references.bib file? Could you add how they are defined in it? – CarLaTeX Feb 20 '17 at 12:09
  • Example:@url{Eurorec, Date-Added = {2017-02-19 16:11:14 +0000}, Date-Modified = {2017-02-19 16:11:53 +0000}, Title = {EuroRec}, Url = {http://www.eurorec.org/whoarewe/introduction.cfm}} – Asma Feb 20 '17 at 12:17
  • this worked: run pdflatex, bibtex, and then again pdflatex twice? Please give us an example of your .bib file. But one citation appear as (?) – Asma Feb 20 '17 at 12:20
  • @Asma if one citation appears as [?] then the key is likely mistyped either in the main document or in the bib file (or the entry is missing altogether from the bib file) possibly from your second bibtex warning you gave earlier, you have (Bodenheimer in the tex file where you mean to have Bodenheimer. Otherwise it sounds like this is the same as Question mark or bold citation key instead of citation number - it's always necessary to do the pdflatex bibtex pdflatex pdflatex chain to get references to show up properly. – Dai Bowen Feb 20 '17 at 13:27
  • Is there any particular reason for using the IEEEtr bibliography style? I ask because the IEEEtr style is more than 25 years old and is not programmed fields named, say, url and date-added. At the very least, you should try using one of the newer IEEE bibliography styles. – Mico Feb 20 '17 at 13:42

1 Answers1

1

(too long for a comment, hence posted as an anwer)

The following, much-condensed version of your example code, "works" in the sense that a bibliographic entry and a corresponding citation call-out are produced by running pdflatex, bibtex, and pdflatex twice more.

\RequirePackage{filecontents}
\begin{filecontents}{references.bib}
@url{Eurorec,
  date-added   = "2017-02-19 16:11:14 +0000",
  date-modified= "2017-02-19 16:11:53 +0000",
  title        = "EuroRec",
  url          = "eurorec.org/whoarewe/introduction.cfm",
}
\end{filecontents}

\documentclass[10pt, a4paper]{article}
\bibliographystyle{IEEEtr}
\usepackage{url}
\usepackage{natbib}
\setcitestyle{numbers}

\begin{document}
\cite{Eurorec}
\bibliography{references}
\end{document} 

Note that the formatted entry will show only 1 field: title. This is because the IEEEtr bibliography style, being slightly archaic, is not programmed to recognize the fields named url, date-added, and date-modified. It doesn't recognize the entry type @url either; however, it is programmed to treat all unrecognized entry types as being of type @misc -- the catch-all entry type.

Mico
  • 506,678
  • I am still struggling with bibliography. citations are now in place but the bib style is odd. I get a citation of g o b o Swedish. Even though the entry is as follows: @techreport{Gartner, Author = {Gartner on behalf of Swedish Ministry of Health and Social Affairs}, Date-Added = {2017-02-19 12:42:47 +0000}, Date-Modified = {2017-02-19 12:47:39 +0000}, Institution = {Swedish Ministry of Health and Social Affairs}, Title = {eHealth for a Healthier Europe!}, Year = {2009}} – Asma Feb 20 '17 at 15:54
  • @Asma - Here's a case of a "corporate" author: Economics ncase the author field in double pairs of curly braces. Search this site for "corporate author" for more information on this subject... – Mico Feb 20 '17 at 17:24