我正在做我的第一个参考书目,现在已经出现错误一个小时了。.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
您的代码中有几个错误。
- LaTeX 需要一个命令来根据您引用的书籍、文章等知道应该在哪里打印参考书目。
- 您的 bib 文件有一些错误。我在接下来的 MWE 中更正了它们(请参阅添加的逗号和字段的用法
url
)。 biblatex
您使用的编码是 utf-8。这就是我使用包和程序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}
以及由此得出的参考书目: