Skip to content

Commit

Permalink
fix rstudio#1160: allow the site field to be quoted in YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed May 22, 2021
1 parent 92de8a4 commit aa75b5f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: bookdown
Type: Package
Title: Authoring Books and Technical Documents with R Markdown
Version: 0.22.2
Version: 0.22.3
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
person("JJ", "Allaire", role = "ctb"),
Expand Down
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
````

However, as _beamer_ defines its own LaTeX throem environments, **bookdown** won't add any definition in preamble as it is doing with `pdf_book()`. This means user will have to define the ones supported by **bookdown** and not yet defined by _beamer_. Special environment from _beamer_ (like `fact`) needs to be used with usual [Custom Blocks syntax](https://bookdown.org/yihui/rmarkdown-cookbook/custom-blocks.html). See related issues for examples in their discussions thread (thanks, @XiangyunHuang, #1143, #1145).

This change comes with several small improvements in `custom-enviromnent.lua` for `latex` and `beamer` format, including a new option `bookdown.theorem.preamble` to opt-out **bookdown** addition of theorems and proofs definitions in LaTeX preamble. Set it to `FALSE` if you have conflict with some specific format for example (like #1001).


- When the `site` field is quoted in `index.Rmd`'s YAML data (i.e., `site: "bookdown::bookdown_site"`), **bookdown** fails to identify the root directory of the book (thanks, @dchiu911, #1160).

# CHANGES IN bookdown VERSION 0.22

## NEW FEATURES
Expand Down
2 changes: 1 addition & 1 deletion R/site.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ find_book_name = function(config, default) {
find_book_proj = function(input) {
# if bookdown_site() is executed it is because site: has been set in index.Rmd
rules = matrix(c(
'^index.Rmd$', '^\\s*site:\\s*bookdown::bookdown_site\\s*$'
'^index.Rmd$', '^\\s*site:\\s*["\']?bookdown::bookdown_site["\']?\\s*$'
), ncol = 2, byrow = TRUE, dimnames = list(NULL, c('file', 'pattern')))
xfun::proj_root(input, rules)
}

0 comments on commit aa75b5f

Please sign in to comment.