-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathREADME.qmd
55 lines (41 loc) · 1.6 KB
/
README.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
format: gfm
---
<!-- README.md is generated from README.qmd. Please edit that file -->
```{r}
#| include: false
# Create pdf and png version of template
library(tidyverse)
library(quarto)
library(magick)
# Render template
fs::file_copy("_extensions/letter/sigfile.png", "sigfile.png", overwrite = TRUE)
system("sed -i 's/^#signature/signature/' template.qmd")
quarto_render(input = "template.qmd")
system("sed -i 's/^signature/#signature/' template.qmd")
fs::file_delete(c("AACSB.png","AMBA.png","EQUIS.png","MBSportrait.jpg","monash2.png","sigfile.png"))
# Convert rendered PDF to PNG
image_read_pdf("template.pdf", pages = 1) |>
image_montage(geometry = "x1000+25+35", tile = 1, bg = "grey92", shadow = TRUE) |>
image_convert(format = "png") |>
image_write("examples/template.png")
# Move pdf to examples folder
fs::file_move("template.pdf", "examples/template.pdf")
```
# Monash Letter Format Template
This is a Quarto template that assists you in creating a letter on Monash University letterhead
## Creating a new letter
You can use this as a template to create a letter.
To do this, use the following command:
```bash
quarto use template quarto-monash/letter
```
This will install the extension and create an example qmd file that you can use as a starting place for your letter.
## Installation for existing document
You may also use this format with an existing Quarto project or document.
From the quarto project or document directory, run the following command to install this format:
```bash
quarto install extension quarto-monash/letter
```
## Example
[![](examples/template.png)](examples/template.pdf)