Skip to content

Commit e9f82a1

Browse files
authored
For pandoc 3.0+, use --split-level when chapter_level is passed in epub_book (#1425)
1 parent 04337a0 commit e9f82a1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
- Fix an issue with CSL using hanging indent style in `gitbook()` (thanks, @pablobernabeu, #1422).
44

5+
- Adapt an `epub_book()` internal command-line argument passed to Pandoc for changes from version 3.0 and above (#1425).
6+
57
- Fix an issue with Pandoc 2.19 not rendering math by default in `epub3` format (#1417).
68

79
# CHANGES IN bookdown VERSION 0.33

R/ebook.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ epub_book = function(
4646
if (!is.null(cover_image)) c('--epub-cover-image', cover_image),
4747
if (!is.null(metadata)) c('--epub-metadata', metadata),
4848
if (!identical(template, 'default')) c('--template', template),
49-
if (!missing(chapter_level)) c('--epub-chapter-level', chapter_level),
50-
if (rmarkdown::pandoc_available("2.19") && epub_version == "epub3") c("--mathml")
49+
if (rmarkdown::pandoc_available('2.19') && epub_version == 'epub3') c('--mathml'),
50+
if (!missing(chapter_level))
51+
c(if (rmarkdown::pandoc_available('3.0')) '--split-level' else '--epub-chapter-level', chapter_level)
5152
)
5253
if (is.null(stylesheet)) css = NULL else {
5354
css = rmarkdown::pandoc_path_arg(epub_css(stylesheet))

0 commit comments

Comments
 (0)