2

I am having trouble in generating bibliography. I am using Mendeley for generating .bib file. Before I was using the same process it was working very accurately but now its not. Whenever I try to compile my document it is continuously saying there were undefined references although I am putting it in citation very well by using \citep{}. under text its working properly but at the end no bibliography is generating. The code I am using is given below

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

\usepackage[T1]{fontenc}

\usepackage{newtxtext}

\usepackage[utf8]{inputenc}

\usepackage[english]{babel}

\usepackage{csquotes}

\usepackage{amsthm}

\usepackage{amsmath}

\usepackage{mathptmx}

\usepackage{mathrsfs}

\usepackage{textcomp}

\usepackage{textgreek}

\usepackage{float} \restylefloat{table}

\usepackage{url}

\usepackage[natbib=true, backend=biber,style=apa]{biblatex}

\addbibresource{library.bib}

\usepackage[final]{graphicx}

\graphicspath{{Figures/}}

\usepackage{geometry} \geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm,headheight=0cm,headsep=0cm,footskip=0cm, nomarginpar % <-- comment out this option to see the difference } \pagestyle{empty} \setlength{\parskip}{0bp} \setlength{\parindent}{0pt} \usepackage{marginnote} \usepackage{parskip} \usepackage{setspace} \doublespacing

\usepackage{caption}% <-- added

\usepackage{subcaption} \usepackage{tabulary} \usepackage[para]{threeparttable} \usepackage{array,longtable,tabularx} \usepackage{booktabs,ragged2e,ltxtable,pdflscape,filecontents}

\usepackage[flushleft, online]{threeparttablex} \usepackage{ltablex}% \usepackage{booktabs,ragged2e,ltxtable,pdflscape,filecontents} \newcolumntype{L}{>{\raggedright\arraybackslash}X}% \usepackage{siunitx}% <-- added

%for creating hyperref. \usepackage{hyperref} \hypersetup{ colorlinks=true, linkcolor=black, filecolor=black, citecolor = black,
urlcolor=blue, }

\usepackage{acro} \acsetup{list-style=longtable}

\begin{document}

\author{XYZ} \title{ABC} \date{July 2020}

\frontmatter \maketitle

\tableofcontents \listoftables \listoffigures

\mainmatter \include{./Chapters/Chapter1} \include{./Chapters/Chapter2}

\backmatter % bibliography, glossary and index would go here.

\printbibliography \end{document}

Plz help me I am in real trouble. Here is a .blg file

[0] Config.pm:304> INFO - This is Biber 2.14

[0] Config.pm:307> INFO - Logfile is 'Chal jaa bass.blg'

[139] biber-MSWIN64:322> INFO - ===

[202] Biber.pm:415> INFO - Reading 'Chal jaa bass.bcf'

[489] Biber.pm:943> INFO - Found 1 citekeys in bib section 0

[525] Biber.pm:4256> INFO - Processing section 0

[525] Utils.pm:75> INFO - Globbing data source 'library.bib'

[542] Utils.pm:91> INFO - Globbed data source 'library.bib' to library.bib

[574] Biber.pm:4455> INFO - Looking for bibtex format file 'library.bib' for section 0

[622] bibtex.pm:1653> INFO - LaTeX decoding ...

[2055] bibtex.pm:1471> INFO - Found BibTeX data source 'library.bib'

[2058] Utils.pm:304> WARN - Duplicate entry key: 'Hasan2011' in file 'library.bib', skipping ...

[2146] Utils.pm:304> WARN - BibTeX subsystem: C:\Users\Ahmed\AppData\Local\Temp\biber_tmp_8yB4\library.bib_2388.utf8, line 6, warning: 172 characters of junk seen at toplevel

[2146] Utils.pm:320> ERROR - BibTeX subsystem: C:\Users\Ahmed\AppData\Local\Temp\biber_tmp_8yB4\library.bib_2388.utf8, line 1269, syntax error: found "2013", expected ","

[2147] Biber.pm:128> INFO - WARNINGS: 2

[2147] Biber.pm:132> INFO - ERRORS: 1

