-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathindex.Rmd
83 lines (74 loc) · 2.47 KB
/
index.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
```{r setup, include=FALSE}
# 为了让日期显示为英文
localedate = Sys.setlocale(category = "LC_TIME", locale = 'en_US.UTF-8')
# 添加索引引擎 zhmakeindex
sysname = Sys.info()['sysname'][[1]]
machine = Sys.info()['machine'][[1]]
if (grepl('Linux', sysname)){
if (system('hash zhmakeindex 2>/dev/null') == 0) {
zhmakeindex = 'zhmakeindex'#存在zhmakeindex
} else if (grepl('64', machine))
zhmakeindex = './bin/linux_x64/zhmakeindex'
else
zhmakeindex = './bin/linux_x86/zhmakeindex'
} else if (grepl('Windows', sysname)){
if (grepl('64', machine))
zhmakeindex = './bin/windows_x64/zhmakeindex.exe'
else
zhmakeindex = './bin/windows_x86/zhmakeindex.exe'
} else if (grepl('Darwin', sysname)){
if (system('hash zhmakeindex 2>/dev/null') == 0) {
zhmakeindex = 'zhmakeindex'#存在zhmakeindex
} else if (grepl('64', machine))
zhmakeindex = './bin/darwin_x64/zhmakeindex'
else
zhmakeindex = './bin/darwin_x86/zhmakeindex'
} else {
zhmakeindex = 'makeindex'#其他操作系统不存在zhmakeindex
}
options(
htmltools.dir.version = FALSE, formatR.indent = 2, width = 55, digits = 4, tinytex.makeindex = zhmakeindex, tinytex.makeindex.args = '-s imakeidx.ist'
)
# 生成依赖包
knitr::write_bib(c(
.packages(), 'bookdown', 'knitr', 'rmarkdown', 'htmlwidgets', 'webshot', 'DT',
'miniUI', 'tufte', 'servr', 'citr', 'rticles','magick'
), 'bib/packages.bib')
# 支持图片标题双语言,为了排版优化,强制加入 \centering
# https://github.com/yihui/knitr/issues/1554
library(knitr)
knit_hooks$set(plot = function(x, options) {
if(!is.null(options$bicap)){
paste("\\begin{figure}[!htp]",
"\n\\centering",
hook_plot_tex(x, options),
"\n\\bicaption{", options$bicap[1], "}{",options$bicap[2],"}",
"\n\\end{figure}", sep = "")
}
else{
hook_plot_tex(x, options)
}
})
```
---
title: "深度易经"
englishtitle: "Deepin Bible"
author: "深度操作系统爱好者"
date: "`r format(Sys.Date(),format='%Y年%m月%d日')`"
keywords: "深度\\quad Linux \\quad Deepin\\quad 操作指南"
documentclass: sjtuthesis
classoption: [doctor, openright, twoside]
bibliography: [bib/book.bib, bib/packages.bib]
biblio-style: apalike
link-citations: yes
colorlinks: yes
lot: yes
lof: yes
site: bookdown::bookdown_site
description: "深度操作系统的简单介绍"
github-repo: bubifengyun/deepin-bible
href2footnote: false
cover-image: images/cover.jpg
publisher: 尚未出版
always_allow_html: true
---