为了完成我的论文,我使用 TeXStudio,并尝试将参考书目包含到我的文档中。我使用 BibTeX 制作参考书目并将其保存在文件中.bib
,但似乎无法使其正常工作。当我使用时\usepackage{natbib}
,我收到一条错误消息,提示
! 包 natbib 错误:参考书目与作者年份引用不兼容。
无论我使用什么风格,它都保持朴素的风格...有人知道我做错了什么吗?
这是我的代码:
\documentclass[10pt,a4paper,final]{book}
%\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage[hidelinks]{hyperref}
\usepackage{natbib}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage{polyglossia}
\setmainlanguage{french}
\setotherlanguages{english,german,latin,italian,spanish,russian,greek}
\begin{document}
text
\section{Bibliographie}
\bibliographystyle{acm}
\bibliography{roumain}
\end{document}
我的书目示例:
@mvbook{SMFC,
author = {SMFC = Academia RPR, Institutul de lingvistica din Bucuresti},
title = {Institutul de lingvistica din Bucuresti, Studii \c{s}i materiale privitoare la formarea cuvintelor în limba român\u{a}},
date = {vol I, 1959 ; II, 1960 ; III, 1962 ; IV, 1967 ; V, 1969 ; VI, 1972},
editor = {Editura Academiei},
volumes = {6},
location = {Bucarest},
}
@inbook{Asan-PsaltHur,
author = {Asan, Finuţa},
title = {Derivarea cu sufixe şi prefixe în Psaltirea Hurmuzaki},
booktitle = {SMFC},
date = {1959},
bookauthor = {Academia RPR, Institutul de lingvistica din Bucuresti}, editor = {Editura Academiei},
location = {Bucarest},
volume = {1},
volumes = {6},
pages = {203-212}
}
@book{Popescu-Formarea,
author = {Popescu Marin, Magdalena (coord.)},
title = {Formarea cuvintelor în limba română din secolele al XVI lea – al XVIII lea},
date = {2007},
editor = {Editura Academiei},
location = {Bucarest},
}
答案1
嗯,在你的代码中我发现了一些问题。
例如,package 应该hyperref
是最后调用的包!您可以通过在控制台/终端上键入来阅读
包的文档。列出了您可以使用的样式以及支持哪些样式和字段名称。 natbib
texdoc natbib
natbib
为了给你一个起点,我改变了你的 MWE,删除了这个问题不需要的包调用,改变了包调用的顺序,并添加了字段year
和publisher
bib 文件中缺失的信息(顺便说一下,包filecontents
仅用于在一个可编译的 MWE 中拥有 bib 文件和 TeX 代码)。
梅威瑟:
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{SMFC,
author = {{SMFC = Academia RPR, Institutul de lingvistica din Bucuresti}},
title = {Institutul de lingvistica din Bucuresti, Studii \c{s}i
materiale privitoare la formarea cuvintelor în limba român\u{a}},
note = {vol I, 1959 ; II, 1960 ; III, 1962 ; IV, 1967 ; V, 1969 ; VI, 1972},
year = {1972},
editor = {Editura Academiei},
publisher = {UNKNOWN},
volumes = {6},
location = {Bucarest},
}
@inbook{Asan-PsaltHur,
author = {Asan, Finuţa},
title = {Derivarea cu sufixe şi prefixe în Psaltirea Hurmuzaki},
booktitle = {SMFC},
year = {1959},
bookauthor = {Academia RPR, Institutul de lingvistica din Bucuresti},
editor = {Editura Academiei},
publisher = {UNKNOWN},
location = {Bucarest},
volume = {1},
volumes = {6},
pages = {203--212},
}
@book{Popescu-Formarea,
author = {Popescu Marin, Magdalena (coord.)},
title = {Formarea cuvintelor în limba română din secolele al XVI lea – al XVIII lea},
year = {2007},
editor = {Editura Academiei},
publisher = {UNKNOWN},
location = {Bucarest},
}
\end{filecontents*}
\documentclass[10pt,a4paper,final]{book}
\usepackage{fontspec} % utf-8 encoding!
\setmainfont{Times New Roman}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{polyglossia}
\setmainlanguage{french}
\setotherlanguages{english,german,latin,italian,spanish,russian,greek}
\usepackage[numbers]{natbib}
\usepackage[hidelinks]{hyperref}
\begin{document}
text \cite{Asan-PsaltHur} \nocite{*}
\section{Bibliographie}
\bibliographystyle{abbrvnat} % plainnat abbrvnat
\bibliography{\jobname}
\end{document}
现在如果你编译的话,你将会收到如下三个警告:
如您所见,警告非常清楚(与您使用原始代码时收到的警告相同):您不能同时使用作者和编辑器。请重新编写您的 bib 文件。我还将您的未定义更改@mvbook
为@book
。
最后三点建议:
SMFC = Academia RPR, Institutul de lingvistica din Bucuresti
是作者的一个不寻常的条目,最好将首字母缩写放在文本中并使用完整名称。但据我所知,您的作者名字是一个机构。所以最好将其用作编辑...Studii \c{s}i
应该在已更改的 utf-8 编码文件中。请将所有 tex 替换的特殊字符(如 cedilie 等)更改为相应的原始 utf-8 字母。- 您需要一个
year
符合样式的字段,因此在您的第一个条目的情况下,SMFC
我将使用字段note={vol I, 1959 ; II, 1960 ; III, 1962 ; IV, 1967 ; V, 1969 ; VI, 1972},
而不是日期字段。