My Bibliography Does Not Appear

The bibliography doesn't appear in the next code, I am exporting the bibliography from a .bib file, the .bib file is a TeX document called sample.bib that I've modified replacing the extension by .bib, besides I've created a document called sample.bib that was a plain text, but the bibliography doesn't appear either.

This is my code.

\documentclass[12pt,a4paper]{book}

\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\usepackage{float}
\usepackage{mathtools}

\DeclarePairedDelimiter\abs{\lvert}{\rvert}%
\DeclarePairedDelimiter\norm{\lVert}{\rVert}

\title{Propuesta de Investigación\\Analisis de bifurcaciónes de Codimension- 2 en un Modelo de Desarrollo sostenible\vspace{5cm}\\}
\author{Juan Pablo Muñoz Diaz\\}
\date{\today}
\begin{document}

\bibliography{sample}

\end{document}

• Please do not shout at us! It isn't a great way to greet people you are asking for help.
– cfr
Nov 26, 2016 at 2:51
• You need a bibliographystyle{} command. You need to cite the entries you want to use in your document. Then you need to compile, run bibtex and compile twice more. Your .bib file should be a database of entries - not a TeX document. Don't put line breaks in the arguments of commands such as \author{} and \title{}. mathtools loads amsmath; tikz loads pgf; amssymb loads amsfonts.
– cfr
Nov 26, 2016 at 2:55
• Here is the classic reference on how to use BibTeX.
– jon
Nov 26, 2016 at 3:10
• Some times, I have experienced a similar problem, suddenly the bibliography does not show in the document. It usually means there is a syntax error in the .bib file. Nov 26, 2016 at 7:32

Well, in your code are two errors causing that the bibliography can not be displayed.

The first one is that you have to add an command \bibliographystyle{...} to define the layout of the resulting bibliography, for example you can use \bibliographystyle{unsrt}.

The second error is that you need to cite one or more bib entries to get a bibliography printed. Or you can use command \nocite{*} to get all uncited bib entries printed in the bibliography.

The following code (MWE) compiles with the wanted result:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{Goossens,
author    = {Goossens, Michel and Mittelbach, Frank and
Samarin, Alexander},
title     = {The LaTeX Companion},
edition   = {1},
year      = {1994},
}
title     = {The Restaurant at the End of the Universe},
series    = {The Hitchhiker's Guide to the Galaxy},
publisher = {Pan Macmillan},
year      = {1980},
}
\end{filecontents*}

\documentclass[12pt,a4paper]{book}

\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
%\usepackage{amsmath}
%\usepackage{amsfonts}
%\usepackage{amssymb}
%\usepackage{pgf,tikz}
%\usetikzlibrary{arrows}
%\usepackage{float}
\usepackage{mathtools}

\DeclarePairedDelimiter\abs{\lvert}{\rvert}%
\DeclarePairedDelimiter\norm{\lVert}{\rVert}

\title{Propuesta de Investigación\\Analisis de bifurcaciónes de Codimension- 2 en un Modelo de Desarrollo sostenible\vspace{5cm}\\}
\author{Juan Pablo Muñoz Diaz\\}
\date{\today}

\begin{document}

Text~\cite{adams} % citing one bib entry % <============================
\nocite{*}   % all not cited bib entrys are shown in bibliography ...
\bibliographystyle{unsrt} % <===========================================
\bibliography{\jobname} % to use file created by filecontents ...

\end{document}


with the resulting pdf:

• I most copy all the code and compile it, or I must copy the first part in other kind of archive? Becouse if I copy all the document in a .tex extension document, the bibliography do not appear and the citation either. Nov 27, 2016 at 20:57
• @JuanMuñoz Sorry, I do not understand your comment. Do you talk about my MWE or about your code? In my MWE I only used package filecontents to have bib entries and tex code concatenated in one compiling tex code. You use you own bib file and therefore have to change the used name in the call of \bibliography ... Nov 27, 2016 at 21:07
• How do I use my own .bib file, how do i create it? Nov 28, 2016 at 3:04