{minimalTemplate}
is a highly opinionated package to facilitate the production of docx files using RMarkdown. For now, this package has no commitment to the structure standards of the projects or R packages. Use at your own risk.
You can install the development version of {minimalTemplate}
with:
if(!require("remotes")) install.packages("remotes") remotes::install_github("kguidonimartins/minimalTemplate")
To use the full workflow of the {minimalTemplate}
, follow the steps below:
.docx
files (optional, but recommended)Set a new template using:
# load minimalTemplate library(minimalTemplate) # create a temporary directory (for a demo proposal only) tmp_proj <- file.path(tempdir(), "awesome-manuscript") # run `setup_template()` setup_template(tmp_proj)
The folder structure of the awesome-project
project is (this is not a mandatory structure):
if (!require("fs")) install.packages("fs") fs::dir_tree(path = tmp_proj, recurse = TRUE, all = TRUE)
Open the main-script.Rmd
file and press the Knit
button.
Set a new citation style using:
# First, search by your citation style using: (eco <- grep(pattern = "ecology", x = rcrossref::get_styles(), value = TRUE)) # then: download_csl(journal_style = eco[4], directory = "manuscript/sources/")
.docx
filesIn this step, I'm assuming you want to control the changes (files changes [text and code], entry of new analysis files) in your new project folder. Please, refer to this to learn how to configure git in your new project template.
To versioning your .docx
files, just run the function:
setup_wdiff()
This function is based on two git hooks (available here) to create a .md
copy of .docx
files and track the changes.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.