-
Notifications
You must be signed in to change notification settings - Fork 13
/
makeExampleFiles.sh
executable file
·117 lines (105 loc) · 6.29 KB
/
makeExampleFiles.sh
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
#!/bin/bash
tmpdir=tmp
mkdir -p $tmpdir
compile(){
latexmk -c
xelatex tmp.tex
bibtex tmp
xelatex tmp.tex
xelatex tmp.tex
}
# 以假粗体实现粗体生成的文档更接近 MS Word 的感觉,但似乎可能出现奇奇怪怪的问题(如部分字无法选中、该加粗的字没有加粗、不该加粗的字加粗了等)
# STSong, SimSun, NSimSun, SimSun-ExtB, Adobe Song Std
# documentclass 需设置 AutoFakeBold, jluthesis2020 需设置 manualSpine, 需重置CJKmainfont
sed 's/\documentclass\[.*\]/\documentclass\[oneside,a4paper,12pt,AutoFakeBold\]/' example.tex | \
sed 's/^\\usepackage\[.*\]{jluthesis2020}/\\usepackage\[amd,ebook,manualSpine\]{jluthesis2020}/' | \
sed 's/\\usepackage{listings}/\\usepackage{listings}\n\\setCJKmainfont{Adobe Song Std}\n\\setCJKfamilyfont{song}{Adobe Song Std}/' |\
sed 's/\\jluCDegree{.*} /\\jluCDegree{工学硕士}/' |\
sed 's/\\jluCSubject{.*} /\\jluCSubject{计算机应用技术}/' |\
sed 's/\\jluCSubjectScd{.*} /\\jluCSubjectScd{计算机应用技术}/' |\
sed 's/\\jluCSubjectTrd{.*} /\\jluCSubjectTrd{计算机应用技术}/' |\
sed 's/\\jluCInterest{.*} /\\jluCInterest{数据挖掘}/' |\
sed 's/^\\jluCSpineTitle{\\jluPrintSpine{\\jluPrintSpineChinese{/% \\jluCSpineTitle{\\jluPrintSpine{\\jluPrintSpineChinese{/' |\
sed 's/% \\jluManualSpine{/\\jluManualSpine{/' |\
sed -z "$(echo 's/%[ \t]*\\jluPrintVerticallyOneByOne{/\t\\jluPrintVerticallyOneByOne{/'{4..1}\;)" |\
sed -z 's/%[ \t]*\\jluPrintVerticallySentence{/\t\\jluPrintVerticallySentence{/' |\
sed -z 's/%[ \t]*} % jluManualSpine/} % jluManualSpine/' \
> tmp.tex
compile
mv tmp.pdf $tmpdir/amd-ebook-oneside-假粗体.pdf
mv tmp.tex $tmpdir/amd-ebook-oneside-假粗体.tex
sed 's/\documentclass\[.*\]/\documentclass\[oneside,a4paper,12pt\]/' example.tex | \
sed 's/^\\usepackage\[.*\]{jluthesis2020}/\\usepackage\[amd,ebook\]{jluthesis2020}/'|\
sed 's/\\jluCDegree{.*} /\\jluCDegree{工学硕士}/' |\
sed 's/\\jluCSubject{.*} /\\jluCSubject{计算机应用技术}/' |\
sed 's/\\jluCSubjectScd{.*} /\\jluCSubjectScd{计算机应用技术}/' |\
sed 's/\\jluCSubjectTrd{.*} /\\jluCSubjectTrd{计算机应用技术}/' |\
sed 's/\\jluCInterest{.*} /\\jluCInterest{数据挖掘}/' > tmp.tex
compile
mv tmp.pdf $tmpdir/amd-ebook-oneside.pdf
sed 's/\documentclass\[.*\]/\documentclass\[twoside,a4paper,12pt\]/' example.tex | \
sed 's/^\\usepackage\[.*\]{jluthesis2020}/\\usepackage\[phdfancy,ebook,twoSideCover\]{jluthesis2020}/' |\
sed 's/\\jluCDegree{.*} /\\jluCDegree{工学博士}/' |\
sed 's/\\jluCSubject{.*} /\\jluCSubject{计算机应用技术}/' |\
sed 's/\\jluCSubjectScd{.*} /\\jluCSubjectScd{计算机应用技术}/' |\
sed 's/\\jluCSubjectTrd{.*} /\\jluCSubjectTrd{计算机应用技术}/' |\
sed 's/\\jluCInterest{.*} /\\jluCInterest{数据挖掘}/' > tmp.tex
compile
mv tmp.pdf $tmpdir/phdfancy-ebook-twoSideCover.pdf
sed 's/\documentclass\[.*\]/\documentclass\[twoside,a4paper,12pt\]/' example.tex | \
sed 's/^\\usepackage\[.*\]{jluthesis2020}/\\usepackage\[phdplain,hardcopy\]{jluthesis2020}/' |\
sed 's/\\jluCDegree{.*} /\\jluCDegree{工学博士}/' |\
sed 's/\\jluCSubject{.*} /\\jluCSubject{计算机应用技术}/' |\
sed 's/\\jluCSubjectScd{.*} /\\jluCSubjectScd{计算机应用技术}/' |\
sed 's/\\jluCSubjectTrd{.*} /\\jluCSubjectTrd{计算机应用技术}/' |\
sed 's/\\jluCInterest{.*} /\\jluCInterest{数据挖掘}/' > tmp.tex
compile
mv tmp.pdf $tmpdir/phdplain-hardcopy.pdf
sed 's/\documentclass\[.*\]/\documentclass\[twoside,a4paper,12pt\]/' example.tex | \
sed 's/^\\usepackage\[.*\]{jluthesis2020}/\\usepackage\[phdplain,hardcopy,twoSideCover,onlyCover\]{jluthesis2020}/' |\
sed 's/\\jluCDegree{.*} /\\jluCDegree{工学博士}/' |\
sed 's/\\jluCSubject{.*} /\\jluCSubject{计算机应用技术}/' |\
sed 's/\\jluCSubjectScd{.*} /\\jluCSubjectScd{计算机应用技术}/' |\
sed 's/\\jluCSubjectTrd{.*} /\\jluCSubjectTrd{计算机应用技术}/' |\
sed 's/\\jluCInterest{.*} /\\jluCInterest{数据挖掘}/' > tmp.tex
compile
mv tmp.pdf $tmpdir/phdplain-hardcopy-twoSideCover-onlyCover.pdf
sed 's/\documentclass\[.*\]/\documentclass\[oneside,a4paper,12pt\]/' example.tex | \
sed 's/^\\usepackage\[.*\]{jluthesis2020}/\\usepackage\[pmd,hardcopy,onlyCover\]{jluthesis2020}/' |\
sed 's/\\jluCDegree{.*} /\\jluCDegree{工程硕士}/' |\
sed 's/\\jluCSubject{.*} /\\jluCSubject{工程硕士}/' |\
sed 's/\\jluCSubjectScd{.*} /\\jluCSubjectScd{计算机技术}/' |\
sed 's/\\jluCSubjectTrd{.*} /\\jluCSubjectTrd{计算机技术}/' |\
sed 's/\\jluCInterest{.*} /\\jluCInterest{计算机技术}/' > tmp.tex
compile
mv tmp.pdf $tmpdir/pmd-hardcopy-onlyCover.pdf
sed 's/\documentclass\[.*\]/\documentclass\[twoside,a4paper,12pt\]/' example.tex | \
sed 's/^\\usepackage\[.*\]{jluthesis2020}/\\usepackage\[pmd,hardcopy\]{jluthesis2020}/'|\
sed 's/\\jluCDegree{.*} /\\jluCDegree{工程硕士}/' |\
sed 's/\\jluCSubject{.*} /\\jluCSubject{工程硕士}/' |\
sed 's/\\jluCSubjectScd{.*} /\\jluCSubjectScd{计算机技术}/' |\
sed 's/\\jluCSubjectTrd{.*} /\\jluCSubjectTrd{计算机技术}/' |\
sed 's/\\jluCInterest{.*} /\\jluCInterest{计算机技术}/' > tmp.tex
compile
mv tmp.pdf $tmpdir/pmd-hardcopy-twoside.pdf
sed 's/\documentclass\[.*\]/\documentclass\[twoside,a4paper,12pt\]/' example.tex | \
sed 's/^\\usepackage\[.*\]{jluthesis2020}/\\usepackage\[pmd,hardcopy,noBlankPages\]{jluthesis2020}/'|\
sed 's/\\jluCDegree{.*} /\\jluCDegree{工程硕士}/' |\
sed 's/\\jluCSubject{.*} /\\jluCSubject{工程硕士}/' |\
sed 's/\\jluCSubjectScd{.*} /\\jluCSubjectScd{计算机技术}/' |\
sed 's/\\jluCSubjectTrd{.*} /\\jluCSubjectTrd{计算机技术}/' |\
sed 's/\\jluCInterest{.*} /\\jluCInterest{计算机技术}/' > tmp.tex
compile
mv tmp.pdf $tmpdir/pmd-hardcopy-twoside-noBlankPages.pdf
sed 's/\documentclass\[.*\]/\documentclass\[oneside,a4paper,12pt\]/' example.tex | \
sed 's/^\\usepackage\[.*\]{jluthesis2020}/\\usepackage\[amd,hardcopy\]{jluthesis2020}/'|\
sed 's/\\jluCDegree{.*} /\\jluCDegree{工学硕士}/' |\
sed 's/\\jluCSubject{.*} /\\jluCSubject{计算机应用技术}/' |\
sed 's/\\jluCSubjectScd{.*} /\\jluCSubjectScd{计算机应用技术}/' |\
sed 's/\\jluCSubjectTrd{.*} /\\jluCSubjectTrd{计算机应用技术}/' |\
sed 's/\\jluCInterest{.*} /\\jluCInterest{数据挖掘}/' > tmp.tex
compile
./makeCrosscheckVersion.sh tmp
mv tmp-CrosscheckVersion.pdf $tmpdir/amd-hardcopy-CrosscheckVersion.pdf
rm example_files/*
mv $tmpdir/* example_files/