-
Notifications
You must be signed in to change notification settings - Fork 7
/
symbols.Rmd
130 lines (88 loc) · 2.57 KB
/
symbols.Rmd
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
title: "Tips & Tricks: Including Symbols, Superscripts, Subscripts & Line Breaks"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Tips & Tricks: Including Symbols, Superscripts, Subscripts & Line Breaks}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
# Symbols
Symbols can be added to the label column via unicode. Here is a quick reference to commonly used symbols.
```{r setup, echo = FALSE}
library(huxtable)
opath <- "."
df <- tibble::tribble(
~Symbol, ~`Textual Description`, ~Unicode,
"\u2190", "Left arrow", "\\u2190",
"\u2192", "Right arrow", "\\u2192",
"\u2264", "Less-than or equal to", "\\u2264",
"\u2265", "Greater-than or equal to", "\\u2265",
"\u2260", "Not equal to", "\\u2260",
"\u00b1", "Plus-minus sign", "\\u00b1",
"\u03b1", "Alpha", "\\u03b1",
"\u03b2", "Beta", "\\u03b2",
"\u03bc", "Mu", "\\u03bc",
"\u00ab", "Non-breaking space", "\\u00ab"
)
df
# quick_rtf(hux(df),
# file = "./test.rtf")
#
#
```
Here is an example call to tidytlg::gentlg() that will add the symbols to the label column.
```{r eval = FALSE}
df <- tibble::tibble(
label = c("\u2264", "\u2265"),
col1 = c("100", "200")
)
tidytlg::gentlg(df,
file = "demo")
```
# Superscripts and Subscripts
Superscripts and Subscripts can be added to the label column via unicode.
```{r eval = FALSE}
df <- tibble::tibble(
label = c("This is a superscript a{\\super a}",
"This is a subscript b{\\sub b}"),
col1 = c("100", "200")
)
tidytlg::gentlg(df,
file = "demo")
```
Superscripts and Subscripts can be added to the footnotes via unicode as well.
```{r eval = FALSE}
df <- tibble::tibble(
label = c("This is a superscript a{\\super a}",
"This is a subscript b{\\sub b}"),
col1 = c("100", "200")
)
tidytlg::gentlg(df,
file = "demo",
footers = "This is a footnote superscript{\\super a}")
```
# Inline RTF Line Breaks
Sometimes you need add a line break into your RTF. Inserting '\\\\\\n' into your string will add your line break for you.
```{r eval = FALSE}
df <- tibble::tibble(
label = c("Bodysystem \\\n Preferred Term"),
col1 = c("100")
)
tidytlg::gentlg(df,
file = "demo")
```
If you need a line break followed by a tab, just add in '\\\\li180'.
```{r eval = FALSE}
df <- tibble::tibble(
label = c("Bodysystem\\\n\\li180Preferred Term"),
col1 = c("100")
)
tidytlg::gentlg(df,
file = "demo")
```