1

I am new to LaTeX. All similar questions I have found so far could be resolved by using biblatex with biber. But this does not work for me.

I have an entry in my .bib file with utf-8 characters. It causes a compile error (everything works again when I remove the entry or only the entry's abstract).

This is what I have in my settings.tex

\usepackage[
backend=biber,
style=apa,
]{biblatex}
    \addbibresource{references.bib}

And in my main.txt I use

\printbibliography

I am working on overleaf with the XeLaTeX compiler.

This is the entry in my .bib file:

@techreport{Bybee_et_al_2020,
     title = "The Structure of Economic News",
     author = "Bybee, Leland and Kelly, Bryan T and Manela, Asaf and Xiu, Dacheng",
     institution = "National Bureau of Economic Research",
     type = "Working Paper",
     series = "Working Paper Series",
     number = "26648",
     year = "2020",
     month = "January",
     doi = {10.3386/w26648},
     URL = "http://www.nber.org/papers/w26648",
     abstract = {We propose an approach to measuring the state of the economy via textual analysis of business news. From the full text content of 800,000 Wall Street Journal articles for 1984\{2017, we estimate a topic model that summarizes business news as easily interpretable topical themes and quantifies the proportion of news attention allocated to each theme at each point in time. We then use our news attention estimates as inputs into statistical models of numerical economic time series. We demonstrate that these text-based inputs accurately track a wide range of economic activity measures and that they have incremental forecasting power for macroeconomic outcomes, above and beyond standard numerical predictors. Finally, we use our model to retrieve the news-based narratives that underly “shocks” in numerical economic data.},
}

The abstract does not contain any unescaped %s.

The error message (line 44 is where the next entry in my .bib file starts):

BibTeX subsystem: /tmp/biber_tmp_mXit/33e59b5ca9ec342068223d604c3f8d55_13.utf8, line 44, syntax error: found "@article", expected end of entry ("}" or ")") (skipping to next "@")
Tim
  • 13
  • 3
    biber should have no problem with utf-8, it is natively a Unicode processor, but as you have not shown any input and not shown any error message, it will be hard to help. Please edit your question to give some information – David Carlisle Jan 03 '23 at 11:31
  • 2
    do you perhaps have a % in the abstract? – Ulrike Fischer Jan 03 '23 at 11:42
  • It would be interesting to see if the error message comes from LaTeX (biblatex) or from Biber. If it comes from Biber, it is possible that the encoding is somehow not recognised correctly. If the error is on the LaTeX side of things, encoding could also be an issue, but it could also be the contents of your field (as Ulrike says, unescaped %s are often an issue). As David says, generally biblatex+Biber can deal just fine with UTF8, provided everything is set up correctly. – moewe Jan 03 '23 at 12:38
  • 1
    As David mentioned, please add the exact error message and the full problematic entry from the .bib file to your question, without that it is not really possible to suggest solutions. – Marijn Jan 03 '23 at 13:36
  • 1
    I'm afraid you will have to show us a real example of a problematic entry and not just the schematic structure (which looks fine, even if I find the mixture of "..." and {...} odd). – moewe Jan 03 '23 at 13:41
  • I edited my question. There are no unescaped %s. – Tim Jan 03 '23 at 13:42
  • 2
    You mention that the problem is in the abstract field of the entry, so it would help if you can show the contents of that field in full. – Marijn Jan 03 '23 at 13:46
  • 2
    The error says that there is a syntax error (it was expecting a " or }) somewhere above a @article element. Instead of deleting the actual data, why not simply post the actual bib data. – daleif Jan 03 '23 at 13:46
  • The @techreport is causing the error. Removing it or its abstract also removes the error. The @article mentioned in the error message is the next entry in the .bib file. – Tim Jan 03 '23 at 13:48
  • 2
    Then show the actual data, don't just delete the contents. You're basically wasting the time of the people attempting to help. – daleif Jan 03 '23 at 13:49
  • 1
    As I said above: Show us the bad entry in its entirety or shorten it so that it still reproduces the problem. If you shorten it so much that it no longer shows the problem (as is the case here), we can't help you. – moewe Jan 03 '23 at 13:50
  • Otherwise send us an overleaf link then we can clone the project and see for ourself. You can send it to me off the site at daleif@math.au.dk – daleif Jan 03 '23 at 13:52
  • I inserted the whole entry now. – Tim Jan 03 '23 at 13:53
  • 1
    so we finally see the issue is completely unrelated to utf-8 – David Carlisle Jan 03 '23 at 14:10

1 Answers1

5

Your abstract field contains 1984\{2017 leading to

abstract = {...1984\{2017...},

having unbalanced braces, which errors when Biber reads the file.

You probably want 1984--2017 here and no curly braces anyway.

If you are not going to show the abstract field in your document, you may want to consider exporting your .bib entries without that field. abstract fields often contain lots of text which sometimes is badly escaped and can lead to errors.

moewe
  • 175,683
  • Note that unbalanced curly braces like this break with both Biber and BibTeX. See also https://tex.stackexchange.com/q/230750/35864. If you really need to have unbalanced curly braces, you'll have to use one of the workarounds discussed there. – moewe Jan 03 '23 at 14:02
  • Okay this works. I didn't know that escaping braces doesn't work. Thank you! – Tim Jan 03 '23 at 21:49