参考书目无法汇编或出现在目录中

参考书目无法汇编或出现在目录中

所以我知道以前有人问过这样的问题,但似乎都没有帮助我。我正在用一堆输入文档编写一篇论文,文档如下所示:

\documentclass[12pt,letterpaper,twoside,titlepage,final]{report}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage[margin=1.0in]{geometry}
\usepackage{setspace}
\usepackage{graphicx}
\graphicspath{{C:/LatexStuff/MScThesis/ThesisFinalBuild/}}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage[backend=bibtex, style=alphabetic]{biblatex}
\usepackage[notref,color]{showkeys}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{caption}
\usepackage{mathtools}
\usepackage{physics}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{abstract}
\usepackage{indentfirst}
\allowdisplaybreaks
\numberwithin{equation}{section}
\raggedbottom
\doublespacing

\renewcommand{\contentsname}{Table of Contents}

\definecolor{refkey}{gray}{.2}
\definecolor{labelkey}{gray}{.2}
\usepackage{cite}
\usepackage{setspace}
\usepackage{filecontents}

\begin{document}

\pagenumbering{roman}

%\input{Stuff}

\setcounter{page}{4}

\tableofcontents

\listoffigures

\newpage
\pagenumbering{arabic}

\allowdisplaybreaks
\interfootnotelinepenalty=10000

\chapter{1}
in the paper \cite{Dirac}....
\chapter{2}

\appendix

\renewcommand\bibname{References} % uses h-physrev style
\bibliographystyle{h-physrev}
\bibliography{References}
\printbibliography[heading=bibintoc]

\end{document}

我的参考文献文档是一个.bib文件。我使用 TexMaker 和 PDFLatex、BibLatex、PDFLatex*2、View pdf、快速构建配置。该文档已编译,但未在目录或实际文档中包含参考书目。该文档是其他人提供的模板,对他们有用,但显然对我来说没用。

我使用的参考资料是

