rstudio / rmarkdown

Dynamic Documents for R
https://rmarkdown.rstudio.com
GNU General Public License v3.0
2.88k stars 974 forks source link

knit error when trying to compile PDF for bookdown #1769

Closed loikein closed 4 years ago

loikein commented 4 years ago

By filing an issue to this repo, I promise that

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


Hi folks. I run a blogdown site and was trying to include a bookdown article in the static folder, similar as if you would do with xaringan slides.

My goals are:

  1. Have a online version (Gitbook)
  2. Output a paper-ish PDF version

Current problems:

  1. When compiling to Gitbook, some config's are not effective (no PDF download, no search)
  2. When compiling to PDF, knit gives the following error (fatal):
Error in if (toc) { : argument is not interpretable as logical
Calls: <Anonymous> ... get_base_format -> do.call -> <Anonymous> -> pandoc_toc_args
Execution halted

Any help is appreciated!


Files:

_output.yml:

bookdown::gitbook:
  split_by: none
  config:
    download: [pdf]
    sharing:
      github: yes
      facebook: no
    toolbar:
      search: yes
bookdown::pdf_document2:
  latex_engine: pdflatex
  keep_tex: yes
  fig_crop: false
  template: null
  toc: true
  toc_depth: 3
  number_sections: true
  highlight_bw: true

_bookdown.yml:

book_filename: quals
output_dir: output

head of paper.Rmd:

---
title: 'A Paper'
author: "loikein"
date: "Last updated: `r (Sys.time())`"
documentclass: article
knit: "bookdown::pdf_document2"
site: bookdown::bookdown_site
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(collapse = FALSE, tidy = FALSE, echo = TRUE, eval = FALSE)

Abstract {-}

Introduction

---
Some system info:
```sh
$ latex --version
pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019)
─ Session info ────────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.6.2 (2019-12-12)
 os       macOS Catalina 10.15.3      
 system   x86_64, darwin15.6.0        
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       Europe/Berlin               
 date     2020-02-07                  

─ Packages ────────────────────────────────────────────────────────────────────────────────────────────
 package   * version date       lib source        
 base64enc   0.1-3   2015-07-28 [1] CRAN (R 3.6.0)
 digest      0.6.23  2019-11-23 [1] CRAN (R 3.6.0)
 evaluate    0.14    2019-05-28 [1] CRAN (R 3.6.0)
 glue        1.3.1   2019-03-12 [1] CRAN (R 3.6.0)
 highr       0.8     2019-03-20 [1] CRAN (R 3.6.0)
 htmltools   0.4.0   2019-10-04 [1] CRAN (R 3.6.0)
 jsonlite    1.6     2018-12-07 [1] CRAN (R 3.6.0)
 knitr       1.27    2020-01-16 [1] CRAN (R 3.6.0)
 magrittr    1.5     2014-11-22 [1] CRAN (R 3.6.0)
 markdown    1.1     2019-08-07 [1] CRAN (R 3.6.0)
 mime        0.8     2019-12-19 [1] CRAN (R 3.6.0)
 Rcpp        1.0.3   2019-11-08 [1] CRAN (R 3.6.0)
 rlang       0.4.2   2019-11-23 [1] CRAN (R 3.6.0)
 rmarkdown   2.0     2019-12-12 [1] CRAN (R 3.6.0)
 stringi     1.4.5   2020-01-11 [1] CRAN (R 3.6.0)
 stringr     1.4.0   2019-02-10 [1] CRAN (R 3.6.0)
 tinytex     0.19    2020-01-14 [1] CRAN (R 3.6.0)
 xfun        0.12    2020-01-13 [1] CRAN (R 3.6.0)
 yaml        2.2.1   2020-02-01 [1] CRAN (R 3.6.2)

[1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library
cderv commented 4 years ago

Hi,

As mentioned in the issue guide, It would be easier to help if you can provide a reproducible project example for helping us reproduce the error and show what you want to do. Currently, it is difficult to know it is a bug in Rmarkdown (this repo) or if this is a question on how to do what you wish. This would be more efficient for you to ask on https://community.rstudio.com such questions. Thank you.

loikein commented 4 years ago

Hi cderv, thank you for your reply.

I am sure it is a bug (with the error message), but I am not sure it's because of Bookdown, Blogdown, knitr, or anything else, so I considered Rmarkdown as a good umbrella for the issue. Will certainly take a look at the community! Thank you so much.

cderv commented 4 years ago

Ok great ! When you are not sure like that, and maybe needs helps to investigate or share ideas, the rstudio community is a great place, specificly its Rmarkdown channel: https://community.rstudio.com/c/R-Markdown

Then if an issue if found, opening in the correct Github repository and linking back to the community is a good way to go with.

Hope it helps.

loikein commented 4 years ago

Thank you. I have posted on the forum, and will close this issue for now.

github-actions[bot] commented 4 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.