Search code examples
latexpandocbibtexcslpandoc-citeproc

Error reading bibtex file using pandoc with cite-proc "unexpected '\''


i have written an article wit Latex and want to submit it to the publisher. Unfortunately, they only accept .odt or .docx files. Therefore, i wanted to convert my file with pandoc, as i've done it multiple times with other documents.

I used a bash script which produces the following command:

pandoc -s --toc article.tex --citeproc --bibliography=my_bib_file.bib --csl=../../csl_citations_styles/dai.csl -o article.odt

But the process is stopped with the following error-message:

Error reading bibliography file my_bib_file.bib:
(line 1495, column 1):
unexpected '\''

I opened the bib-file and removed the ', but afterwards the error changed to:

Error reading bibliography file my-bib-file.bib:
(line 1496, column 1):
unexpected '@'

which absolutely makes no sense, because the @ is the beginning of a bib-entry:

'
@Book{manzo_ancient_egypt_in_its_african_context,
  author     = {Manzo, Andrea},
  publisher  = {Cambridge University Press},
  title      = {Ancient Egypt in its African Context},
  year       = {2022},
}

I create the bib-file with JabRef. Thus, i don't look into the code very often. But i scanned the whole bib-file and an ' in a line over a following bib-entry appears very often.

Pandoc complained about it in line 1495, but the ' appears multiple times before.

Has anybody an idea

  1. Why those ' are appearing at all? (Couldnt find any answer for now).
  2. Why Pandoc/cite-proc shows an error in the middle of my bib-file, whereas the ' has already appeared multiple times.
  3. Most important: How to solve this problem. I really dont want to create the bibliography and the references on my own in the .odt file. Its not the shortest article...

EDIT:

Okay, it seems to be a problem with one specific entry and not the '. I deleted the the entry and now it works. But couldn't find any error in the entry itself, so still a mysterium, but not due to the apostrophe's...

Thanks for your support!


Solution

  • Ok, my bad. The error occured, because an DOI of an entry i just imported using the Jabref-Firefox-Addon had special characters, which bibtex couldn't deal with...

    Solved