[英]Biblatex in Overleaf does not show citations nor bibliography
I am working with biblatex in overleaf and here is a minimal (not) working version of what I do:我在背面使用 biblatex,这是我所做工作的最小(非)工作版本:
\documentclass[12pt,a4paper]{report}
\usepackage{verbatim}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{import}
\usepackage{inputenc}
%bibliography stuff
\usepackage[
backend=biber,
style=authoryear,
%style=nature,
sorting=nyt
]{biblatex}
%\usepackage{biblatex}
\addbibresource{thesisbibliography.bib}
%\bibliography{thesisbibliography}
%\bibliographystyle{ieeetr}
\begin{document}
\pagenumbering{Roman}
\parindent=0pt
\tableofcontents %{\protect\newpage}
\pagenumbering{arabic}
\chapter{Astro Basics}
Cool stuff was found by Johannes Kepler \citep{Kepler} \cite{KeplerCopernic}, and Isaac Newton \cite{Newton1687}, in the 16th century. \\
...
\newpage
%\begin{thebibliography}{x}
%\bibliography{bibliography}
%\addcontentsline{toc}{chapter}{References}
\printbibliography[
heading=bibintoc,
title={References}
]
%\bibliography{thesisbibliography}
%\bibliographystyle{ieeetr}
%\end{normalsize}
\end{document}
And this is the bib file:这是围兜文件:
@Book{Kepler,
author = "Johannes {Kepler} and Tycho {Brahe} and {Rudolph II}",
title = "{Astronomia nova aitiologetos}",
%publisher = "",
year = "1609",
%volume = "",
%number = "",
%series = "",
%address = "",
%edition = "",
%month = "",
%note = "",
%annote = ""
doi ={10.5479/sil.126675.39088002685477}
}
@Book{KeplerCopernic,
author = "Johannes {Kepler}",
title = "{Epitome Astronomiae Copernicanae}",
%publisher = "",
year = "1618-1621",
%volume = "",
%number = "",
%series = "",
%address = "",
%edition = "",
%month = "",
%note = "",
%annote = ""
}
@Book{Newton1687,
author = "Isaac Newton",
title = "Philosophiae Naturalis Principia Mathematica.",
publisher = "Londini, Jussu Societatis Regiæ ac Typis Josephi Streater. Prostat apud plures Bibliopolas.",
year = "1687",
note = "Retrieved from the Library of Congress \url{https://www.loc.gov/item/28020872/}"
}
What I get in the text as a citation is my keyword, not the actual citation style (no matter what style I choose).我在文本中作为引文得到的是我的关键词,而不是实际的引文风格(无论我选择什么风格)。 Also, the bibliography is not printed in the end and does not even appear in the table of context nor just as a title of the section in the text.
此外,参考书目并没有在最后打印出来,甚至没有出现在上下文表中,也没有仅仅作为文本中该部分的标题。 So I am obviously doing something wrong.
所以我显然做错了什么。
I do not get error messages, I can produce a pdf file.我没有收到错误消息,我可以生成一个 pdf 文件。 There are warnings like "citation... is undefined" or "empty bibliography input" which did not help me understand how to solve it yet.
有诸如“引文...未定义”或“空参考书目输入”之类的警告,这并没有帮助我理解如何解决它。
I already searched for solutions a lot and tried out the examples of others, but could not find a solution.我已经搜索了很多解决方案并尝试了其他人的示例,但找不到解决方案。 I could imagine that the issue is something very basic that I can not think of and is so basic that is not written anywhere, but maybe I am wrong and it is a more complex issue.
我可以想象这个问题是一些我想不到的非常基础的东西,而且非常基础以至于没有写在任何地方,但也许我错了,这是一个更复杂的问题。 In any way I would be deeply grateful for any ideas and hints that could help me fixing the issue.
无论如何,我将非常感谢任何可以帮助我解决问题的想法和提示。 Thank you in advance!
先感谢您!
\citep
is not a native biblatex
macro. \citep
不是原生的biblatex
宏。 If you want to use it, you need to use the natbib
package option when loading the biblatex
package:如果你想使用它,你需要在加载
biblatex
包时使用natbib
包选项:
\documentclass[12pt,a4paper]{report}
\usepackage{verbatim}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{import}
\usepackage{inputenc}
%bibliography stuff
\usepackage[
backend=biber,
style=authoryear,
%style=nature,
sorting=nyt,
natbib
]{biblatex}
%\usepackage{biblatex}
\begin{filecontents*}[overwrite]{\jobname.bib}
@Book{Kepler,
author = "Johannes {Kepler} and Tycho {Brahe} and {Rudolph II}",
title = "{Astronomia nova aitiologetos}",
%publisher = "",
year = "1609",
%volume = "",
%number = "",
%series = "",
%address = "",
%edition = "",
%month = "",
%note = "",
%annote = ""
doi ={10.5479/sil.126675.39088002685477}
}
@Book{KeplerCopernic,
author = "Johannes {Kepler}",
title = "{Epitome Astronomiae Copernicanae}",
%publisher = "",
year = "1618-1621",
%volume = "",
%number = "",
%series = "",
%address = "",
%edition = "",
%month = "",
%note = "",
%annote = ""
}
@Book{Newton1687,
author = "Isaac Newton",
title = "Philosophiae Naturalis Principia Mathematica.",
publisher = "Londini, Jussu Societatis Regiæ ac Typis Josephi Streater. Prostat apud plures Bibliopolas.",
year = "1687",
note = "Retrieved from the Library of Congress \url{https://www.loc.gov/item/28020872/}"
}
\end{filecontents*}
\addbibresource{\jobname.bib}
%\bibliography{thesisbibliography}
%\bibliographystyle{ieeetr}
\begin{document}
\pagenumbering{Roman}
\parindent=0pt
\tableofcontents %{\protect\newpage}
\pagenumbering{arabic}
\chapter{Astro Basics}
Cool stuff was found by Johannes Kepler \citep{Kepler} \cite{KeplerCopernic}, and Isaac Newton \cite{Newton1687}, in the 16th century. \\
...
\newpage
%\begin{thebibliography}{x}
%\bibliography{bibliography}
%\addcontentsline{toc}{chapter}{References}
\printbibliography[
heading=bibintoc,
title={References}
]
%\bibliography{thesisbibliography}
%\bibliographystyle{ieeetr}
%\end{normalsize}
\end{document}
As an update on how I solved the issue: The minimal example was working with the given answers, but the actual file did not.作为我如何解决这个问题的更新:最小的例子是使用给定的答案,但实际文件没有。 As I could not solve it even after much more time and research, I gave up and used a totally different template instead, where the bibliography works.
由于即使经过更多的时间和研究我也无法解决它,我放弃了并使用了一个完全不同的模板,参考书目在那里工作。 So maybe this is another (although less satisfying) solution that might work for other people with similar issues as well.
因此,也许这是另一个(虽然不太令人满意)解决方案,也可能适用于其他有类似问题的人。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.