我在文档开始之前\addbibresource{references.bib}
和文档结束之处\printbibliography
。
参考文献的格式如下:
@ARTICLE{2015MNRAS.452.1089P,
author = {{Porth}, O. and {Komissarov}, S.~S.},
title = "{Causality and stability of cosmic jets}",
journal = {\mnras},
archivePrefix = "arXiv",
eprint = {1408.3318},
primaryClass = "astro-ph.HE",
keywords = {instabilities, MHD, relativistic processes, stars: jets, galaxies: active, galaxies: jets},
year = 2015,
month = sep,
volume = 452,
pages = {1089-1104},
doi = {10.1093/mnras/stv1295},
adsurl = {http://adsabs.harvard.edu/abs/2015MNRAS.452.1089P},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
没有错误,但没有打印任何内容。
\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[english,greek]{babel}
\usepackage[a4paper,width=160mm,top=25mm,bottom=25mm,bindingoffset=6mm]
{geometry}
\usepackage{amsmath}
\usepackage{esint}
\usepackage[normalem]{ulem}
\usepackage{graphicx}
\usepackage{subcaption}
\graphicspath{{Images/}}
\usepackage{array}
\usepackage{wrapfig}
\usepackage{multirow}
\usepackage{tabu}
\usepackage{wrapfig}
\usepackage{hyperref}
\usepackage{fancyhdr}
\newcommand{\uvec}[1]{\boldsymbol{\hat{\textbf{#1}}}}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO,LE]{Αλληλεπίδραση αστροφυσικών πιδάκων πλάσματος με το περιβάλλον
τους}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[LO,CE]{Κεφάλαιο \thechapter}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\usepackage[style=authoryear,sorting=none]{biblatex}
\addbibresource{references.bib}
\title{Αλληλεπίδραση πιδάκων με το περιβάλλον τους}
\date{Oκτώβριος 2017}
\begin{document}
"
End: "
\nocite{*}
\printbibliography
\end{document}
答案1
为了结束这个问题,我创建了以下 MWE mwe.tex
,它可以无错误地进行编译(请参阅标有 的重要代码更改<=======
):
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@ARTICLE{2015MNRAS.452.1089P,
author = {{Porth}, O. and {Komissarov}, S.~S.},
title = "{Causality and stability of cosmic jets}",
journal = {\mnras},
archivePrefix = "arXiv",
eprint = {1408.3318},
primaryClass = "astro-ph.HE",
keywords = {instabilities, MHD, relativistic processes, stars: jets,
galaxies: active, galaxies: jets},
year = 2015,
month = sep,
volume = 452,
pages = {1089-1104},
doi = {10.1093/mnras/stv1295},
adsurl = {http://adsabs.harvard.edu/abs/2015MNRAS.452.1089P},
adsnote = {Provided by the SAO/NASA Astrophysics Data System},
}
\end{filecontents}
\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[english,greek]{babel}
\usepackage[%
a4paper,width=160mm,top=25mm,bottom=25mm,bindingoffset=6mm
]{geometry}
\usepackage{fancyhdr}
\usepackage{blindtext} % <========to write dummy text in document ======
\usepackage{csquotes}
\usepackage[style=authoryear,sorting=none]{biblatex}
\addbibresource{\jobname.bib} % <===== to use bib file created with filecontents
\usepackage{hyperref}
\newcommand{\uvec}[1]{\boldsymbol{\hat{\textbf{#1}}}}
\newcommand{\mnras}{Very Important Journal} % <=========================
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO,LE]{Αλληλεπίδραση αστροφυσικών πιδάκων πλάσματος με το περιβάλλον
τους}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[LO,CE]{Κεφάλαιο \thechapter}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\title{Αλληλεπίδραση πιδάκων με το περιβάλλον τους}
\date{Oκτώβριος 2017}
\begin{document}
\blindtext
\nocite{*} or \cite{2015MNRAS.452.1089P} % <============================
\printbibliography
\end{document}
因为你的 bib 文件中有一行,所以journal = {\mnras},
你需要\mnras
像我一样定义宏:
\newcommand{\mnras}{Very Important Journal}
或者直接删除你的 bib 文件中的宏...
要获取参考书目,您需要使用
\nocite{*} or \cite{2015MNRAS.452.1089P}
\nocite{*}
印刷全部您的参考书目中没有引用 bib 条目,\cite{key}
您可以在文档中引用 bib 条目key
。您至少需要一个或多个\cite
或\nocites{*}
才能打印参考书目!
给定的 MWE 产生以下参考书目(第 2 页):
如果您无法让编辑器使用 biber,请改用终端/控制台。在终端中输入 4 条命令:
pdflatex mwe.tex
biber mwe.aux
pdflatex mwe.tex
pdflatex mwe.tex