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

Sth wrong with bibtex creation #357

Open
xiasummer opened this issue Feb 24, 2022 · 3 comments
Open

Sth wrong with bibtex creation #357

xiasummer opened this issue Feb 24, 2022 · 3 comments

Comments

@xiasummer
Copy link

When I used tinytex::xelatex('./my_test.tex') to compile my test file, I found that everything is good, except for the bibtex part. Seems to be file not exist, but using other tools like TexStudio it works perfect. I don't know what wrong there is, just report here.

6.
stop("Failed to build the bibliography via ", bib_engine, call. = FALSE)
5.
system2_quiet(bib_engine, shQuote(aux), error = {
check_blg = function() {
if (!file.exists(blg)) 
return(TRUE) ...
4.
build_bib()
3.
latexmk_emu(file, engine, bib_engine, engine_args, min_times, 
max_times, install_packages, clean)
2.
latexmk(engine = "xelatex", emulation = TRUE, ...)
1.
tinytex::xelatex("./my_test.tex")
@yihui
Copy link
Member

yihui commented Feb 24, 2022

Please follow the issue guide when you file an issue. In particular, please provide a minimal reproducible example. Without that, it's nearly impossible to help you. Thanks!

@emberwick
Copy link

Similar issue following February updates, can be avoided by switching to default or natbib over biblatex, I just prefer biblatex for style options.

Minimal example (using pdf_document rather than bookdown::pdf_document2 does not matter; neither does the latex engine):

---
title: "Title"
output: 
  bookdown::pdf_document2:
    latex_engine: xelatex
    citation_package: biblatex
bibliography: demo.bib
---

Citation to [@R-base].

demo.bib file contains only:

@Manual{R-base,
  title = {R: A Language and Environment for Statistical
           Computing},
  author = {{R Core Team}},
  organization = {R Foundation for Statistical Computing},
  address = {Vienna, Austria},
  year = {2019},
  url = {https://www.R-project.org},
}

Returns error:

INFO - This is Biber 2.17
INFO - Logfile is 'biber_mre.blg'
INFO - Reading 'biber_mre.bcf'
INFO - Found 1 citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex file 'demo.bib' for section 0
INFO - LaTeX decoding ...
INFO - Found BibTeX data source 'demo.bib'
Error: Failed to build the bibliography via biber
Warning: LaTeX Warning: Citation 'R-base' on page 1 undefined on input line 88.
Warning: LaTeX Warning: Empty bibliography on input line 90.
Warning: LaTeX Warning: There were undefined references.
Warning: Package biblatex Warning: Please (re)run Biber on the file:
Warning: (biblatex)                biber_mre
Warning: (biblatex)                and rerun LaTeX afterwards.
Execution halted

Session info:

R version 4.1.2 (2021-11-01)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.1, RStudio 2021.9.1.372

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

Package version:
  base64enc_0.1.3   bslib_0.3.1       digest_0.6.29    
  evaluate_0.15     fastmap_1.1.0     fs_1.5.2         
  glue_1.6.2        graphics_4.1.2    grDevices_4.1.2  
  highr_0.9         htmltools_0.5.2   jquerylib_0.1.4  
  jsonlite_1.8.0    knitr_1.37        magrittr_2.0.2   
  methods_4.1.2     R6_2.5.1          rappdirs_0.3.3   
  rlang_1.0.1       rmarkdown_2.11.23 sass_0.4.0       
  stats_4.1.2       stringi_1.7.6     stringr_1.4.0    
  tinytex_0.37      tools_4.1.2       utils_4.1.2      
  xfun_0.29         yaml_2.3.5       

Pandoc version: 2.17.1.1

Thank you!

@yihui
Copy link
Member

yihui commented Mar 2, 2022

@emberwick Thanks for providing an example! I can't reproduce it on my Macbook:

xfun::session_info(c('tinytex', 'rmarkdown'))
R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.2.1, RStudio 2021.9.0.351

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

Package version:
  base64enc_0.1.3   bslib_0.3.1       digest_0.6.29     evaluate_0.15     fastmap_1.1.0     fs_1.5.2         
  glue_1.6.2        graphics_4.1.2    grDevices_4.1.2   highr_0.9         htmltools_0.5.2   jquerylib_0.1.4  
  jsonlite_1.8.0    knitr_1.37.4      magrittr_2.0.2    methods_4.1.2     R6_2.5.1          rappdirs_0.3.3   
  rlang_1.0.1       rmarkdown_2.11.22 sass_0.4.0        stats_4.1.2       stringi_1.7.6     stringr_1.4.0    
  tinytex_0.37      tools_4.1.2       utils_4.1.2       xfun_0.29.2       yaml_2.3.5       

LaTeX version used: 
  TeX Live 2021 (TinyTeX) with tlmgr 2021-12-24

Pandoc version: 2.14.0.3

I suspect that this problem may be specific to macOS with the ARM architecture, but I don't have a machine to verify.

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