@article {Dirac,
author = "Dirac, P. A. M."
title = {Classical theory of radiating electrons},
volume = {167},
number = {929},
pages = {148--169},
year = {1938},
doi = {10.1098/rspa.1938.0124},
publisher = {The Royal Society},
issn = {0080-4630},
URL = {http://rspa.royalsocietypublishing.org/content/167/929/148},
eprint = {http://rspa.royalsocietypublishing.org/content/167/929/148.full.pdf},
journal = {Proceedings of the Royal Society of London A: Mathematical, Physical and Engineering Sciences}
}

答案1

您给出的代码存在几个问题。

  1. 在您给定的 bib 条目中,字段后缺少一个逗号authorauthor = {Dirac, P. A. M.},
  2. 您不能使用包citebiblatex
  3. 您不能使用\bibliographystyle{h-physrev}样式biblatex
  4. hyperref在你的情况下应该最后调用(请阅读文档hyperref:在你的终端中输入texdoc hyperref并按回车键)

我决定使用biblatex以下 MWE,编译时不会出现错误:

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{goossens,
  author    = {Goossens, Michel and Mittelbach, Frank and 
               Samarin, Alexander},
  title     = {The LaTeX Companion},
  edition   = {1},
  publisher = {Addison-Wesley},
  location  = {Reading, Mass.},
  year      = {1994},
}
@Book{adams,
  title     = {The Restaurant at the End of the Universe},
  author    = {Douglas Adams},
  series    = {The Hitchhiker's Guide to the Galaxy},
  publisher = {Pan Macmillan},
  year      = {1980},
}
@article{einstein,
  author  = {Albert Einstein},
  title   = {{Zur Elektrodynamik bewegter Kö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},
}
@article {Dirac,
  author = {Dirac, P. A. M.},
  title = {Classical theory of radiating electrons},
  volume = {167},
  number = {929},
  pages = {148--169},
  year = {1938},
  doi = {10.1098/rspa.1938.0124},
  publisher = {The Royal Society},
  issn = {0080-4630},
  URL = {http://rspa.royalsocietypublishing.org/content/167/929/148},
  eprint = {http://rspa.royalsocietypublishing.org/content/167/929/148.full.pdf},
  journal = {Proceedings of the Royal Society of London A: Mathematical, Physical and Engineering Sciences}
}
\end{filecontents}


\documentclass[12pt,letterpaper,twoside,titlepage,final]{report}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{times}
\usepackage[margin=1.0in]{geometry}
\usepackage{setspace}
\usepackage{graphicx}
\graphicspath{{C:/LatexStuff/MScThesis/ThesisFinalBuild/}}
\usepackage{xcolor}

\usepackage[backend=bibtex, style=alphabetic]{biblatex}
%\bibliographystyle{h-physrev} % not with biblatex!
\addbibresource{\jobname} % <===========================================

\usepackage[notref,color]{showkeys}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{caption}
\usepackage{mathtools}
\usepackage{physics}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{abstract}
\usepackage{indentfirst}
\allowdisplaybreaks
\numberwithin{equation}{section}
\raggedbottom
\doublespacing

\renewcommand{\contentsname}{Table of Contents}


\definecolor{refkey}{gray}{.2}
\definecolor{labelkey}{gray}{.2}
%\usepackage{cite} % <==================================================

\usepackage{blindtext}
\usepackage{hyperref} % <===============================================


\begin{document}

\pagenumbering{roman}

\setcounter{page}{4}

\tableofcontents

\listoffigures

\newpage
\pagenumbering{arabic}


\allowdisplaybreaks
\interfootnotelinepenalty=10000

\Blindtext %\Blinddocument

\appendix

\nocite{*}
\renewcommand\bibname{References}

\printbibliography[heading=bibintoc]

\end{document}

生成以下 pdf 文件:

在此处输入图片描述

如果您必须使用参考书目样式,则不能使用biblatex

如果您需要使用样式,h-physrev请尝试以下 MWE:

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{goossens,
  author    = {Goossens, Michel and Mittelbach, Frank and 
               Samarin, Alexander},
  title     = {The LaTeX Companion},
  edition   = {1},
  publisher = {Addison-Wesley},
  location  = {Reading, Mass.},
  year      = {1994},
}
@Book{adams,
  title     = {The Restaurant at the End of the Universe},
  author    = {Douglas Adams},
  series    = {The Hitchhiker's Guide to the Galaxy},
  publisher = {Pan Macmillan},
  year      = {1980},
}
@article{einstein,
  author  = {Albert Einstein},
  title   = {{Zur Elektrodynamik bewegter Kö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},
}
@article {Dirac,
  author = {Dirac, P. A. M.},
  title = {Classical theory of radiating electrons},
  volume = {167},
  number = {929},
  pages = {148--169},
  year = {1938},
  doi = {10.1098/rspa.1938.0124},
  publisher = {The Royal Society},
  issn = {0080-4630},
  URL = {http://rspa.royalsocietypublishing.org/content/167/929/148},
  eprint = {http://rspa.royalsocietypublishing.org/content/167/929/148.full.pdf},
  journal = {Proceedings of the Royal Society of London A: Mathematical, Physical and Engineering Sciences}
}
\end{filecontents}


\documentclass[12pt,letterpaper,twoside,titlepage,final]{report}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{times}
\usepackage[margin=1.0in]{geometry}
\usepackage{setspace}
\usepackage{graphicx}
\graphicspath{{C:/LatexStuff/MScThesis/ThesisFinalBuild/}}
\usepackage{xcolor}

\usepackage[notref,color]{showkeys}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{caption}
\usepackage{mathtools}
\usepackage{physics}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{abstract}
\usepackage{indentfirst}
\allowdisplaybreaks
\numberwithin{equation}{section}
\raggedbottom
\doublespacing

\renewcommand{\contentsname}{Table of Contents}


\definecolor{refkey}{gray}{.2}
\definecolor{labelkey}{gray}{.2}
%\usepackage{cite} % <==================================================

\usepackage{blindtext}
\usepackage{hyperref} % <===============================================


\begin{document}

\pagenumbering{roman}

\setcounter{page}{4}

\tableofcontents

\listoffigures

\newpage
\pagenumbering{arabic}


\allowdisplaybreaks
\interfootnotelinepenalty=10000

\Blindtext %\Blinddocument

\appendix

\nocite{*}
\renewcommand\bibname{References}

\bibliographystyle{h-physrev} % <==========================
\bibliography{\jobname} % <================================

\end{document}

相关内容