2

I have searched for a week now for a solution to an error in my .bib file, and I simply cannot solve it. I'm using a .bib file for my references and every single reference, except the first one, has the warning: "one character seen as junk on top-level". I've tried to look for invisible characters and tried rewriting and rearranging but nothing seems to work. Hopefully, some of you can shed some light on this

Here are 3 entries, the first one is accepted, everything below has a warning. The warning shows on the first line of the entries only:

     @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}
    },

Here is my preamble:

\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}
2
  • @PhelypeOleinik Thank you so much, that was the simplest solution ever! yea I know its just a warning, I just hate them :D Nov 11, 2021 at 15:27
  • @LauraHandberg You're welcome! Sorry, I deleted my comment because moewe posted a nice answer soon after (he's fast!). Nov 11, 2021 at 15:31

1 Answer 1

4

You don't need the commas after the curly brace that closes the entry.

\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}

Every (uncommented) character outside of an entry (i.e. outside of the @<type>{...}) is flagged as a potential junk character, and because the comma is outside of the entry that explains the warning.

2
  • Thank you so much! I have had issues with the commas before so I never thought I could just delete them, but that solved it right away. Nov 11, 2021 at 15:29
  • You need commas after the field values within entries (the comma after the last field value is optional, but I generally recommend you include it). But there is no requirement for commas between entries.
    – moewe
    Nov 11, 2021 at 15:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .