0

I am working with sublime text and anytime when I want to add bibliography it failed with warnings: empty bibliography. How can I fix this problem? Here are my codes:

\documentclass[12pt, a4paper, leqno]{article}
\usepackage{a4wide}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{appendix}
\usepackage{float, afterpage, rotating, graphicx}
\usepackage{epstopdf}
\usepackage{longtable, booktabs, tabularx}
\usepackage{fancyvrb, moreverb, relsize}
\usepackage{eurosym, calc}
\usepackage{amsmath, amssymb, amsfonts, amsthm, bm}
\usepackage{newtxtext,newtxmath}
\usepackage{caption}
\usepackage{mdwlist}
\usepackage{xfrac}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{subcaption}
\usepackage{minibox}
\usepackage{makecell}
\renewcommand{\theadfont}{\normalsize}
\usepackage{geometry}
\geometry{
 left=3cm,
 right=2cm,
 top=2cm,
 bottom=2cm,
}

\usepackage[backend=biber]{biblatex}
\addbibresource{refs.bib}
\usepackage[unicode=true]{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=black,
    anchorcolor=black,
    citecolor=black,
    filecolor=black,
    menucolor=black,
    runcolor=black,
    urlcolor=black
}

\widowpenalty=10000
\clubpenalty=10000

\setlength{\parskip}{2ex}
\setlength{\parindent}{0ex}
\setstretch{1.5}

\begin{document}
abcdefghijklmn...

\newpage
\printbibliography
\end{document}

and my bib file is

@article{acemoglu2008income,
  title={Income and democracy},
  author={Acemoglu, Daron and Johnson, Simon and Robinson, James A and Yared, Pierre},
  journal={American Economic Review},
  volume={98},
  number={3},
  pages={808--42},
  year={2008}
}

@book{baltagi2008econometric,
  title={Econometric analysis of panel data},
  author={Baltagi, Badi},
  year={2008},
  publisher={John Wiley \& Sons}
}

@article{kiviet1995bias,
  title={On bias, inconsistency, and efficiency of various estimators in dynamic panel data models},
  author={Kiviet, Jan F},
  journal={Journal of econometrics},
  volume={68},
  number={1},
  pages={53--78},
  year={1995},
  publisher={Elsevier}
}

5
  • You haven't cited anything so what exactly should it list? You can use \nocite{*} to cite everything. Then run latex, biber, latex, latex. Unrelated: don't use the a4wide package, learn to use the geometry package instead better in the long run
    – daleif
    Commented Sep 9, 2020 at 12:49
  • But where should I put \nocite{*}? I tried this and an error occurs: [no file]:32: LaTeX Error: Cannot be used in preamble. [\nocite{*}].
    – w12345678
    Commented Sep 9, 2020 at 12:57
  • well then try some other locations. Commented Sep 9, 2020 at 13:01
  • It works! Thank you!
    – w12345678
    Commented Sep 9, 2020 at 13:06
  • Note that a4wide has been deprecated for about 25 years; mdwlist has not been maintained for 24 years. There are much better alternatives to both: geometry for the former and enumitem for the latter. But my impression is that you got your preamble from somebody else: avoid it and only load the packages you really need.
    – egreg
    Commented Sep 9, 2020 at 17:06

1 Answer 1

0

You need to cite the sources in your document so that they appear in the bibliography. Change your .tex file to:

\documentclass[12pt, a4paper, leqno]{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{refs.bib}
\begin{document}
a\autocite[\pno~1]{acemoglu2008income}

b\autocite{baltagi2008econometric}

cdefghijklmn...

\nocite{kiviet1995bias}

\newpage
\printbibliography
\end{document}

and it should work. Remember to run pdflatex, biber, pdflatex, pdflatex to get all the references and notes right.

Consider posting a minimum working example (without all the extra usepackages) on your next question; sometimes building a minimal example reveals what the issue is.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .