rmarkdown::output_format_dependency(): An Easier Way to Customize Output Formats for R Markdown

Original link: https://yihui.org/en/2023/08/output-format-dependency/

logo.png

Traditionally there are two main ways to customize R Markdown output formats:
One is to use the options of an existing output format, eg, set toc: true
for html_document ; the other is to define a new output format
function
based on
rmarkdown::output_format() , which usually requires you to develop an R package
because that’s the best place to host the function.

The first way can be limited—you can only customize the things that are given
to you. The second way gives you complete freedom but is also too advanced, and
not everyone wants to develop an R package only for the purpose of a customize R
Markdown output format. The two ways are two extremes. Is there a compromise?

Yes, Atusy has made it
possible
in rmarkdown 2.24.
With the new function rmarkdown::output_format_dependency() , you can enjoy the
(almost) full freedom of customization without having to develop an R package.
He has kindly written a blog
post

about it, which I’d strongly recommend to R Markdown users who desire deeper
customization. Thanks, Atusy!

This article is transferred from: https://yihui.org/en/2023/08/output-format-dependency/
This site is only for collection, and the copyright belongs to the original author.