knitr 1.30
NEW FEATURES
-
Added
knitr::hooks_*()
functions to get a list of output hooks for a specific format. Previously, these hooks only exist inside theknitr::render_*()
functions, and users do not have direct access to them. Now they can be accessed directly, e.g., viaknitr::hooks_markdown()
to get a list of output hooks for R Markdown documents. You can also set the output hooks individually, e.g.,knitr::knit_hooks$set(knitr::hooks_markdown()['source'])
only sets the source ouput hook. See more on output hooks at https://yihui.org/knitr/hooks/#output-hooks and https://bookdown.org/yihui/rmarkdown-cookbook/output-hooks.html (thanks, @cderv, #1889). -
Added an argument
lib.loc
toknitr::write_bib()
.
BUG FIXES
-
The option
fig_caption = FALSE
forrmarkdown::html_document()
was unable to suppress the figure captions in some cases. -
The internal function
fix_options()
should be called after option hooks are executed (thanks, @atusy, #1876 and #1877). -
When the option
options(OutDec = )
is set to a value other than"."
, percentages in the chunk optionsout.width
andout.height
do not work (thanks, @omgitsmoe, #1887).
MINOR CHANGES
-
knitr::write_bib()
removes pairs of single quotes in the titles of citation entries now. -
knitr::write_bib()
uses theURL
in the packageDESCRIPTION
if it is provided, instead of the canonical CRAN URL for the package. -
hook_pdfcrop()
andplot_crop()
will work only when both programspdfcrop
andghostscript
have been installed. Previously onlypdfcrop
was checked (thanks, @dalupus, #954).