You can install the development version of qmdtemplate from
GitHub with:
# install.packages("devtools")
devtools::install_github("elizabethjump/qmdtemplate")You should also make sure you have an up to date version of Quarto (the program, not the package) installed. Download that here.
This R package has one function: create_qmd(). This function will
create a new Quarto document that has been pre-formatted using Typst.
Usage:
library(qmdtemplate)
create_qmd(file_name = "Quarterly",
ext_type = "short_report_pdf")You can watch this video to see the expected behavior. This GIF was made
with an earlier version of the package that had an extension type of
"typst_pdf". That extension has been replaced with
"short_report_typst"
If you’d like to create your own package that does something similar, you can copy the R code and folder structure from this package. The examples included here are all for Quarto documents formatted with Typst but you can adjust that as desired in your own copy. If you’ve never built an R package before, I suggest you follow the instructions in the R Packages (2e) book.
- Quarto and Typst: Posit overview for formatting Quarto documents with Typst
- Typst website: has an overview of Typst, tutorials and guides to functions
- Quarto Typst templates: repo of Quarto Typst templates from the Typst team
- SMC resources: our repo we made with some lessons learned from formatting with Typst
Huge shoutout to Meghan Hall who did something similar and shared her work at Posit::conf(2024). Her presentation is the inspiration for this project.
