1

I am trying to use BibTeX, but the result of this code is that it prints the Bibliography headline and does not display what's inside the sample.bib file. Does someone recognize any mistake? Thanks

\documentclass[12pt,a4paper,twoside]{book}
    \setcounter{secnumdepth}{3} % number subsubsections
    \setcounter{tocdepth}{3} % put subsubsections in ToC
    \renewcommand{\thesubsubsection}{\ensuremath{\blacktriangleright}} % no number, fancy glyph
\usepackage{gensymb}
\usepackage{listings}
\usepackage{color}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{mathtools}
\newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}}
\usepackage{float}
\restylefloat{figure}
\usepackage[margin=2cm]{geometry}
\usepackage[nottoc]{tocbibind}
\usepackage[hang]{footmisc}
\setlength\footnotemargin{15pt}
\usepackage[justification=centering]{caption}
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{graphicx}
\usepackage[english]{babel}
\usepackage{fixltx2e,bold-extra,geometry,
    amssymb,amsmath,mathtools, microtype,url}
\usepackage[bookmarks=true, hidelinks, pdftitle={
THE MANAGEMENT AND PRICING OF WEATHER DERIVATIVES:The case of an HDD Call Option},
pdfauthor={Alessandro Pipitone}]{hyperref}
\pagestyle{headings}
\graphicspath{{images/}}

