Repository navigation
Expand file tree
/
Copy pathreporter-title_header.Rmd
More file actions
54 lines (44 loc) · 1.55 KB
/
Copy pathreporter-title_header.Rmd
File metadata and controls
54 lines (44 loc) · 1.55 KB
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
---
title: "Example 8: Title Header"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Example 8: Title Header}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
### Table with a Title Header
A title header is a special type of title block. The title header displays
titles on the left side, and header information on the right side. The
title header can be defined with the `title_header()` function. This style of
header is preferred by some organizations.
```{r eval=FALSE, echo=TRUE}
library(reporter)
# Create temp file name
tmp <- file.path(tempdir(), "example8.rtf")
tbl <- create_table(mtcars[1:10, ], width = 7) %>%
title_header("Listing 4.0", "MTCARS Data Listing with Title Header",
right = c("Page [pg] of [tpg]", "Study: Cars"),
blank_row = "both")
# Create the report
rpt <- create_report(tmp, output_type = "RTF",
font = "Courier", font_size = 12) %>%
page_header(left = "Client: Motor Trend", right = "Study: Cars",
blank_row = "below") %>%
add_content(tbl) %>%
set_margins(top = 1, bottom = 1) %>%
footnotes("* Motor Trend, 1974") %>%
page_footer(left = Sys.time(),
center = "Confidential",
right = "Page [pg] of [tpg]")
# Write the report
write_report(rpt)
# file.show(tmp)
```
<img src="../man/images/e8.png" alt="Title Header example image"/>
Next: [Example 9: RTF, PDF, HTML, and DOCX](reporter-rtf.html)