ismayc / thesisdown

An updated R Markdown thesis template using the bookdown package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using `biblatex` leads to error

shirdekel opened this issue · comments

Describe the bug
Specifying citation_package: biblatex leads to the following:

! Undefined control sequence.
l.663 ...rence to a book about worrying: \autocite
                                                  {Molina1994}. This \texttt...

This is the pandoc call:

/usr/local/bin/pandoc +RTS -K512m -RTS thesis.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output thesis.tex --lua-filter /Library/Frameworks/R.framework/Versions/4.0/Resources/library/bookdown/rmarkdown/lua/custom-environment.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rmarkdown/rmarkdown/lua/latex-div.lua --metadata-file /var/folders/5t/6fk0dcqn7vv1_8ln0fq3dvp00000gp/T//RtmpQlCSn8/file258b3e1aeea0 --self-contained --table-of-contents --toc-depth 3 --template template.tex --number-sections --highlight-style tango --pdf-engine pdflatex --biblatex --wrap preserve --top-level-division=chapter --variable tables=yes --standalone -Mhas-frontmatter=false

It works fine if I change thesisdown::thesis_pdf to bookdown::pdf_book, remove all the thesisdown specifics from the YAML, and add documentclass: book. In this case the pandoc call is this:

/usr/local/bin/pandoc +RTS -K512m -RTS thesis.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output thesis.tex --lua-filter /Library/Frameworks/R.framework/Versions/4.0/Resources/library/bookdown/rmarkdown/lua/custom-environment.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rmarkdown/rmarkdown/lua/latex-div.lua --metadata-file /var/folders/5t/6fk0dcqn7vv1_8ln0fq3dvp00000gp/T//RtmpQlCSn8/file258b2c792b5f --self-contained --table-of-contents --toc-depth 2 --number-sections --highlight-style tango --pdf-engine pdflatex --biblatex --variable graphics --wrap preserve --variable tables=yes --standalone -Mhas-frontmatter=false 

To Reproduce
Steps to reproduce the behavior:

  1. Specify citation_package: biblatex in thesisdown-demo as below:
output:
  thesisdown::thesis_pdf:
    citation_package: biblatex
  1. Run bookdown::render_book("index.Rmd", "thesisdown::thesis_pdf")

Expected behavior
For the book to render without error.

Desktop (please complete the following information):

  • OS: macOS 10.14.6
  • Browser Firefox
  • Version 86.0.1 (64-bit)

Additional context
I'm doing this in order to get chapter-specific bibliographies as per this StackOverflow answer.

Since this works in bookdown, I suspect the issue is caused by something in template.tex or reedthesis.cls. However, I wasn't sufficiently Latex-savvy to work out the issue at first glance.

Thanks for reporting. I'm still looking into what might be causing this, but I seem to recall there being issues with this and reedthesis previously.

Unfortunately, I still haven't gotten this to work. I can get the PDF to build but the references do not show up. I think you are going to have to comment out sections of code in template.tex or reedthesis.cls to try to get biblatex/biber to work. Alternatively, if you have a different LaTeX template instead of the Reed College one that you'd like to match up with to get chapter-specific bibliographies, we can explore getting that to work instead of trying to backtrack through the Reed College example.

That's ok. I'll let you know if I work it out.

+1 to wanting this feature, I need to have my appendices to have their own bibliographies and have been troubleshooting this issue. I'll update if I find anything.

+1 here! I also would like to implement separate bibliographies for each chapter like in this soluition, but it doesn't work. Are there any news on this?

If these solutions are not working with bookdown, they will not work for thesisdown since it depends on bookdown. Additionally, this is likely going beyond being able to output to multiple formats and instead will only produce a PDF from LaTeX. That's beyond the scope of this package and I don't think will be something I will be able to support unless bookdown better supports it. Please file bookdown specific issues there and hopefully at some point down the road this is better supported.

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org whenever possible) and link to this issue. If a reprex is not applicable, recording a short Loom video showing what you are seeing can go a long way in helping to diagnose problems.