Skip to content

Commit

Permalink
I think I have gotten all option names from https://github.com/quarto…
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Aug 29, 2023
1 parent 9f79f55 commit 4816cb8
Show file tree
Hide file tree
Showing 2 changed files with 16 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: knitr
Type: Package
Title: A General-Purpose Package for Dynamic Report Generation in R
Version: 1.43.9
Version: 1.43.10
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
person("Abhraneel", "Sarma", role = "ctb"),
Expand Down
17 changes: 15 additions & 2 deletions R/defaults.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,27 @@ opts_chunk_attr = local({
opts$fig.ext = as.list(unique(auto_exts))
opts$external = opts$sanitize = NULL # hide these two rare options
opts$fig.process = 'function'
opts$fig.asp = 'numeric'
opts$fig.alt = 'character'
opts[c('fig.asp', 'fig.ncol')] = 'numeric'
opts$fig.dim = 'list'
opts$fig.id = 'logical'
opts[c(
'opts.label', 'resize.width', 'resize.height', 'fig.alt', 'fig.link', 'fig.sep',
'ffmpeg.bitrate', 'ffmpeg.format'
)] = 'character'
opts$lang = 'list'
opts$R.options = 'list'
opts$cache.comments = 'logical'
opts$cache.globals = 'list'
opts$animation.hook = list('ffmpeg', 'gifski')
for (i in c('class', 'attr')) {
for (j in c('source', 'output', 'message', 'warning', 'error', 'chunk')) {
opts[[paste(i, j, sep = '.')]] = 'character'
}
}
# for R Markdown paged tables
opts[paste0(c(
'max', 'sql.max', 'paged', 'rows', 'cols', 'cols.min', 'pages', 'paged', 'rownames'
), '.print')] = 'numeric'
opts
})

Expand Down

5 comments on commit 4816cb8

@cderv
Copy link
Collaborator

@cderv cderv commented on 4816cb8 Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are missing fig.num - can we add it ?

@yihui
Copy link
Owner Author

@yihui yihui commented on 4816cb8 Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Please go ahead.

@cderv
Copy link
Collaborator

@cderv cderv commented on 4816cb8 Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have a doubt... is fig.num internal option ? If so where should it be listed ?

@yihui
Copy link
Owner Author

@yihui yihui commented on 4816cb8 Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I think you are right. Normally users shouldn't set this option.

@cderv
Copy link
Collaborator

@cderv cderv commented on 4816cb8 Oct 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I guess - Quarto tries to have list of all knitr options using this :
https://github.com/quarto-dev/quarto-cli/blob/3bfd5dc4c4e11fab5e60a4615ad8bd32d6f77084/src/resources/rmd/hooks.R#L308

I'll keep some internal knitr option in the separate list then

Please sign in to comment.