bibtex 中的参考文献未显示在主文件中

bibtex 中的参考文献未显示在主文件中

我有一个 references.bib 文件,其中包含我需要的参考文献,我正在使用以下命令:

\documentclass[a4paper]{article}
% this in the preamble
\begin{filecontents}{references.bib}
@online{knuthwebsite,
    author = "Donald Knuth",
    title = "Knuth: Computers and Typesetting",
    url  = "http://www-cs-faculty.stanford.edu/~uno/abcde.html",
    date = "2016-09-01",
    keywords = "latex,knuth"
}

@inbook{knuth-fa,
    author = "Donald E. Knuth",
    title = "Fundamental Algorithms",
    publisher = "Addison-Wesley",
    year = "1973",
    chapter = "1.2",
    keywords  = "knuth,programming"
}
\end{filecontents}
\usepackage[style=authoryear,sorting=none]{biblatex}
\addbibresource{references.bib}

\begin{document}
...
\nocite{*}
\bibstyle{numeric}
\printbibliography
\end{document}

代码运行没有错误,但没有显示引用。引用中的格式是正确的。出了什么问题?

答案1

需要在编译后删除\bibstyle{numeric}并运行,然后重新编译。可以找到biber如何设置的说明TeXmaker在这儿

\documentclass[a4paper]{article}
% this is the preamble
\usepackage[style=authoryear, sorting=ynt]{biblatex} % if you want numeric use [style=numeric, sorting=none].
\begin{filecontents}{references.bib}
@online{knuthwebsite,
    author = "Donald Knuth",
    title = "Knuth: Computers and Typesetting",
    url  = "http://www-cs-faculty.stanford.edu/~uno/abcde.html",
    date = "2016-09-01",
    keywords = "latex,knuth"
}

@inbook{knuth-fa,
    author = "Donald E. Knuth",
    title = "Fundamental Algorithms",
    publisher = "Addison-Wesley",
    year = "1973",
    chapter = "1.2",
    keywords  = "knuth,programming"
}
\end{filecontents}
\addbibresource{references.bib}

\begin{document}
...
\nocite{*}
\printbibliography
\end{document}

答案2

要使用bibtex您的文档,其结构应如下,例如假设您的参考文献在“references.bib”中:

\documentclass{article}
\usepackage{bibtex}

\begin{document}
\bibliographystyle{plain}

% Use \cite{...} as needed

\bibliography{references}
\end{document}

详细信息请访问BibTeX主页。

相关内容