## 17.4 Sharing your templates

As templates are stored within packages, it is easy to distribute them to other users. The most common and recommended way is to publish such packages to CRAN. If you decide not to take this way, you may also consider using GitHub to host your package instead, in which case users can also easily install your package and templates:

if (!requireNamespace("devtools")) install.packages("devtools")
devtools::install_github("username/packagename")

To find out more about packages and the use of GitHub, you may refer to the book “R Packages (http://r-pkgs.had.co.nz/git.html).

If you need some inspiration, there are many examples on CRAN and GitHub providing document templates, such as tufte (Chapter 6), prettydoc (Section 9.1), rticles (Chapter 13), memor, and rtemps, etc.

### References

Wickham, Hadley. 2015. R Packages. 1st ed. O’Reilly Media, Inc.