Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

biber and biblatex compatibility #291

Closed
3 tasks done
shirdekel opened this issue Mar 23, 2021 · 7 comments
Closed
3 tasks done

biber and biblatex compatibility #291

shirdekel opened this issue Mar 23, 2021 · 7 comments

Comments

@shirdekel
Copy link

I was getting the same error as in plk/biber#347, except I had biblatex version 3.16. Running tinytex::install_tinytex() and tlmgr_update() did not fix the issue. Only running tlmgr_install('biber') (which I found through #70) fixed it.

The context was that I was running a bookdown project with citation_package: biblatex and using \printbibliography calls in the text.

Is there a way to automate making sure biber and biblatex are compatible? Or is this already the case and I just screwed up one of the steps? Not really sure how to provide a reprex for this one.

xfun::session_info('tinytex')
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Locale: en_AU.UTF-8 / en_AU.UTF-8 / en_AU.UTF-8 / C / en_AU.UTF-8 / en_AU.UTF-8

Package version:
  graphics_4.0.2  grDevices_4.0.2 stats_4.0.2     tinytex_0.30.1   
  tools_4.0.2     utils_4.0.2     xfun_0.22

By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('tinytex'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/tinytex').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@yihui
Copy link
Member

yihui commented Mar 24, 2021

Running tinytex::install_tinytex() and tlmgr_update() did not fix the issue. Only running tlmgr_install('biber') (which I found through #70) fixed it.

That's interesting. I don't know why that was the case. In theory, tlmgr_update() should update biblatex to its latest version (if not installed, the latest version will be automatically installed), and if biber was not installed, it should be automatically installed, too:

https://github.com/yihui/tinytex/blob/3c07a44a4eae9d553393e25258a8c11d7cca28d7/R/latex.R#L186-L189
https://github.com/yihui/tinytex/blob/3c07a44a4eae9d553393e25258a8c11d7cca28d7/R/latex.R#L234

Here bib_engine is biber in your case (when citation_package = 'biblatex').

I just tried this example and wasn't able to reproduce the problem:

---
title: "Test biblatex"
bibliography: test.bib
output:
  pdf_document:
    citation_package: biblatex
---

@R-base

```{r}
knitr::write_bib('base', 'test.bib')
```

Output:

processing file: test.Rmd
...

/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS test.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output test.tex --lua-filter ~/R/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter ~/R/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --highlight-style tango --pdf-engine pdflatex --biblatex --variable graphics --variable 'geometry:margin=1in' 
output file: test.knit.md

tlmgr search --file --global '/biber'
tlmgr install biber
tlmgr: package repository https://mirrors.rit.edu/CTAN/systems/texlive/tlnet (not verified: gpg unavailable)
[1/2, ??:??/??:??] install: biber.x86_64-darwin [33013k]
[2/2, 00:40/00:40] install: biber [1k]
tlmgr: package log updated: ~/Library/TinyTeX/texmf-var/web2c/tlmgr.log

Output created: test.pdf

It might be a temporary problem. Anyway, if I can't reproduce it, it's hard for me to know how to fix it. Thanks for the report!

@yihui yihui closed this as completed in 5946a2a Mar 24, 2021
@yihui
Copy link
Member

yihui commented Mar 24, 2021

I just discovered that with an older version of biblatex, it could cause the error below:

! LaTeX3 Error: Mismatched LaTeX support files detected.
(LaTeX3)        Loading 'expl3.sty' aborted!
(LaTeX3)        
(LaTeX3)        The L3 programming layer in the LaTeX format
(LaTeX3)        is dated 2021-02-06, but in your TeX tree the files require
(LaTeX3)        at least 2021-02-18.

I just committed a patch that will resolve this problem. The patch will try to automatically update existing packages to avoid the possible compatibility issues.

@tfjaeger
Copy link

tfjaeger commented Dec 9, 2022

Hi Yihui,

I'm having the same problem described above (MacOS 11.6.5, R 4.1.2, tinytex 0.42).

INFO - This is Biber 2.16
INFO - Logfile is 'Empirical-indeterminacy.blg'
INFO - Reading 'Empirical-indeterminacy.bcf'
ERROR - Error: Found biblatex control file version 3.9, expected version 3.7.
This means that your biber (2.16) and biblatex (3.18b) versions are incompatible.
See compat matrix in biblatex or biber PDF documentation.****

Using tinytex::tlmgr_install('biber') fixed that problem.

I do, however, run into another problem that seems related:

tlmgr search --file --global '/biblatex-dm.cfg'
! Missing $ inserted.
<inserted text> 
                $
l.291 

You may need to add $ $ around a certain inline R expression `r ` in Empirical-indeterminacy.Rmd. See https://github.com/rstudio/rmarkdown/issues/385 for more info.
Error: LaTeX failed to compile Empirical-indeterminacy.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Empirical-indeterminacy.log for more info.
In addition: Warning message:
In parse_packages(logfile, quiet = !verbose) :
  Failed to find a package that contains biblatex-dm.cfg
Execution halted

This might be related to this issue but when I tried to patch that following the suggestions on that page I ran into one error after another. Have you by chance encountered the above issue?

@tfjaeger
Copy link

tfjaeger commented Dec 9, 2022

I have an update. The above issue only occurs once knitr evokes XeTeX. What caused this was hard to pin down for me. But e.g., the inclusion of the following citation entry causes that offense and only if the note field is included:

@article{mcqueen2006,
   abstract = {A perceptual learning experiment provides evidence that the mental lexicon cannot consist solely of detailed acoustic traces of recognition episodes. In a training lexical decision phase, listeners heard an ambiguous [f-s] fricative sound, replacing either [f] or [s] in words. In a test phase, listeners then made lexical decisions to visual targets following auditory primes. Critical materials were minimal pairs that could be a word with either [f] or [s] (cf. English knife-nice), none of which had been heard in training. Listeners interpreted the minimal pair words differently in the second phase according to the training received in the first phase. Therefore, lexically mediated retuning of phoneme perception not only influences categorical decisions about fricatives (Norris, McQueen, \& Cutler, 2003), but also benefits recognition of words outside the training set. The observed generalization across words suggests that this retuning occurs prelexically. Therefore, lexical processing involves sublexical phonological abstraction, not only accumulation of acoustic episodes.},
   author = {James M McQueen and A Cutler and D Norris},
   city = {Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands},
   doi = {10.1207/s15516709cog0000\_79},
   edition = {2006/11/12},
   issn = {0364-0213 (Print)0364-0213},
   issue = {6},
   journal = {Cognitive Science},
   note = {McQueen, James M<br/><br/>Cutler, Anne<br/><br/>Norris, Dennis<br/><br/>MC_U105580446/Medical Research Council/United Kingdom<br/><br/>MC_U105580447/Medical Research Council/United Kingdom<br/><br/>Journal Article<br/><br/>United States<br/><br/>Cogn Sci. 2006 Nov 12;30(6):1113-26. doi: 10.1207/s15516709cog0000_79.},
   pages = {1113-1126},
   title = {Phonological abstraction in the mental lexicon},
   volume = {30},
   url = {http://dx.doi.org/10.1207/s15516709cog0000\_79},
   year = {2006},
}

Perhaps this is related to the HTML in the note field? Without out a document of 100 pages compiles, with the note field included in this citation it goes into XeTex mode and throws the error about bilatex-dm.cfg reported above.

@yihui
Copy link
Member

yihui commented Dec 9, 2022

I'm not sure. It's probably because of the underscores in the notefield. Underscores need to be escaped (\_).

@tfjaeger
Copy link

tfjaeger commented Dec 9, 2022

Yes, and %s, too (I found another offender). Bibtex seems to be robust to that but biblatex is not. Hopefully, posting this here can help some other folks. Sorry to bother you with it. (and thanks for replying anyway)

@yihui
Copy link
Member

yihui commented Dec 9, 2022

No worries at all! Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants