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:
But there are many errors as following. I don't know how to solve this question.


\documentclassand ends with\end{document}. – Dec 22 '18 at 04:03pdflatex,biber,pdflatex,pdflatex? – Henri Menke Dec 22 '18 at 05:44.aux,.bcf,.bbl, ...). Make sure thatsample.bibis in the same directory as your main.texdocument 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.blgfile (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.logfile and search for errors or warnings, post them here as well. – moewe Dec 22 '18 at 07:17