.bib 文件顶层的一个字符被视为垃圾字符

.bib 文件顶层的一个字符被视为垃圾字符

我已经搜索了一个星期,想找到解决 .bib 文件中错误的办法,但就是解决不了。我使用 .bib 文件来记录参考文献,除了第一个之外,每个参考文献都有警告:“一个字符在顶层被视为垃圾字符”。我尝试寻找不可见的字符,并尝试重写和重新排列,但似乎都不起作用。希望你们中的一些人能对此有所启发

这里有 3 个条目,第一个被接受,下面的所有内容都有警告。警告仅显示在条目的第一行:

     @misc{georg,
    title={Institutioner},
    url={http://www.ecomacundervisning.dk/institutioner-2/},
    journal={Økologisk Økonomi}, 
    publisher={Aalborg universitet},
    author={Georg, Susse}
    },
    @book{Vatn,
    title = {Environmental governance: Institutions, policies and actions},
    year = {2016},
    author = {Vatn, Arild},
    pages = {86–92},
    publisher ={Edward Elgar Publishing.}
    },
    @article{Scott,
    author = {Scott, W.},
    year = {2005},
    month = {01},
    title = {Institutional Theory: Contributing to a Theoretical Research Program}
    },

以下是我的序言:

\documentclass[a4paper]{article}
\setlength\headheight{22.660004pt}
\usepackage[table,hyperref,dvipsnames, breaklinks]{xcolor}
\usepackage{incgraph,tikz}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{csquotes}
\usepackage{colortbl}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{tabularx}
\usepackage{adjustbox}
\usepackage{enumitem}
\usepackage{lastpage}
\usepackage[dvipsnames]{xcolor}
\usepackage{verbatim}
\usepackage{pdfpages}
\usepackage{afterpage}
\usepackage{biblatex}
\addbibresource{references.bib}

答案1

在结束条目的花括号后面不需要逗号。

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=authoryear]{biblatex}

\begin{filecontents}{\jobname.bib}
@misc{georg,
  title     = {Institutioner},
  url       = {http://www.ecomacundervisning.dk/institutioner-2/},
  journal   = {Økologisk Økonomi}, 
  publisher = {Aalborg universitet},
  author    = {Georg, Susse},
}
@book{Vatn,
  title     = {Environmental governance: Institutions, policies and actions},
  year      = {2016},
  author    = {Vatn, Arild},
  pages     = {86–92},
  publisher = {Edward Elgar Publishing},
}
@article{Scott,
  author = {Scott, W.},
  year   = {2005},
  month  = {01},
  title  = {Institutional Theory: Contributing to a Theoretical Research Program},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}

\printbibliography
\end{document}

条目之外的每个(未注释的)字符(即 之外的@<type>{...})都被标记为潜在的垃圾字符,并且因为逗号位于解释警告的条目之外。

相关内容