Skip to content

Releases: rstudio/bookdown

bookdown 0.31

14 Dec 03:38
Compare
Choose a tag to compare
  • This package requires R >= 3.5.0 now.

bookdown 0.30

09 Nov 16:58
Compare
Choose a tag to compare
  • Support specific markdown content like list or code chunk inside Theorem and Proof special environments (#1371).

  • Fix regression about special usage of bookdown project not using index.Rmd as main file. It is recommended to use index.Rmd in all projects, but workflow has been improved for other cases (thanks, @otoomet, #1349).

bookdown 0.29

12 Sep 21:54
Compare
Choose a tag to compare
  • The argument code_folding works for the gitbook() output format now (thanks, @atusy, #1368).

  • Setting toc_depth or toc_float in bs4_book() will now throw an error like toc to make it clear that TOC is not an opt-out choice and can't be customize (thanks, @karlmay88, #1377).

bookdown 0.28

10 Aug 03:33
Compare
Choose a tag to compare
  • Fix fontawesome 4.7 CSS that is included with gitbook() format styling. Now new icons (like fa-usb) are correctly available as expected (thanks, @snipfoo, #1353).

  • Fix an issue with clipboard button in gitbook() (thanks, @chadyuu, #1358).

bookdown 0.27

14 Jun 14:46
Compare
Choose a tag to compare
  • Fix fence_theorems() so that output is not ignored anymore. With previous version, when output was different than NULL, the result was written to input, ignoring output value. From now on, set input and output to the same file if you want to overwrite (thanks, @Scinawa, #1342).

  • Tweak bs4_book() default CSS for better support of python chunk highlighting (thanks, @briandk, #1333).

  • Fix an issue with guessing output format when no output_format is provided in render_book() for files in a rmd_subdir folder (thanks, @shivam7898, #1331).

  • Fix the issue of the invisible gitbook toolbar on iPad (thanks, @mpereira-dev, #60).

bookdown 0.26

15 Apr 14:21
Compare
Choose a tag to compare
  • Fix issues with TOC in gitbook() and Pandoc 2.18 (thanks, @avraam-inside, #1326, #1329).

  • Fix an issue with per-format rmd_files config when no output_format was provided in render_book() (thanks, @ellessenne, #1323).

  • Added support for theorem/proof environments back for Word/EPUB/ODT output (thanks, @N0rbert, #1313).

  • kindlegen() is defunct now.

bookdown 0.25

16 Mar 13:32
Compare
Choose a tag to compare

NEW FEATURES

  • Set option bookdown.theorem.enabled = FALSE to opt-out bookdown special Theorem and Proof environment syntax. options(bookdown.theorem.enabled = FALSE) must be called before the function to render the book, e.g in a project's .Rprofile. This can be useful for advanced users who only want PDF output and needs to handle themselves the environment using LaTeX directly, or Custom Blocks syntax without bookdown interfering (thanks, @finkelshtein, #1285).

  • bs4_book() gains a footnotes_inline argument. Set to FALSE to opt-out the default behavior of moving footnotes inline to show on hover (thanks, @Pindar777, #1253).

BUG FIXES

  • Fix styling of bibliography for bs4_book() (thanks, @Selbosh, #1277).

  • Fix an issue with Pandoc 2.17 and internationalization of Proof-like environment (#1302).

  • Fix an issue with Pandoc 2.17 and cross referencing sections in non HTML format (thanks, @N0rbert, #1301).

  • Fix an issue with Pandoc 2.15 and footnote relocation in each chapter (#1275).

  • Fix an issue with html_book() and toc.css not working correctly with recent pandoc (thanks, @florisvdh, #1268).

  • Fix an issue with unneeded header-attr.js inserted by rmarkdown while bookdown already cleans attributes (thanks, @salim-b, #865).

MAJOR CHANGES

  • The theorem and proof knitr engines no longer use the block2 knitr engine to create theorem/proof environments, but write out fenced Divs instead, which is the new syntax for these environments. Note that this means these environments are no longer supported in EPUB output (they work only in HTML and PDF), but hopefully the support will be back in the future (thanks, @deleeuw, #1178).

  • The tag <meta property="og:url"> has been removed from the default HTML template and the gitbook template (thanks, @jtbayly, #970).

bookdown 0.24

03 Sep 05:42
Compare
Choose a tag to compare

MAJOR CHANGES

  • The default search engine for gitbook has been changed from lunr to fuse. If you want to switch back to lunr, you may set:

    output:
      bookdown::gitbook:
        config:
          search:
            engine: lunr

MINOR CHANGES

  • Reverted the fix for #1223 since it only affects a specific version of Pandoc (2.14.1). If this issue affects you, please see #1223 for workarounds.

  • bs4_book() now has the template argument like gitbook() (thanks, @shinneuro, #1247).

BUG FIXES

  • extra_dependencies in gitbook() will now be appended after Gitbook's dependencies so that it does not get overridden (thanks, @ThierryO, @linogaliana, #1101, #1248).

  • Fix an issue with Fenced Divs for Theorem & Proof environments in the Lua filter (thanks, @tchevri, #1233).

  • gitbook(self_contained = TRUE) was slow when the output contains base64-encoded images (thanks, @king2bob, #1236).

  • The search config search: true or search: false for gitbook throws a misleading error (thanks, @GegznaV, #1238).

bookdown 0.23

13 Aug 04:55
Compare
Choose a tag to compare

NEW FEATURES

  • This version has included a new RStudio template project to start an HTML book in bookdown::gitbook or bookdown::bs4_book. Template projects can be created using the RStudio IDE menu "New Project", or using one of the two new functions, create_gitbook() or create_bs4_book(), to easily create the template that you want to start with from within the R console (#225, #1123, #1201).

  • Added an argument global_numbering to most output format functions in this package to control the figure/table numbering scheme (thanks, @elfunesto #948, @Kodiologist #1057). If TRUE, number figures and tables globally throughout a document (e.g., Figure 1, Figure 2, ...). If FALSE, number them sequentially within sections (e.g., Figure 1.1, Figure 1.2, ..., Figure 5.1, Figure 5.2, ...). Previously, this numbering scheme was hard-coded internally according to the number_sections argument (global_numbering = !number_sections). Now the two arguments have become independent, e.g., you can use global_numbering = TRUE with number_sections = TRUE.

  • For HTML book formats, a default 404.html page will now be created if none exists already. This page can be customized by adding a _404.md or _404.Rmd file which will be rendered to HTML and inserted in the book. Most web serving platforms (e.g. Netlify, GH Pages, etc.) will use this file named 404.html in the root as a custom error page. Otherwise, like browsers do, a default 404 page is shown. For context, a 404 error indicates that the file can’t be found, and it happens when a browser can’t find a requested web page. This could happen with your online book if you shared a link to a section but change the name of this section leading to a change in url (#1035).

  • The bookdown::gitbook output format now supports an alternative search engine, namely fuse.js, which has several advantages over lunr.js, the previous search engine for gitbook. Using fuse.js will fix a number of long-standing issues such as #734, #735, and #792. To enable fuse.js, set the search engine to be fuse in gitbook's config in YAML, e.g.,

    output:
      bookdown::gitbook:
        config:
          search:
            engine: fuse

    Depending on user feedback, we may set fuse to be the default search engine in a future version of bookdown. We will appreciate your testing and feedback!

  • bs4_book(splib_bib = TRUE) can now be specified to have the same effect as in gitbook(). References will be shown at the end of each chapter and not only at the end of the book. This is useful with bs4_book() when a citation style not supporting footnotes is used because in that case, references are not shown inline in popups (thanks, @shirdekel, #1185).

  • In bs4_book(), improvement regarding copy button:

    • It has now a light icon instead of a text with white background (#1192).
    • It will no more show on output block code when knitr's option is collapse = FALSE (#1197).
    • It will now be placed correctly on the right side of the code block, with a light color which gets darker on hover so that it is less obtrusive when overlapping text in block with long lines (#1204). If you want to customize part of the UI to change this default behavior, you can do it using a custom css with bs4_book().
  • In bs4_book(), copy button has now a light icon instead of a text with white background (#1192).

  • bs4_book() has now some <meta> tags that allows sharing a published book on social media. cover-image, url, title and description set in YAML will be used in index.html and then modified to be adapted per HTML page (#1034).

  • repo specification in bs4_book() can now be done in a more flexible way: base url, branch name, subdir and icon can be specify. See ?bookdown::bs4_book() for details (thanks, @maelle, #1036).

  • epub_version argument in epub_book() can now be set to epub2 to create EPUB book of version 2. This follows an old change for default behavior in Pandoc 2.0 where the alias epub defaults to epub3 and no more epub2 (thanks, @jtbayly, #1150).

  • Theorem and Proof environment can now be used with beamer_presentation2() using fenced Div syntax like this

    ::: {.theorem #label name="My Theorem"}
    Content
    :::

    However, as beamer defines its own LaTeX theorem 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. 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).

MINOR CHANGES

  • Updated the jQuery library to v3.x, which is now imported from the R package jquerylib (thanks, @mterente #693, @cooknl #882).

BUG FIXES

  • Removed the requirement for .html filenames to be alphanumeric, which fixes a common error "Automatically generated filenames contain duplicated ones: -" (thanks, @psychelzh #605, @AzureRabbit #902, @carloslederman #1000, Ritsu Kitagawa https://stackoverflow.com/q/60014350/559676, Shrek Tan).

  • Fix an issue with bookdown_site() where the comment in site: line key was not supported (thanks, @LDSamson, #1194).

  • Figure reference links now point correctly to the top of figures (thanks, @GuillaumeBiessy, #1155).

  • 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).

  • The figure/table labels are no longer duplicated in Word output generated from Pandoc 2.14.1 (thanks, @dewittpe, #1223).

  • When a book has multiple authors, the CSS styles for each author were inlined in the <p> tags, and hence are hard to override. Now the class multi-author is applied to each individual author's <p> tag, and the CSS rules are defined on this class instead (thanks, @robjhyndman, #1170).

  • Style change in bs4_book() where code block inside callout blocks will have their background fill the whole width of the bordered block (#1175).

  • In bs4_book(), math in footnotes is now rendered (@mine-cetinkaya-rundel, #1026)

  • Fix an issue with bs4_book() where text written using Line Block was not found in search (thanks, @dmklotz, #1141).

bookdown 0.22

22 Apr 13:59
Compare
Choose a tag to compare

NEW FEATURES

  • New bs4_book() theme - see ?bs4_book for details about this new format (thanks, @hadley, #996).

  • render_book() can now take a directory as input, i.e render_book("book_dir"), to render in this directory by using the index.Rmd file if it exists. The default is now to look for input.Rmd is the current working directory. Previously, filename must have been provided (render_book() is now equivalent to render_book("index.Rmd")) (#990).

  • hypothesis environment is now supported among Theorems and Proof (thanks, @shirdekel, #1102).

  • In _bookdown.yaml, label fields fig, tab and eq can now take a function as ui fields chapter_name and appendix. This function takes the reference number as only argument and must return a character to be used as full label. The default is a string prepended before the reference number. This new feature gives more flexibility to change the default for other language, e.g append the label name after the number. See updated doc about Internationalization(thanks, Tamás Ferenc, #1114)

  • Using the 'Knit' button now also works with a Rmd file in a sub-directory of the book project (when rmd_subdir is used in _bookdown.yml) (#1122)

  • WhatsApp sharing feature has been added for gitbook() using sharing key in config. This enables sharing the bookdown URL in Whatsapp on Mobile and on Desktop (thanks, @prdm0, #1125).

BUG FIXES

  • Adapt CSS in gitbook() and html_book() for correct diplaying of <details><summary> content (thanks, @maelle, #971)

  • When split_bib = TRUE, references in footnotes are now also correctly relocated in the chapter (thanks, @jimhshen, #952)

  • In pdf_book(), toc_bib = TRUE now works with natbib and biblatex as citation_package (thanks, @qifei9, @umarcor, #450).

  • CSS dependencies like url('truetype/Spectral-ExtraLight.ttf') (with single quotes) are now correctly identified and moved (thanks, @RLesur, #991).

  • fenced_theorems() now correctly transforms implicit label in chunk header to a fenced divs id. (thanks, @Enixam, #982)

  • References are now correctly relocated with Pandoc 2.11 when split_bib = TRUE in gitbook(). New citation processing in Pandoc 2.11 will also add new classes to the divs, and these are preserved when relocating. This allows for references styling using CSS (#981).

  • The new syntax for theorem and proof environments introduced in bookdown requires Pandoc >= 2.3 instead of 2.0 (thanks, @markhymers, #979 #980).

  • serve_book() will refresh correctly now when using subdirectories with rmd_subdir (thanks, @shenfei, #834).

  • Added the same CSS as in default Pandoc's template for when a CSL is used (#1045).

  • Properly support multiple authors in the gitbook() output format (thanks, @adamvi, #1095).

  • No more warnings are thrown when passing several input files to render_book(preview = TRUE) (#1091).

  • Correctly remove reference IDs of tables (e.g (#tab:lab)) generated by custom function (like gt::gt()) (#1099).

  • In sepia or night mode, the background color during sidebar transition is now correct and no more white (#1100).

  • Fix an issue in bs4_book() with encoding on system non-UTF8 by default (#1027).

MINOR CHANGES

  • anchor_sections = TRUE becomes the default for bookdown::gitbook().