NEW FEATURES
-
Add the
number_sectionsargument tomarkdown_document2()and its family. This allows to have now figure references numbered by chapters in these formats, likeword_document2()orodt_document2()for example. This argument default toTRUElikehtml_document2()andpdf_document2(). Set it tonumber_sections = FALSEto get the same output as previous version without numbered chapters (thanks, @atusy, #756). -
Provided an alternative way to create theorem and proof environments using Pandoc's fenced Divs. Previously, bookdown supports theorems and proofs in special code chunks like
```{theorem}. Now you can use the new syntax::: {.theorem}. You may use the helper functionbookdown::fence_theorems()to convert the former syntax to the latter. The main benefit of using fenced Divs is that you can write arbitrary content in a theorem environment (here "theorem" includes other environments such as lemma, corollary, and definition, etc.), such as R code chunks and inline R code, which was not possible previously. Note that this feature is only supported for LaTeX and HTML output formats at the moment. To learn more about the fenced Divs in general, you may read this section in R Markdown Cookbook: https://bookdown.org/yihui/rmarkdown-cookbook/custom-blocks.html (thanks, @tchevri #924, @cderv #940).
BUG FIXES
-
Correctly encode the document title when creating the Twitter sharing link from a bookdown chapter (thanks, @maelle, #934).
-
Make sure
search_index.jsoncontains valid characters for the JSON format (thanks, @wlandau, #913).
MAJOR CHANGES
-
The
--file-scopebehavior introduced in bookdown v0.20 is now disabled by default. This is due to broken TOC links for duplicate section names (e.g., "Exercises"; see #909) that have automatically generated identifiers. -
The
clean_envirargument ofbookdown::render_book()has been deprecated and will be removed in the future (thanks, @jenslaufer, #932). -
The function
kindlegen()has been deprecated, since Amazon no longer provides KindleGen. Please consider usingbookdown::calibre()instead if you want.mobioutput (#973).
MINOR CHANGES
- Updated documentation for
render_book()to make it clearer how options are set for theoutput_formatparameter (thanks, @jonathan-g, #958 #930).
Assets
2
yihui
released this
NEW FEATURES
-
If
delete_merged_fileis set tofalsein_bookdown.yml, the merged (Rmd or md) file will not be deleted after the book is rendered (thanks, ilse pit, https://stackoverflow.com/q/61973608/559676). -
Numeric footnotes duplicated across chapters are now automatically renumbered. This is done by passing the
--file-scopeargument to pandoc (and having it operate on split out individual chapters of the target .md file rather than a combined file). This behavior can be toggled off by settingoptions(bookdown.render.file_scope = FALSE).
BUG FIXES
MINOR CHANGES
- Removed the
encodingargument frombookdown::render_book(). This argument has always been ignored in bookdown.
Assets
2
yihui
released this
BUG FIXES
-
Multiline footnotes are now correctly rendered in HTML output (thanks, @jtbayly, @cderv, #876).
-
Text references do not work for
theoremenvironments (thanks, @ssp3nc3r, rstudio/tufte#75). -
When both
rmd_subdirandrmd_filesare provided in the config file_bookdown.yml, only the files specified inrmd_filesare now selected in addition to files underrmd_subdir. In the previous version, all files under the root directory are selected (thanks, @Gnossos #885, @cderv #886). -
When
rmd_subdiris provided in_bookdown.yml, the subdirectories were always alphabetically ordered instead of following the order of elements inrmd_subdir(thanks, @Rothdyt, #736).
MAJOR CHANGES
- Files with a leading
_in their names are always ignored, even if they are specified inrmd_filesin_bookdown.yml. Such files under subdirectories are also always ignored (#886).
Assets
2
yihui
released this
NEW FEATURES
- Added an output format
context_document2, based on the newly developedrmarkdown::context_document(see rstudio/rmarkdown#1713, rstudio/rmarkdown#1715, and rstudio/rmarkdown#1725; thanks @jooyoungseo, @atusy, and @RLesur).
BUG FIXES
-
render_book()works correctly withoutput_dir = "."now (thanks, @julianre, @cderv, #857). -
Cross-referencing works correctly now with
gitbookwhen usingsplit_by: sectionorsplit_by: section+number(thanks, @ThierryO, @cderv, #787). -
When using the Knit-and-Merge approach to compile a book (
new_session: truein_bookdown.yml) and the fieldsbefore_chapter_scriptand/orafter_chapter_scriptare configured in_bookdown.yml, the original Rmd files are no longer touched (thanks, @clauswilke #405 and @bob-carpenter https://stackoverflow.com/q/50554196/559676), and the scripts specified inbefore/after_chapter_scriptare no longer inserted into the Rmd files (they are read and evaluated separately), so the line numbers will be correct in case of knitr errors (thanks, @arencambre, #852).
Assets
2
yihui
released this
NEW FEATURES
- Added an output format
github_document2, which is a wrapper function based onmarkdown_document2usingrmarkdown::github_documentas the base format (thanks, @jooyoungseo, #831).
BUG FIXES
-
Fixed cross-reference issues with Pandoc 2.9+. Note that Pandoc 2.8 is not supported since it had a fairly short lifespan, but Pandoc below v2.8 or above v2.9 is still supported (thanks, @N0rbert @RLesur, #832; @jooyoungseo #845).
-
For output formats like
pdf_book, unused arguments passed tobase_formatwill be discarded (thanks, @jooyoungseo, #790). -
For the sake of backward-compatibility, prevent the commands
\frontmatter,\mainmatter, and\backmatterfrom being automatically added to the LaTeX output when the Pandoc version is higher than 2.7, because bookdown users may have added these commands by themselves (thanks, @remlapmot, rstudio/rmarkdown#1721). -
Fixed the issues yihui/bookdown-chinese#29 and yihui/bookdown-chinese#30. Such issues can occurr on Windows when there are multibyte characters in the section headers, and users will run into the error "Error in file.exists(f): file name conversion problem - name too long?" (thanks, @kongdd @JiaxiangBU @gaospecial and other users who reported the same issue such as https://twitter.com/matsuchiy/status/1186653559405727744 and https://d.cosx.org/d/420961).
MINOR CHANGES
- The default value of
base_formatin themarkdown_document2format isrmarkdown::md_documentnow. Previously the default value is missing.
Assets
2
yihui
released this
NEW FEATURES
-
You can also add a "view" button on the GitBook toolbar, similar to the "edit" and "history" buttons, which shows the page's
.Rmdsource file on GitHub. Unlike "edit", "view" does not require the reader to login to GitHub and fork the repo (thanks, @jtr13, #806). -
For
gitbookoutput, the font setting button can be removed viafontsettings: falsein theconfigoption. Similarly, the info button can be removed byinfo: falseinconfig(thanks, @mnazarov, #788). -
It is possible to customize the prefixes of appendix titles in
gitbookoutput now (the default is stillA,B,C, ..., and now you can change them to something likeAppendix A,Appendix B, ...); see the documentation at https://bookdown.org/yihui/bookdown/internationalization.html (thanks, @WerthPADOH, #783). -
Added
html_fragment2,html_notebook2,html_vignette2,ioslides_presentation2,slidy_presentation2, andbeamer_presentation2for cross-referencing capabilities on top of rmarkdown output formats (thanks, @jooyoungseo, #789 #823).
BUG FIXES
-
For the
gitbookoutput format, disabling thesharingmenu or buttons works again (thanks, @lwjohnst86, #812). -
For the
gitbookoutput format, toc collapsed by section now works with accents in chapter titles (thanks, @glimmerphoenix, @cderv, #819) -
For output formats
word_document2,powerpoint_presentation2, andodt_document2,$$is no longer added to equation environments when they are inside fenced code blocks (thanks, @N0rbert, #814).
Assets
2
yihui
released this
BUG FIXES
-
Sharing to Facebook and Twitter is possible again. Google+ sharing has been disabled (with a warning) as this service no longer exists (thanks, @cderv, #802).
-
When using Pandoc 2.7.3 or later, footnotes are now placed again at the end of each chapter (#798, #801, thanks @cderv).
-
gitbook toolbar is not missing any more when rendering books with Pandoc 2.x and using
self_contained = TRUE(thanks, @Pindar777, @RLesur, @cderv, #739).
Assets
2
yihui
released this
NEW FEATURES
-
Added
rtf_document2(thanks, @jooyoungseo, #768). -
Added copy to clipboard buttons to code blocks in the
gitbookoutput format (thanks, @behrman #775, @RLesur #776).
BUG FIXES
- Images specified in
toc: before:of thegitbookformat are not copied to the output directory (thanks, @dcossyleon, #763).
Assets
2
yihui
released this
MINOR CHANGES
- Reverted #706 and removed the
clean_highlight_tagsargument inhtml_document2(); bookdown will no longer clean up the HTML tags of the syntax-highlighted code blocks.