Skip to content

Commit

Permalink
use cairo by default for bitmap devices if possible (rstudio/rmarkdow…
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Sep 19, 2024
1 parent 5f90567 commit 18ce5ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

- Added back/forward/refresh/print buttons to the toolbar in the `litedown::roam()` preview interface.

- Set `options(bitmapType = 'cairo')` in `fuse()` if `capabilities('cairo')` is TRUE, which will generate smaller bitmap plot files (e.g., `.png`) than using `quartz` or `Xlib`, and is also a safer option for `fuse()` to be executed in parallel (rstudio/rmarkdown#2561).

# CHANGES IN litedown VERSION 0.2

- A data frame (or matrix/tibble) wrapped in `I()` is fully printed to a table now by default. Without `I()`, data objects are truncated to 10 rows by default when printing to tables.
Expand Down
8 changes: 6 additions & 2 deletions R/fuse.R
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,12 @@ fiss = function(input, output = '.R', text = NULL) {
)
message('Quitting from ', get_loc(nms[k]))
}
# suppress tidyverse progress bars
opt = options(rstudio.notebook.executing = TRUE)
# suppress tidyverse progress bars and use cairo for bitmap devices (for
# smaller plot files and possible parallel execution)
opt = options(
rstudio.notebook.executing = TRUE,
bitmapType = if (capabilities('cairo')) 'cairo' else .Options$bitmapType
)
on.exit({ options(opt); on_error() }, add = TRUE)

# the chunk option `order` determines the execution order of chunks
Expand Down

0 comments on commit 18ce5ff

Please sign in to comment.