# Minimal working code to add references from .bib file

Can anyone give me the minimal working code to add the references from a .bib file to a LaTeX article? I have tried everything but nothing seems to work. Content of a minimal .bib file I made called references.bib:

%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/

%% Created for Jef Pauwels at 2015-10-05 14:24:21 +0200

%% Saved with string encoding Unicode (UTF-8)

@book{Giancoli,
Author = {Douglas C. Giancoli},
Date-Modified = {2015-10-05 12:23:50 +0000},
Publisher = {Pearson},
Title = {Physics for Scientists & Engineers},
Year = {2014}}


Well, you didn't mention if you use biblatex and biber or not. The following MWE works with both.

In your bib file you have one error: you should mask & in the title with an \! \& prints the letter & in your document.

Compiling MWE:

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Giancoli,
Author    = {Douglas C. Giancoli},
Publisher = {Pearson},
Title     = {Physics for Scientists \& Engineers},
Year      = {2014},
Date-Modified = {2015-10-05 12:23:50 +0000},
}
\end{filecontents}

\documentclass{article}

\usepackage[%
backend=biber,
style=authortitle,
sorting=nyt,
]{biblatex}

\begin{document}

Some \cite{Giancoli} text \autocite{Giancoli}.

\nocite{*}
\printbibliography

\end{document}


Result:

• Package filecontentsis used to have code and bib file in one MWE. \jobname is replaced with the name of file for the MWE, for example mweif the file is named mwe.tex. Oct 9 '15 at 18:40