2

This question is a secondary error I receive in TexMaker after running LaTex command to ensure I can run biber as well - link to the related question

! Argument of \OT1\' has an extra }.
<inserted text>
\par
l.118 \printbibliography[title=References]
I've run across a "`}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.
Runaway argument?
! Paragraph ended before \OT1\' was complete.
<to be read again>
\par
l.118 \printbibliography[title=References]
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

I am quite uncertain how exactly to fix this. Is the problem to do with the } in the .bib file which is being printed?

MWE from the link I posted earlier under a related question which may produce a related error (hyperlinked at the top):

\documentclass[a4paper, 12pt, twoside]{report}

    \usepackage[top=1in, bottom=1in, left=1in, right=1in, paperwidth=8.5in, paperheight=11in]{geometry}
    \usepackage{titlesec}
    \usepackage[utf8]{inputenc}
    \usepackage{etoolbox}
    \titleformat{\chapter}[display]
        {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
    \titlespacing*{\chapter}{0pt}{0pt}{20pt}
    \usepackage{xcolor}
    \usepackage{siunitx}
    \usepackage[polish, english]{babel}
    \usepackage{enumitem} % listing package
    \DeclareUnicodeCharacter{0394}{\ensuremath{\Delta}}


    %Referencing Style
    \usepackage{hyperref}
    \hypersetup{colorlinks = true, citecolor = blue} % recolors hyperlinks

    \usepackage
    [backend=biber,
    style=authoryear-comp,
    citestyle=authoryear-icomp,
    maxcitenames=2, % sets limit for et al in citations
    maxbibnames=99, % frees up limits to authors listed in references
    giveninits=true, % initialise each author
    sorting=nyt, % sort by name, author and publication title
    sortcites=false,
    hyperref=true]{biblatex} % citation hyperlinks

    \defbibenvironment{bibliography}
    {\enumerate{}
        {\setlength{\leftmargin}{\bibhang}%
        \setlength{\itemindent}{-\leftmargin}%
        \setlength{\itemsep}{\bibitemsep}%
        \setlength{\parsep}{\bibparsep}}}
    {\endenumerate}
    {\item}

    %Corrections to referencing style

    \DeclareFieldFormat*{title}{{#1}} % * clears formatting of publication titles
    \DeclareFieldFormat*{journaltitle}{\mkbibemph{#1}\isdot} % italicised journal titles
    \DeclareFieldFormat*[inbook]{volume}{\mkbibbold{#1}\isdot} % italicised journal titles

    \renewbibmacro{volume+number+eid}{%
        \setunit{\adddot\addspace}%
             \printfield{volume}%
             \printfield{number}%
         \setunit{\addcomma\space}%
             \printfield{eid}} % changed volume-number-pages layout

      \renewcommand*{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addcomma\space}}% colon between volume numbers and pages
    \DeclareFieldFormat[article]{number}{\mkbibparens{#1}} % parentheses around volume number

       \DeclareDelimFormat{translatortypedelim}{\addspace} % parentheses bracket around Ed.

    \DeclareNameAlias{sortname}{family-given} % puts given names after surname
    \DeclareFieldFormat{postnote}{#1}% no postnote prefix in "normal" citation commands
    \DeclareFieldFormat{multipostnote}{#1}% no postnote prefix in "multicite" commands
    \DeclareFieldFormat[article]{pages}{#1}% no prefix for the `pages` field in the articles within bibliography
    \DeclareFieldFormat[article]{volume}{\mkbibbold{#1}}%emboldens volume #
    \renewbibmacro{in:}{}

    \newcommand{\biband}{\ifcurrentname{labelname}{\bibstring{and}}{\&}} % changes citation 'and' to ampersand
    \renewcommand*\finalnamedelim{ \& } % references delimiter becomes ampersand
    \renewcommand*{\nameyeardelim}{\addcomma\space} % adds comma between cited author and year
    \renewcommand*{\compcitedelim}{\addsemicolon\space} % semicolons instead of commas between same author citations


\addbibresource{Bib/References.bib}

    %Paragraph indentation
    \setlength{\parindent}{2em}
    \setlength{\parskip}{0.5em}

\begin{document}

\nocite{*}
    \hypersetup{urlcolor = blue}
\printbibliography[title=References]

\end{document}
Wolfe79
  • 303
  • 1
    The cause of the error is almost certainly an entry in your .bib file. Please try to isolate which entry causes the issue and share it with us. If possible remove as much irrelevant code (biblatex customisations) as you can from the MWE while still reproducing the error. – moewe Sep 02 '19 at 18:29
  • Use binary search: Copy both the .tex document and the .bib file into a new, empty folder. Remove half of your .bib file and run the MWE. If the error does not reoccur, remove the other half and re-insert the half you had previously removed. Repeat. Note that this is an error that involves temporary files, so between each step in the binary search you should remove the temporary files (.aux, .bbl, .bcf). – moewe Sep 02 '19 at 18:34
  • This is proving relatively fruitless so far. The error disappeared along with the bibliography. I removed most of the biblatex customisations (anything between the \usepackage{biblatex} and the \addbibresource commands) and now I cannot get the bibliography to print. Any ideas? – Wolfe79 Sep 02 '19 at 18:58
  • I should point out that there were no issues with the MWE before I had to update MiKTeX and reassigned [backend=bibtex] as [backend=biber], but I was under the impression these wouldn't affect the commands as biber is able to read bibtex commands? Only after had I made these changes the .tex file would not compile appropriately when using Quick-Build – Wolfe79 Sep 02 '19 at 19:02
  • 1
    Well, BibTeX and Biber have some differences in handling of non-ASCII chars (BibTeX doesn't understand them and just passes them through, Biber interprets them and can even convert them, this might be problematic here). As I say, the problem is almost certainly with your .bib entries, so unless we get to see the offending entry, I can't say a lot more. – moewe Sep 02 '19 at 19:11
  • @moewe OK, I will keep digging. At the moment whenever I run BibTeX on the MWE after having copied over and working on separate files, I get a blue warning in Texmaker reading "Empty bibliography" and the section doesn't print. The remainder of the MWE prints fine. – Wolfe79 Sep 02 '19 at 19:16
  • On this particular MWE you need to run Biber, not BibTeX. If there is no bibliography after LaTeX, Biber, LaTeX, LaTeX check the .blg file, it should tell you if anything went wrong. – moewe Sep 02 '19 at 19:19
  • @moewe If the 'BibTeX' command in the editor is defined as executing biber.exe is that not correct? That is what it's set to in Texmaker config. The previous error with the .bcf file even reads "This is Biber 2.13" so I assumed I am running biber? That sequence (LaTeX, Biber, LaTeX, LaTeX) is defined in Quick-Build I think. – Wolfe79 Sep 02 '19 at 19:24
  • If the 'BibTeX' button runs Biber, it should be fine. My times on this site has taught be to be cautious and double check in cases like this: It would be extremely frustrating if after hours of trying to find out the issue would have been that the wrong command had been called. Do check the .blg file (on Windows machines they may be classified as 'Performance monitor' files and the file extension might not be shown, but they are short plain text files you can open and read with your favourite editor). – moewe Sep 02 '19 at 19:27
  • So I have checked the logs for .tex, but they're no different to what shows up in the errors Message Log in Texmaker. Running Biber (or BibTeX as I referred to the button) on .bib file returns the following:

    [0] Config.pm:304> INFO - This is Biber 2.13 [0] Config.pm:307> INFO - Logfile is 'References.blg' [26] biber-MSWIN64:315> INFO - === [1688] Utils.pm:316> ERROR - Cannot find 'References.bcf'! [1688] Biber.pm:114> INFO - ERRORS: 1

    which I assumed is because the QuickBuild didn't run properly.

    – Wolfe79 Sep 02 '19 at 19:35
  • Running it on .tex file: [25] biber-MSWIN64:315> INFO - === [43] Biber.pm:375> INFO - Reading 'ThesisDB.bcf' [167] Biber.pm:902> INFO - Using all citekeys in bib section 0 [181] Biber.pm:4196> INFO - Processing section 0 [183] Utils.pm:75> INFO - Globbing data source 'References.bib' [202] Utils.pm:91> INFO - Globbed data source 'References.bib' to References.bib [213] Biber.pm:4373> INFO - Looking for bibtex format file 'References.bib' for section 0 [224] bibtex.pm:1462> INFO - LaTeX decoding ... [484] bibtex.pm:1281> INFO - Found BibTeX data source 'References.bib' – Wolfe79 Sep 02 '19 at 19:36
  • The .blg shouldn't end there, please edit the full contents of the file run on the .tex (remember: Biber/BibTeX do not run on the .bib file) into the question. – moewe Sep 02 '19 at 19:37
  • And a warning for every .bib entry which doesn't have a month as well as an "error" for each .bib entry with too many commas. But those are usually omitted and do not halt .bcf file from being created. Hmmm.. – Wolfe79 Sep 02 '19 at 19:37
  • 2
    the error is about a malformed acute accent, latex is seeing something equivalent to \'{<blank line> instead of \'{e} but it is impossible to say given the information provided what is wrong with the source. – David Carlisle Sep 02 '19 at 19:42
  • OK I will keep thinking and investigate these accents. Not sure if they'd be a problem given they never were before I changed the backend to biber. Thank you for your help folks, sorry to take your time. – Wolfe79 Sep 02 '19 at 19:47
  • If the .blg file does not contain any errors, then a .bbl file should be produced (Biber reads the .bcf and produces the .bbl) and then on the next LaTeX run the bibliography should not be empty. There might be errors that prevent the bibliography from appearing in the output, but hopefully this is the error we are trying to reproduce. – moewe Sep 02 '19 at 19:49
  • you should be able to post a document here that reproduces the error, you say the bib has ~80 entries, just try a document that just has the entries with acute accents if that produces the error and it fits within the site limit post it here, if it is too big just cut the bib file in half and post the half that generates an error. – David Carlisle Sep 02 '19 at 19:58
  • 4
    I'm voting to close this question as off-topic because the OP has solved their problem since posting the question and can not provide an example .bib entry that reproduces the issue. – moewe Sep 16 '19 at 18:39

1 Answers1

1

I have now solved this and located the bug. It was indeed as @David Carlisle suggested - the issue was with the one spurious \'{i} among a list of bibliography entries containing í's that was causing the problem. It turns out that JabRef .bib handler does not ever convert these automatically, but there is a cleanup setting to do this manually.

Thanks @moewe and @David Carlisle!

Wolfe79
  • 303
  • A simple \'{i} should not produce this error and is internally converted to í anyway. Can you please share a short example .bib entry that reproduces the exact error you got with us? Since this should absolutely work, there might be a bug hidden somewhere. – moewe Sep 07 '19 at 06:08
  • Is there any chance you could show us a relevant entry that reproduced the issue for you? I tested \'{i} in a few examples and it worked quite well for me, so there must be something more going on at your end. In its current form the question can't really be answered by anyone who is not you (who has no access to your .bib file), so I will vote to close as unclear what you are asking in due time if there is no development here. – moewe Sep 14 '19 at 17:40
  • @moewe Apologies for inaction. I cannot provide the relevant entries from the .bib file, it caused a problem a while ago and I fixed it since. But using the 'run field formatter' option in JabRef and normalising all entries replacing the LaTeX style curly brackets with corresponding unicode characters has fixed the issue. Maybe it was a spurious bracket. Not sure at this point. The code works either way. – Wolfe79 Sep 16 '19 at 14:26