-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.qmd
80 lines (55 loc) · 2.59 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
format: gfm
---
<!-- README.md is generated from README.qmd. Please edit that file -->
# Quarto template for ANU Report
This repository contains the Quarto template for ANU report.
## Getting started
1. Install [Quarto](https://quarto.org/docs/get-started/).
2. You may need to install Public Sans font if you do not have it. You can find it [here](https://github.com/anuopensci/quarto-anu-report/tree/main/_extensions/anu-report/assets/webfonts).
3. The easiest way to edit and render the document is using the [RStudio IDE](https://posit.co/download/rstudio-desktop/). If you prefer not to install R, then you can use VS Code instead.
4. From the Terminal run the following command
```bash
quarto use template anuopensci/quarto-anu-report
```
This will install the extension and create an example qmd file that you can use as a starting place for your report.
## Format Options
There are three formats available: pdf, html and docx. The docx only contains the styles.
```{r}
#| include: false
# Create pdf and png version of template
library(quarto)
library(magick)
# Render template
quarto_render(input = "template.qmd", output_format = "all")
webshot2::webshot("template.html",
file = "examples/template-html.png",
vwidth = 1000,
vheight = 900,
zoom = 0.7,
cliprect = "viewport")
image_read("examples/template-html.png") |>
image_montage(geometry = "x2000+25+35",
tile = "1x1",
bg = "grey92",
shadow = TRUE) |>
image_convert(format = "png") |>
image_write("examples/template-html.png")
## Code below inspired by Rob Hyndman
# Convert rendered PDF to PNG
image_read_pdf("template.pdf") |>
image_montage(geometry = "x2000+25+35",
tile = "1x1",
bg = "grey92",
shadow = TRUE) |>
image_convert(format = "png") |>
image_write("examples/template-pdf.png")
# Move pdf to examples folder
fs::file_move("template.pdf", "examples/template.pdf")
```
### `anu-report-html`
![](examples/template-html.png)
### `anu-report-pdf`
[![](examples/template-pdf.png)](examples/template.pdf)
### `anu-report-docx`
This docx file mimics the style format supplied for the docx report template from the [ANU Brand Identity Hub](https://anu365.sharepoint.com/sites/ANUidentityHUB). Currently, it only copies the style and not the formatting (title page, footer, etc) so it is recommended that you copy the output to the docx template provided by the ANU Brand Identity Hub. See also [`officeverse`](https://ardata-fr.github.io/officeverse/).