未定義的引用

未定義的引用

我正在做我的第一個參考書目,現在一個小時內我遇到了錯誤。 .tex 檔:

\documentclass[francais,10pt,twosides,a4paper]{report}

\usepackage[francais,polutonikogreek]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{url}
\usepackage{textgreek}

\begin{document}
\begin{quotation}
 notre âme. \cite{ref1}
 \end{quotation}
 \end{document}

還有圍兜:

@book
{ref1,
  title = {Manuel d’Épictète}
  author = {Arrien}
  publisher = {Wikisource \url{https://fr.wikisource.org/wiki/Manuel_d>%E2%80>>%99%C3%89pict%C3%A8te_(trad._Thurot)#I._Distinction_entre_ce_qui_d.C3.A9pend_de_nous_et_ce_
 qui_ne_d.C3.A9pend_pas_de_nous}},
  note = {Traduit par Jean-François Thurot} 
  year = {1889}
}

你能幫我解決這個問題嗎?謝謝。

答案1

您的程式碼中有幾個錯誤。

  1. LaTeX 需要一個命令來根據您引用的書籍、文章等知道應該在哪裡列印參考書目。
  2. 您的 bib 檔案有一些錯誤。我在下面的 MWE 中更正了它們(請參閱新增的逗號和 field 的用法url)。
  3. 您正在使用編碼 utf-8。這就是我使用套件biblatex和程式biber來創建參考書目的原因,因為 biber 可以處理 utf-8,bibtex但不能。

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},
}
@book{ref1,
  title     = {Manuel d’Épictète},
  author    = {Arrien},
  publisher = {Wikisource},
  url       = {https://fr.wikisource.org/wiki/Manuel_d>%E2%80>>%99%C3%89pict%C3%A8te_(trad._Thurot)#I._Distinction_entre_ce_qui_d.C3.A9pend_de_nous_et_ce_
 qui_ne_d.C3.A9pend_pas_de_nous},
  note      = {Traduit par Jean-François Thurot}, 
  year      = {1889},
}
\end{filecontents*}


\documentclass[francais,10pt,twosides,a4paper]{report}

\usepackage[francais,polutonikogreek]{babel}

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

\usepackage{lmodern}
\usepackage[hyphens]{url} %  <==========================================
\usepackage{textgreek}

\usepackage[
  backend=biber, % bibtex  % bibtex or biber (prefered)
  natbib=true,
  style=numeric,
  sorting=none  % none, nty % no sorting or standard sorting
]{biblatex} %  <========================================================
\addbibresource{\jobname.bib} % calls bib file to create the bibliography

\begin{document}
We first cite Albert Einstein~\cite{einstein}, second~\cite{adams} and 
third the \LaTeX{} Companian~\cite{goossens}.

\begin{quotation}
 notre âme. \cite{ref1}
\end{quotation}

\printbibliography
\end{document}

以及由此產生的參考書目:

由此產生的參考書目

相關內容