0

I am using an online tutorial to learn how to cite paper. And the code in main.tex is:

\documentclass[letterpaper,10pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\usepackage{biblatex} %Imports biblatex package
\addbibresource{sample.bib} %Import the bibliography file

\begin{document}
Let's cite! The Einstein's journal paper \cite{einstein} and the Dirac's book \cite{dirac} are physics related items. 

 \printbibliography %Prints bibliography

 \end{document}

The code in sample.bib is:

@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",
  keywords =     "physics"
}

@book{dirac,
  title={The Principles of Quantum Mechanics},
  author={Paul Adrien Maurice Dirac},
  isbn={9780198520115},
  series={International series of monographs on physics},
  year={1981},
  publisher={Clarendon Press},
  keywords = {physics}
}

The result is:

enter image description here

But there are many errors as following. I don't know how to solve this question.

enter image description here

chrisma
  • 1,239
  • 1
    Welcome to TeX.SE! Please provide us with a compilable code, i.e. a document that starts with \documentclass and ends with \end{document}. –  Dec 22 '18 at 04:03
  • Please provide a MWEB (minimal working example with bibliography). –  Dec 22 '18 at 05:12
  • 3
    For me your example works fine. Did you run pdflatex, biber, pdflatex, pdflatex? – Henri Menke Dec 22 '18 at 05:44
  • I did as you said. But there still are error. I plan to reintall the MikTex – Guo Ray Dec 22 '18 at 06:04
  • https://en.m.wikibooks.org/wiki/LaTeX/Bibliographies_with_biblatex_and_biber – Johannes_B Dec 22 '18 at 07:10
  • 1
    Delete all temporary and auxiliary files (.aux, .bcf, .bbl, ...). Make sure that sample.bib is in the same directory as your main .tex document and ensure that it contains the citations you expect it to contain. You will have to run LaTeX, Biber, LaTeX, LaTeX on your file ('LaTeX' can be replaced by your favourite flavour of LaTeX: pdfLaTeX, XeLaTeX, LuaLaTeX, ...). Most editors run BibTeX instead of Biber, see https://tex.stackexchange.com/q/154751/35864 for how to change that. (See https://tex.stackexchange.com/q/63852/35864 for why you run Biber in the first place). – moewe Dec 22 '18 at 07:12
  • When you have run Biber you should get a .blg file (on Windows machines the file will be recognised as 'performance monitor file' but it is just a text file that you can open with your favourite text editor). That file should contain information about what went wrong, post its contents here in full. Then check out the .log file and search for errors or warnings, post them here as well. – moewe Dec 22 '18 at 07:17
  • 3
    @moewe I guess the OP did not run biber. As Overleaf does it for you, there is no point in mentioning the use to the reader. – Johannes_B Dec 22 '18 at 07:52
  • It seems you downloaded the example but not the .bib file, is that it? –  Dec 22 '18 at 20:12
  • 1
    Can you show us the console output when you run biber? – samcarter_is_at_topanswers.xyz Dec 22 '18 at 20:14
  • 1
    Any news here? At the moment our best guess is that you either failed to run Biber or that Biber encountered an error and did not complete its run properly. Please check out https://tex.stackexchange.com/q/63852/35864, https://tex.stackexchange.com/q/154751/35864 and https://tex.stackexchange.com/q/286706/35864. – moewe Dec 24 '18 at 22:42
  • Any news here? Unfortunately, there are not enough details in the question to say with absolute certainty, but from what I can see so far you probably failed to run Biber. If there are no news here soon I will vote to close this question as a duplicate of the standard question (https://tex.stackexchange.com/q/63852/35864) for this issue as that will be most helpful for other users. – moewe Dec 30 '18 at 15:51
  • I voted to close the question as duplicate of the standard 'you have to run BibTeX/Biber' question because all evidence points towards the OP having not run Biber. There was no response to requests for clarification and the OP has not been seen since they asked the question ten days ago. – moewe Jan 02 '19 at 13:00

0 Answers0