-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.rmd
155 lines (93 loc) · 3 KB
/
main.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
title: SUSTech thesis R Markdown template
author: Xie Zejian
bibliography: ["ref.bib","packages.bib"]
关键词: "关键词1,关键词2"
keywords: "\\LaTeX, R Markdown, pandoc"
摘要: "中文的摘要"
abstract: "\\lipsum[1]"
output:
bookdown::pdf_book:
toc: false
latex_engine: xelatex
keep_tex: true
template: "template.tex"
includes:
in_header: ["config/preamble.tex","config/info.tex"]
always_allow_html: true
link-citations: yes
linkcolor: blue
links-as-notes: false
csl: "./china-national-standard-gb-t-7714-2015-modified.csl"
---
```{r, setup, include=FALSE}
knitr::opts_chunk$set(warning=FALSE,
message=FALSE,
echo=FALSE,
fig.width=8)
## collapse = TRUE
# dec = 'jpeg'
# eval = FALSE
# https://yihui.org/knitr/options/#chunk-options
```
The following are useful for understanding R Markdown:
- [Authoring Books and Technical Documents with R Markdown](https://bookdown.org/yihui/bookdown/)
- [R Markdown: The Definitive Guide](https://bookdown.org/yihui/rmarkdown/)
- [R Markdown Cookbook](https://bookdown.org/yihui/rmarkdown-cookbook/)
# Markdown Syntax
**EMTH**, *Italic*, H~2~SO~4~, Fe^2+^, Footnote^[Some footnote]
- list
- list
1. Numbered list
1. Numbered list
a. Alternative numbered list
b. Alternative numbered list
Inline Math $a^2+b^2$, Math block:
$$
\sum_{i=1}^{\infty}\frac{1}{n^2}=\frac{\pi^2}{6}
$$
# Markdown extensions by bookdown
Bookdown supply an extension of pandoc, which is already a superset of plain markdwon and TeX.
## Cross reference and citation
@R-bookdown supply a neat way to do cross citation of "theorems"(or numbered environment) and proofs(or unnumbered environment), in which you can write anything freely(even recursively)[@bookdown2016; @rmarkdown2020].
Check source code of theorem \@ref(thm:t1), figure \@ref(fig:fig1), table \@ref(tab:tab1) to see how they work.
We refer to [here](https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html#theorems) for all supported environments.
::: {.theorem #t1 name="Fermat's Last Theorem"}
For $n\ge 2$, there is no $a,b,c\in \mathbb{N}^* \text{ s.t. }$
$$
a^{n}+b^{n}=c^{n}
$$
:::
:::: {.proof}
I have discovered a truly marvelous proof of this, which this margin is too narrow to contain
::::
```{r fig1, fig.align = "center", fig.cap="Text figures", out.width = '70%'}
knitr::include_graphics("figures/example-image-a.png")
```
```{r tab1}
knitr::kable(
head(mtcars[, 1:8], 10), booktabs = TRUE,
caption = 'A table of the first 10 rows of the mtcars data.'
)
```
# Chapter
```{=latex}
\lipsum[1]
```
```{=latex}
\clearpage
\参考文献
```
<div id="refs"></div>
\newpage
# (APPENDIX) Appendix {-}
# Code
Attach code used here
```{python, file="code/examples/utils.py", eval=FALSE,echo=TRUE}
```
\newpage
# 致谢 {-}
This repo credit to:
- [sustechthesis](https://github.com/iydon/sustechthesis)
- [bookdown](https://github.com/rstudio/bookdown)
- [tinytex](https://github.com/yihui/tinytex)