我对 latex 还比较陌生,我正在尝试编写一个测试书目。我正在浏览 biblatex 上的 sharelatex 部分(https://www.sharelatex.com/learn/Bibliography_management_with_biblatex) 并运行其示例代码。但是,我没有显示几行带有引文的文本,然后显示参考文献列表,而是只显示带有引文的文本。参考文献列表根本没有显示。
我正在使用 TexStudio,如果这意味着什么的话。
有问题的代码如下:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{biblatex}
\addbibresource{sample.bib}
\begin{document}
Let's cite! The Einstein's journal paper \cite{einstein} and the Dirac's
book \cite{dirac} are physics related items.
\printbibliography
\end{document}
并且 sample.bib 包含:
@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}
}
@online{knuthwebsite,
author = "Donald Knuth",
title = "Knuth: Computers and Typesetting",
url = "http://www-cs-faculty.stanford.edu/~uno/abcde.html",
keywords = "latex,knuth"
}
@inbook{knuth-fa,
author = "Donald E. Knuth",
title = "Fundamental Algorithms",
publisher = "Addison-Wesley",
year = "1973",
chapter = "1.2",
keywords = "knuth,programming"
}
编辑:只是为了澄清,实际输出 预期输出
编辑2:
添加 biber 作为默认书目仍然会产生相同的输出,但也会给出以下消息:
Process started: biber.exe "test"
Use of uninitialized value $llabel in concatenation (.) or string at C:\Users\~\AppData\Local\Temp\par-5072696d617263682d4956\cache-6bef6bfac2f8155f13b160f6720d3dbe6a10b684\inc\lib/Biber.pm line 675.
Use of uninitialized value in string eq at C:\Users\~\AppData\Local\Temp\par-5072696d617263682d4956\cache-6bef6bfac2f8155f13b160f6720d3dbe6a10b684\inc\lib/Biber/SortLists.pm line 77.
INFO - This is Biber 1.8
INFO - Logfile is 'test.blg'
INFO - Reading 'test.bcf'
WARN - Warning: Found biblatex control file version 2.7, expected version 2.5
INFO - Found 2 citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'sample.bib' for section 0
INFO - Decoding LaTeX character macros into UTF-8
INFO - Found BibTeX data source 'sample.bib'
Process exited with error(s)
使用 bibtex 可以得到以下结果:
Process started: bibtex.exe "test"
This is BibTeX, Version 0.99d (MiKTeX 2.9)
The top-level auxiliary file: test.aux
I found no \citation commands---while reading file test.aux
I found no \bibdata command---while reading file test.aux
I found no \bibstyle command---while reading file test.aux
(There were 3 error messages)
答案1
更新软件包(我使用 MikTex 作为软件包管理器),然后按照说明删除缓存这里。编译、编译参考书目、重新编译和构建。感谢 Aubrey Blumsohn 和 moewe。