Overleaf 上的 MastersDoctoralThesis 的默认 example.bib 无法编译

Overleaf 上的 MastersDoctoralThesis 的默认 example.bib 无法编译

以下 TeX 代码表示

LaTeX 警告:输入行 298 上的参考书目为空。

\documentclass[
    11pt, % The default document font size, options: 10pt, 11pt, 12pt
       ]{MastersDoctoralThesis} % The class file specifying the document structure

    \usepackage[utf8]{inputenc} % Required for inputting international characters
    \usepackage[T1]{fontenc} % Output font encoding for international characters

    \usepackage{palatino} % Use the Palatino font by default

    \usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex} % Use the bibtex backend with the authoryear citation style (which resembles APA)

    \addbibresource{example.bib} % The filename of the bibliography

    \usepackage[autostyle=true]{csquotes} % Required to generate language-dependent quotes in the bibliography

    \printbibliography[heading=bibintoc]
    \end{document} 

.bib我试图编译的自己的和Overleaf 上的 MastersDoctoralThesis都不起作用example.bib。以下是默认的:

  @article{Reference1,
    Abstract = {We have developed an enhanced Littrow configuration extended cavity diode laser (ECDL) that can be tuned without changing the direction of the output beam. The output of a conventional Littrow ECDL is reflected from a plane mirror fixed parallel to the tuning diffraction grating. Using a free-space Michelson wavemeter to measure the laser wavelength, we can tune the laser over a range greater than 10 nm without any alteration of alignment.},
    Author = {C. J. Hawthorn and K. P. Weber and R. E. Scholten},
    Journal = {Review of Scientific Instruments},
    Month = {12},
    Number = {12},
    Numpages = {3},
    Pages = {4477--4479},
    Title = {Littrow Configuration Tunable External Cavity Diode Laser with Fixed Direction Output Beam},
    Volume = {72},
    Url = {http://link.aip.org/link/?RSI/72/4477/1},
    Year = {2001}}

@article{Reference3,
    Abstract = {Operating a laser diode in an extended cavity which provides frequency-selective feedback is a very effective method of reducing the laser's linewidth and improving its tunability. We have developed an extremely simple laser of this type, built from inexpensive commercial components with only a few minor modifications. A 780~nm laser built to this design has an output power of 80~mW, a linewidth of 350~kHz, and it has been continuously locked to a Doppler-free rubidium transition for several days.},
    Author = {A. S. Arnold and J. S. Wilson and M. G. Boshier and J. Smith},
    Journal = {Review of Scientific Instruments},
    Month = {3},
    Number = {3},
    Numpages = {4},
    Pages = {1236--1239},
    Title = {A Simple Extended-Cavity Diode Laser},
    Volume = {69},
    Url = {http://link.aip.org/link/?RSI/69/1236/1},
    Year = {1998}}

@article{Reference2,
    Abstract = {We present a review of the use of diode lasers in atomic physics with an extensive list of references. We discuss the relevant characteristics of diode lasers and explain how to purchase and use them. We also review the various techniques that have been used to control and narrow the spectral outputs of diode lasers. Finally we present a number of examples illustrating the use of diode lasers in atomic physics experiments. Review of Scientific Instruments is copyrighted by The American Institute of Physics.},
    Author = {Carl E. Wieman and Leo Hollberg},
    Journal = {Review of Scientific Instruments},
    Keywords = {Diode Laser},
    Month = {1},
    Number = {1},
    Numpages = {20},
    Pages = {1--20},
    Title = {Using Diode Lasers for Atomic Physics},
    Volume = {62},
    Url = {http://link.aip.org/link/?RSI/62/1/1},
    Year = {1991}}

如果你们能帮忙的话就太好了!

答案1

嗯,你的代码有一些错误,例如缺少\begin{document}...

我改变了所用软件包的顺序,重要的更改我用<=====

请参阅(并研究)以下 MWE(包filecontents用于在一个 MWE 中包含 bib 文件和 TeX 文件):

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Reference1,
  Abstract = {We have developed an enhanced Littrow configuration extended cavity diode laser (ECDL) that can be tuned without changing the direction of the output beam. The output of a conventional Littrow ECDL is reflected from a plane mirror fixed parallel to the tuning diffraction grating. Using a free-space Michelson wavemeter to measure the laser wavelength, we can tune the laser over a range greater than 10 nm without any alteration of alignment.},
  Author = {C. J. Hawthorn and K. P. Weber and R. E. Scholten},
  Journal = {Review of Scientific Instruments},
  Month = {12},
  Number = {12},
  Numpages = {3},
  Pages = {4477--4479},
  Title = {Littrow Configuration Tunable External Cavity Diode Laser with Fixed Direction Output Beam},
  Volume = {72},
  Url = {http://link.aip.org/link/?RSI/72/4477/1},
  Year = {2001},
}
@article{Reference3,
    Abstract = {Operating a laser diode in an extended cavity which provides frequency-selective feedback is a very effective method of reducing the laser's linewidth and improving its tunability. We have developed an extremely simple laser of this type, built from inexpensive commercial components with only a few minor modifications. A 780~nm laser built to this design has an output power of 80~mW, a linewidth of 350~kHz, and it has been continuously locked to a Doppler-free rubidium transition for several days.},
    Author = {A. S. Arnold and J. S. Wilson and M. G. Boshier and J. Smith},
    Journal = {Review of Scientific Instruments},
    Month = {3},
    Number = {3},
    Numpages = {4},
    Pages = {1236--1239},
    Title = {A Simple Extended-Cavity Diode Laser},
    Volume = {69},
    Url = {http://link.aip.org/link/?RSI/69/1236/1},
    Year = {1998},
}
@article{Reference2,
    Abstract = {We present a review of the use of diode lasers in atomic physics with an extensive list of references. We discuss the relevant characteristics of diode lasers and explain how to purchase and use them. We also review the various techniques that have been used to control and narrow the spectral outputs of diode lasers. Finally we present a number of examples illustrating the use of diode lasers in atomic physics experiments. Review of Scientific Instruments is copyrighted by The American Institute of Physics.},
    Author = {Carl E. Wieman and Leo Hollberg},
    Journal = {Review of Scientific Instruments},
    Keywords = {Diode Laser},
    Month = {1},
    Number = {1},
    Numpages = {20},
    Pages = {1--20},
    Title = {Using Diode Lasers for Atomic Physics},
    Volume = {62},
    Url = {http://link.aip.org/link/?RSI/62/1/1},
    Year = {1991},
}
\end{filecontents}


\documentclass[%
  11pt,
  english % <================ language =================================
]{MastersDoctoralThesis} % MastersDoctoralThesis

\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters

\usepackage{palatino} % Use the Palatino font by default

\usepackage[autostyle=true]{csquotes} 
\usepackage[%
  backend=bibtex,
  style=authoryear,
  natbib=true
]{biblatex} 
\addbibresource{\jobname.bib} % The filename of the bibliography

\begin{document} % <====================================================
text \cite{Reference2} text % <=========================================

\nocite{*}
\printbibliography[heading=bibintoc]
\end{document}

结果:

在此处输入图片描述

相关内容