-
Notifications
You must be signed in to change notification settings - Fork 0
/
example-template.qmd
89 lines (64 loc) · 2.36 KB
/
example-template.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
79
80
81
82
83
84
85
86
87
88
89
# Protocol Title
::: callout-note
Description of protocol, sources (modified from NRCS protocol, for example), last edited by and date
:::
## Materials
- Bulleted list of materials
## Procedure
- Bulleted or numbered list of steps
## References and Notes
If applicable
# Helpful Formatting Code
::: callout-note
xxx
:::
::: callout-tip
xxx
:::
Inserting a figure ![Water Retention Curve](water-retention-curve-Picture1.png){#fig-waterretention}
**Bold text**
*Italicized text*
~~Strikethrough text~~
\[ \] Checklist
# Title case (1-5 pound signs, more = smaller)
Table, if necessary (example taken from Basic Soils Lab Manual)
```{r, echo = FALSE, message = FALSE, warning = FALSE}
library(huxtable)
library(dplyr)
################
## BUILD TABLE
################
Clay <- c("Kaolinite (1:1)", "Smectite (2:1)")
Drawing <- c("","")
claydrawing <- data.frame(Clay, Drawing)
colnames(claydrawing) = c("Clay", "Drawing")
col.num = 2
row.num = 3 #including header
################
## SET AS HUXTABLE TYPE
################
claydrawing_ht <- as_hux(claydrawing)
################
## SET FORMATTING
################
#NOTE: only thing you really need to mess with down here is the padding. If you need extra row height, keep them - if not, just put a hastag in front of them
tab1.1 = claydrawing_ht %>%
set_all_padding(4) %>%
set_outer_padding(0) %>%
set_number_format(0) %>% #this tells it how many decimals to print after any numbers
set_bold(row = 1, col = everywhere) %>% #make header row bold
#set_bottom_border(row = 1, col = everywhere) %>% # probably dont need this because you set all borders below
set_width(0.9) %>% #; 1 == full width
set_align(row = 1:row.num, col = 1:col.num, value = 'center') %>%
set_valign(row = 1:row.num, col = 1:col.num, value = 'middle') %>%
#set_number_format(2:3, 1, value = NA) %>% #; don't format these cells as numbers
#set_col_width(c(0.3, 0.6)) %>%
set_latex_float(value = "h!") %>%
#set_row_height(1:3, c(0.02, 0.2, 0.2)) %>%
set_bottom_padding(row = 2:3, col= 1:2, 60) %>%
set_top_padding(row = 2:3, col = 1:2, 60) %>%
#set_row_height(c(0.02, 0.2, 0.2)) %>%
set_all_borders(brdr(1, "solid", "black"))
#set_caption("Pots of jam for sale") # this is if we want a caption - I don't think we need any captions but leaving it here just in case
tab1.1
```