-
Notifications
You must be signed in to change notification settings - Fork 0
/
ch_appendix.Rmd
executable file
·51 lines (44 loc) · 1.27 KB
/
ch_appendix.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
```{r, results = "asis", echo = F}
x <- ""
if(opts_knit$get("rmarkdown.pandoc.to") == "latex"){
if(length(solLabels) != 0) {
if(all(is.na(do.call("rbind", solLabels)[, 2]))){
x <- "\\begin{comment}"
}
} else {
x <- "\\begin{comment}"
}
}
cat(x)
```
\newgeometry{margin=0.5in}
# (APPENDIX) Appendix {-}
# Answers
```{r, echo = F, results = "asis"}
if(length(solLabels) > 0) {
for(i in 1:length(solLabels)) {
if(!is.na(solLabels[[i]][2][1])) {
taskCtr <- solLabels[[i]][1]
refLabel <- solLabels[[i]][2]
headerName <- solLabels[[i]][3]
cat(paste0("\\hypertarget{sol", taskCtr, "}{}\n\\bblockS[", headerName, "]{\\phantomsection\\label{tsk", taskCtr, "}", taskCtr, "}\n"))
cat(refLabel)
cat(paste0("\n\n\\vspace{\\baselineskip}\\hyperlink{tsk", taskCtr, "}{\\buttonT{Return to task on P\\colpageref{sol", taskCtr, "}}}"))
cat("\n\\eblockS\n")
}
}
}
```
```{r, results = "asis", echo = F}
x <- ""
if(opts_knit$get("rmarkdown.pandoc.to") == "latex"){
if(length(solLabels) != 0) {
if(all(is.na(do.call("rbind", solLabels)[, 2]))){
x <- "\\end{comment}"
}
} else {
x <- "\\end{comment}"
}
}
cat(x)
```