moewe
  • 175,683
  • And did you run biber? Most editors does not run biber automatically – daleif Jul 03 '20 at 07:31
  • Make sure your document compiles without errors when you run pdfLaTeX (where "pdfLaTeX" could also be just LaTeX). You can ignore warnings about undefined references for now, but all errors must be fixed before you continue. Then run pdfLaTeX, Biber, pdfLaTeX, pdfLaTeX, see also https://tex.stackexchange.com/q/63852/35864 and https://tex.stackexchange.com/q/154751/35864. If you did that successfully and still don't get the expected output, please show us the complete .blg file (the .blg file is Biber's log file, it is a simple text file despite what your OS may say). – moewe Jul 03 '20 at 07:35
  • Well .. I am using texstudio and also using biber. I have selected the option biber already and before it was perfectly working. – Ali Ahmed Jul 03 '20 at 07:43
  • I have done what you said to me pdfLaTeX, Biber, pdfLaTeX, pdfLaTeX. and there is no error in my compilation file. But its not working. Infact I have reinstalled Miktex but this problem is still there. – Ali Ahmed Jul 03 '20 at 07:48
  • This is a sequence of my .bib file reference @article{Vives2019, abstract = {}, author = {Vives, Xavier}, doi = {}, file = {}, issn = {01677187}, journal = {International Journal of Industrial Organization}, keywords = {Crisis,Digital technology,Fintech,Regulation,Run,Shadow banking}, pages = {55--69}, publisher = {Elsevier B.V.}, title = {{}}, url = {https://doi.org/10.1016/j.ijindorg.2018.08.011}, volume = {64}, year = {2019} } – Ali Ahmed Jul 03 '20 at 07:52
  • What does the .blg file say? If you ran Biber there should be a .blg file in the same directory as your main .tex file. Open it with your favourite text editor and paste its complete contents into your question (as an edit, please always edit your question to add significant information, things get lost too easily in the comments - and the formatting for code can be horrible in the comments) – moewe Jul 03 '20 at 08:01
  • I put my .blg file above in question. you can check it. – Ali Ahmed Jul 03 '20 at 08:12
  • 1
    There you have it. You have two entries with the same key Hasan2011 in your library.bib. There also appears to be some junk at the beginning of the .bib file. This need not be an issue, but could be a runaway field definition or similar (hard to say without seeing the actual .bib file.) But the real issue is line 1269, syntax error: found "2013", expected ",". This may not actually be a missing ,, it could also be misplaced curly braces or a space in an entry key (like *@artcicle{Smoth 2013,). Check out all entries at or about line 1269 in your bib file (or look for 2013). – moewe Jul 03 '20 at 08:14
  • I got the error and recompiled my document again and boom its working now. problem solved. Thank you soo much you have no idea how you guys helped me. I mean you seems to me an angle like you helped me... God bless you..! – Ali Ahmed Jul 03 '20 at 08:53

1 Answers1

3

If your bibliography does not compile properly it is always a good idea to look at the .blg file (Biber's log file).

While you should look into

[2058] Utils.pm:304> WARN - Duplicate entry key: 'Hasan2011' in file 'library.bib', skipping ...

which suggests that you have two entries with the same key Hasan2011

and

[2146] Utils.pm:304> WARN - BibTeX subsystem: C:\Users\Ahmed\AppData\Local\Temp\biber_tmp_8yB4\library.bib_2388.utf8, line 6, warning: 172 characters of junk seen at toplevel

which suggests that there is some additional text (that may be benign or the sign of a malformed entry) at the beginning of your .bib file

the real issue is

[2146] Utils.pm:320> ERROR - BibTeX subsystem: C:\Users\Ahmed\AppData\Local\Temp\biber_tmp_8yB4\library.bib_2388.utf8, line 1269, syntax error: found "2013", expected ","

At or around line 1269 of your .bib file Biber expects a , but saw 2013. A common cause of errors like this is a space in the entry key. Entry keys may not contain spaces, so the following would raise such an error

@article{Smoth 2013,

Change it to

@article{Smoth2013,

I imagine it is possible to otherwise generate the quoted error, but this seems to be the most common cause, especially if the file is software generated.

moewe
  • 175,683