0

So I'm using a template I've found on latextemplates.com and I'm trying to print the bibliography but nothing seems to be working. Also no error warning appears, it just simply skips it.

\usepackage[backend=biber,style=authoryear,natbib=true]{biblatex} 
\addbibresource{library.bib} 
\begin{document}
  some text bla bla bla
\printbibliography[heading=bibintoc]
\end{document}

I've changed the backend to every one I've found online: bibtex, biber and bibtex8.

And it seems that every time I compile it creates a *.bib file automatically.

What can I do?

moewe
  • 175,683
  • The library.bib file is created by you (maybe with the help of an external software program such as Zotero or jabRef). The job of biblatex (with assistance from either bibtex or biber) is to create a .bbl file (which contains the formatted bibliography), based on various pieces of information, such as which items in the bib file are being \cited in the body of the document -- and hence which should show up in the formatted bbl file as well. Do you have any \cite instructions in the body of your document? Did you run biber? Please explain your workflow in more detail. – Mico May 17 '18 at 13:47
  • I'll try to clarify. So I have the 'library.bib' file because i created it using mendeley but when I compile my example.tex file it generates a example-blx.bib file everytime. I'm not sure what run 'biber' means. I just use TexMaker software and run 'Compile' everytime. – Rebeca Nunes Marini May 17 '18 at 13:57
  • Are you getting a bbl file? Specifically, a file called \jobname.bbl, where \jobname is the name of your main tex file? – Mico May 17 '18 at 14:12
  • Yes I have a *.bbl file but it don't change in every compile run. I have my bibfile with the same name as the main tex file, is it important? – Rebeca Nunes Marini May 17 '18 at 14:19
  • Well, is what shows up in the pdf file correct? – Mico May 17 '18 at 14:21
  • 1
    Use backend=biber (as you already do) and make sure you actually run Biber https://tex.stackexchange.com/q/154751/35864. If example-blx.bib is generated in each run you are running Biber and not BibTeX. If you run Biber you should either get a properly typeset bibliography or you should find errors and warnings in the .blg file. In the latter case, please share the .blg with us. Remember to delete all temporary files first (.aux, .bbl, .bcf, ...), then do a full compilation run (pdfLaTeX, Biber, pdfLaTeX, pdfLaTeX) and then check the output and log files. – moewe May 17 '18 at 14:25
  • Thank you so much! It worked really well!

    edit: thank you for the edits, I wasn't understanding how you guys did that haha

    – Rebeca Nunes Marini May 17 '18 at 14:46
  • Good, I have voted to close your question as a duplicate of https://tex.stackexchange.com/q/154751/35864. Hope you are OK with that. – moewe May 17 '18 at 15:05

1 Answers1

0

I have used one of my reference file in the following code, and it compiles:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}

\begin{document}

\nocite{*}
\bibliographystyle{plain}
some text bla bla bla

\bibliography{library}
\end{document}

The command \nocite{*} is used to print the entire bibliography, then you need to run pdfLaTeX + BibTeX + pdfLaTeX + pdfLaTeX.

It should work fine.

A variant with the package biblatex is the following:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=bibtex, natbib=true]{biblatex}

\bibliography{library}

\begin{document}

\nocite{*}

some text bla bla bla

\printbibliography[heading=bibintoc]
\end{document}

Ps: i) The bibliography does not print if no command \cite{.} are found, hence the \nocite{*} instruction.

ii) If you do not have the bibliography style authoryear, bibTeX will complain and say "couldn't open style file authoryear.bst " and the bibliography won't show up...

Hope that helps.

Romain

RockyRock
  • 1,221
  • 2
    Are you sure this answer works with the OP's biblatex-based workflow? – Mico May 17 '18 at 14:14
  • 1
    Actually as \moewe pointed out, I was compiling using biblatex instead of biber. As soon I compiled with biber, the bibliography was printed. But thank you very much for your reply, I could gather other info I didn't knew. – Rebeca Nunes Marini May 17 '18 at 14:49