%%%%%%%%%%%%%%%%% New Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lstset{ 
    language=Matlab,
    numbers=left, 
    numberstyle=\footnotesize,  stepnumber=1,                               numbersep=5pt,backgroundcolor=\color{white},
    showspaces=false,   showstringspaces=false,
    showtabs=false,                         frame=single,              
    tabsize=2,captionpos=b,
    breaklines=true,       
    breakatwhitespace=false,
    escapeinside={\%*}{*)}  
}
%
\newcommand{\intentblankpage}{
%     Leaves a blank page
    \newpage
    \null
    \vfill
    \thispagestyle{empty}
    \begin{center}
         \textit{This page intentionally left blank.}
        %\textit{Questa pagina \`e lasciata intenzionalmente bianca.}
    \end{center}
    \newpage
}
\def\mclimits_#1{\limits_{\mathclap{#1}}}
%%%%%%%%%%%%%%%% End New Commands %%%%%%%%%%%%

\begin{document}
    \input{./titlepage}
    \intentblankpage
    \pagenumbering{Roman}
    \tableofcontents

    \chapter*{Introduction} \pagenumbering{arabic}
    \addcontentsline{toc}{chapter}{Introduction}  
    \label{CH:Intro}
    \input{./introduzione}

    \chapter{The Weather as a Source of Risk}
    \label{CH:Teoria}
    \input{./capI}

    \chapter{Inside the Market: How to Manage Risk Weather}
    \label{CH:Val_num}
    \input{./capII}

    \chapter{Forecasting and Pricing models: A Focus on Temperature}
    \label{CH:Val_num}
    \input{./capIII}

    \chapter{Numerical Implementation of Pricing Models}
    \label{CH:Val_num}
    \input{./capIV}

    \chapter*{Conclusion} 
    \addcontentsline{toc}{chapter}{Conclusion}  
    \label{CH:Intro}
    \input{./conclusioni}

     \chapter*{Appendix A} 
    \addcontentsline{toc}{chapter}{Appendix A}  
    \label{CH:Intro}
    \input{./Appendix}

\bibliographystyle{unsrt}
\bibliography{sample}


    %\listoffigures
\end{document}

My bib file looks like this

@article{einstein,
  author =       "Albert Einstein",
  title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
                 [{On} the electrodynamics of moving bodies]",
  journal =      "Annalen der Physik",
  volume =       "322",
  number =       "10",
  pages =        "891--921",
  year =         "1905",
  DOI =          "http://dx.doi.org/10.1002/andp.19053221004"
}

@book{latexcompanion,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The \LaTeX\ Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

@misc{knuthwebsite,
    author    = "Donald Knuth",
    title     = "Knuth: Computers and Typesetting",
    url       = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
}
  • Added all I have in my bib file – Alessandro Nov 27 '18 at 21:45
  • You don't load biblatex in your preamble, and you use the syntax of bibtex! – Bernard Nov 27 '18 at 21:48
  • My aim is to have a list of books, articles and website at the end of the document, without pointing at the text. The citations in the text I did it with \footnote command – Alessandro Nov 27 '18 at 21:49
  • @Bernard If I upload biblatex with the usepackage command, it gives error and nothing is displayed – Alessandro Nov 27 '18 at 21:53
1

Please see the following MWE. I added your given bib file to it with package filecontents.

Please see that you have to change the order of your used packages. Do not load packages twice.

Because we do not have your \inputed files I added \nocite{*} to get all bib entrys printed in the bibliography.

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{einstein,
  author =       "Albert Einstein",
  title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
                 [{On} the electrodynamics of moving bodies]",
  journal =      "Annalen der Physik",
  volume =       "322",
  number =       "10",
  pages =        "891--921",
  year =         "1905",
  DOI =          "http://dx.doi.org/10.1002/andp.19053221004"
}

@book{latexcompanion,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The \LaTeX\ Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

@misc{knuthwebsite,
    author    = "Donald Knuth",
    title     = "Knuth: Computers and Typesetting",
    url       = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
}
\end{filecontents*}


\documentclass[12pt,a4paper,twoside]{book}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\setcounter{secnumdepth}{3} % number subsubsections
\setcounter{tocdepth}{3} % put subsubsections in ToC
\renewcommand{\thesubsubsection}{\ensuremath{\blacktriangleright}} % no number, fancy glyph
\usepackage{gensymb}
\usepackage{listings}
\usepackage{color}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{mathtools}
\newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}}
\usepackage{float}
\restylefloat{figure}
\usepackage[margin=2cm]{geometry}
%\usepackage{csquotes} % <===============================================
%\usepackage{biblatex}
%\addbibresource{\jobname.bib}
\usepackage[hang]{footmisc}
\setlength\footnotemargin{15pt}
\usepackage[justification=centering]{caption}

\usepackage{graphicx} % <=======================================
\usepackage{%
% fixltx2e,
  bold-extra,
% geometry,
  amssymb,mathtools, microtype,url
}
\usepackage[%
  bookmarks=true, hidelinks, 
  pdftitle={THE MANAGEMENT AND PRICING OF WEATHER DERIVATIVES:The case of an HDD Call Option},
  pdfauthor={Alessandro Pipitone}
]{hyperref}
\pagestyle{headings}
\graphicspath{{images/}}

%%%%%%%%%%%%%%%%% New Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lstset{ 
    language=Matlab,
    numbers=left, 
    numberstyle=\footnotesize,  stepnumber=1,                               numbersep=5pt,backgroundcolor=\color{white},
    showspaces=false,   showstringspaces=false,
    showtabs=false,                         frame=single,              
    tabsize=2,captionpos=b,
    breaklines=true,       
    breakatwhitespace=false,
    escapeinside={\%*}{*)}  
}
%
\newcommand{\intentblankpage}{
%     Leaves a blank page
    \newpage
    \null
    \vfill
    \thispagestyle{empty}
    \begin{center}
         \textit{This page intentionally left blank.}
        %\textit{Questa pagina \`e lasciata intenzionalmente bianca.}
    \end{center}
    \newpage
}
\def\mclimits_#1{\limits_{\mathclap{#1}}}
%%%%%%%%%%%%%%%% End New Commands %%%%%%%%%%%%

\begin{document}
%   \input{./titlepage}
    \intentblankpage
    \pagenumbering{Roman}
    \tableofcontents

    \chapter*{Introduction} \pagenumbering{arabic}
    \addcontentsline{toc}{chapter}{Introduction}  
    \label{CH:Introc}
%   \input{./introduzione}

    \chapter{The Weather as a Source of Risk}
    \label{CH:Teoria}
%   \input{./capI}

    \chapter{Inside the Market: How to Manage Risk Weather}
    \label{CH:Val_num}
%   \input{./capII}

    \chapter{Forecasting and Pricing models: A Focus on Temperature}
    \label{CH:Val_numa}
%   \input{./capIII}

    \chapter{Numerical Implementation of Pricing Models}
    \label{CH:Val_numb}
%   \input{./capIV}

    \chapter*{Conclusion} 
    \addcontentsline{toc}{chapter}{Conclusion}  
    \label{CH:Intro}
%   \input{./conclusioni}

     \chapter*{Appendix A} 
    \addcontentsline{toc}{chapter}{Appendix A}  
    \label{CH:Introb}
%   \input{./Appendix}

\nocite{*} % <==========================================================
\bibliographystyle{unsrt}
\bibliography{\jobname}

    %\listoffigures
\end{document}

and the resulting bibliography:

enter image description here

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.