Skip to content

Commit 0b6b588

Browse files
authored
update: twoside init (#36)
* update: twoside init * update: main.tex
1 parent 69ec4e2 commit 0b6b588

File tree

5 files changed

+92
-7
lines changed

5 files changed

+92
-7
lines changed

README-EN.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ The project has been configured with GitHub Actions in `.github/workflows/*.yaml
188188

189189
See [tongji-undergrad-thesis-env](https://github.com/TJ-CSCCG/tongji-undergrad-thesis-env) for detailed instructions.
190190

191+
## Use double-sided printing version (optional)
192+
193+
If you need to use the two-sided printing version, please change `\documentclass[oneside]{tongjithesis}` to `\documentclass[twoside]{tongjithesis}` in line 1 of `main.tex`.
194+
191195
## Use more complete Adobe fonts (optional)
192196

193197
### Style modification

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ pip install Pygments
192192

193193
详细使用方法见 [tongji-undergrad-thesis-env](https://github.com/TJ-CSCCG/tongji-undergrad-thesis-env)
194194

195+
## 使用双面打印版(可选)
196+
197+
如果您需要使用双面打印版,请在 `main.tex` 中将第 1 行的 `\documentclass[oneside]{tongjithesis}` 修改为 `\documentclass[twoside]{tongjithesis}`
198+
195199
## 使用字库更完整的 Adobe 字体(可选)
196200

197201
### 样式修改

main.tex

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\documentclass{tongjithesis}
1+
\documentclass[oneside]{tongjithesis}
22
\usepackage{tongjithesis}
33

44
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -23,12 +23,34 @@
2323

2424
\input{sections/frontcover.tex}
2525

26+
\makeatletter
27+
\@ifclasswith{tongjithesis}{twoside}{%
28+
\cleardoublepage
29+
}{%
30+
\clearpage
31+
}
32+
\makeatother
33+
2634
\pagestyle{firststyle}
2735
\input{sections/00_abstract.tex}
2836

37+
\makeatletter
38+
\@ifclasswith{tongjithesis}{twoside}{%
39+
\cleardoublepage
40+
}{%
2941
\clearpage
42+
}
43+
\makeatother
44+
3045
\tableofcontents %放置目录
46+
47+
\makeatletter
48+
\@ifclasswith{tongjithesis}{twoside}{%
49+
\cleardoublepage
50+
}{%
3151
\clearpage
52+
}
53+
\makeatother
3254

3355
\pagestyle{mainstyle}
3456
\input{sections/01_intro}

sections/00_abstract.tex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
关键词1,关键词2,关键词3通常是与文章内容相关的几个词语,用于帮助读者更好地了解文章主题和内容。关键词的选择应该与文章的主题和研究领域密切相关,通常应该选择具有代表性、权威性、独特性和可搜索性的词语。
77
}{关键词1,关键词2,关键词3}
88

9+
\makeatletter
10+
\@ifclasswith{tongjithesis}{twoside}{%
11+
\cleardoublepage
12+
}{%
13+
}
14+
\makeatother
15+
916
\MakeAbstractEng{
1017
An abstract is usually a short summary of an article, essay, report, or other text. Its purpose is to help the reader understand the main content and conclusions of the text so that he or she can decide whether he or she needs to continue reading the original text. The abstract usually contains information about the topic, purpose, methods, results, and conclusions of the text and is presented as concisely and clearly as possible. A good abstract should be able to summarize the main points of the text while avoiding unnecessary details and jargon so that it can be easily understood by a wide audience.
1118

style/tongjithesis.cls

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,54 @@
2222
\RequirePackage[a4paper,top=4.2cm,bottom=2.7cm,left=3.3cm,right=1.8cm]{geometry}
2323

2424

25+
% 重新定义 \cleardoublepage 命令
26+
\let\origdoublepage\cleardoublepage
27+
\newcommand{\clearemptydoublepage}{
28+
\clearpage
29+
{\pagestyle{empty}\origdoublepage}
30+
}
31+
\let\cleardoublepage\clearemptydoublepage
32+
33+
2534
% 画边界线
2635
\RequirePackage{fancybox}
36+
37+
\makeatletter
38+
\@ifclasswith{tongjithesis}{twoside}{%
39+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-4.3cm){$|$}%
40+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-4.9cm){$|$}%
41+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-5.5cm){$|$}%
42+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-6.1cm){$|$}%
43+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-6.7cm){$|$}%
44+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-7.3cm){$|$}%
45+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-7.9cm){$|$}%
46+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-8.5cm){$|$}%
47+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-9.1cm){$|$}%
48+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-9.7cm){$|$}%
49+
\fancyput*(\ifodd\value{page} -1.0cm\else 16.5cm\fi,-10.3cm){装}%
50+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-10.9cm){$|$}%
51+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-11.5cm){$|$}%
52+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-12.1cm){$|$}%
53+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-12.7cm){$|$}%
54+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-13.3cm){$|$}%
55+
\fancyput*(\ifodd\value{page} -1.0cm\else 16.5cm\fi,-13.9cm){订}%
56+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-14.5cm){$|$}%
57+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-15.1cm){$|$}%
58+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-15.7cm){$|$}%
59+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-16.3cm){$|$}%
60+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-16.9cm){$|$}%
61+
\fancyput*(\ifodd\value{page} -1.0cm\else 16.5cm\fi,-17.5cm){线}%
62+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-18.1cm){$|$}%
63+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-18.7cm){$|$}%
64+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-19.3cm){$|$}%
65+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-19.9cm){$|$}%
66+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-20.5cm){$|$}%
67+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-21.1cm){$|$}%
68+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-21.7cm){$|$}%
69+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-22.3cm){$|$}%
70+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-22.9cm){$|$}%
71+
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-23.5cm){$|$}%
72+
}{%
2773
\fancyput*(-0.8cm,-4.3cm){$|$}%
2874
\fancyput*(-0.8cm,-4.9cm){$|$}%
2975
\fancyput*(-0.8cm,-5.5cm){$|$}%
@@ -57,7 +103,8 @@
57103
\fancyput*(-0.8cm,-22.3cm){$|$}%
58104
\fancyput*(-0.8cm,-22.9cm){$|$}%
59105
\fancyput*(-0.8cm,-23.5cm){$|$}%
60-
106+
}
107+
\makeatother
61108

62109
% 设置有序列表与无序列表格式
63110
\RequirePackage{enumerate} % 下面用到了 enumerate
@@ -135,8 +182,8 @@
135182
\fancypagestyle{firststyle}{
136183
\fancyhf{}
137184
\pagenumbering{Roman} % 页数使用罗马数字
138-
\fancyhead[L]{\qquad \includegraphics[height=1.14cm]{figures/tongji.pdf}} %页眉左侧插入同济大学logo
139-
\fancyhead[R]{\large 毕业设计(论文)~\\}
185+
\fancyhead[LO,RE]{\qquad \includegraphics[height=1.14cm]{figures/tongji.pdf}} %页眉左侧插入同济大学logo
186+
\fancyhead[RO,LE]{\large 毕业设计(论文)~\\}
140187
\fancyfoot[C]{\large \thepage}
141188
\renewcommand{\headrulewidth}{1.8pt} % 页眉横线
142189
\renewcommand{\footrulewidth}{0pt}
@@ -148,9 +195,10 @@
148195
\fancypagestyle{mainstyle}{
149196
\fancyhf{}
150197
\pagenumbering{arabic}
151-
\fancyhead[L]{\qquad \includegraphics[height=1.14cm]{figures/tongji.pdf}} %页眉左侧插入同济大学logo
152-
\fancyhead[R]{\large 毕业设计(论文)~\\}
153-
\fancyfoot[R]{{\large\quad \pageref{LastPage}\quad\quad\quad \thepage \quad 页}} %偶数页左侧(LE),奇数页右侧(RO)标页码,oneside打印只用写RO
198+
\fancyhead[LO,RE]{\qquad \includegraphics[height=1.14cm]{figures/tongji.pdf}} %页眉左侧插入同济大学logo
199+
\fancyhead[RO,LE]{\large 毕业设计(论文)~\\}
200+
\fancyfoot[RO]{{\large\quad \pageref{LastPage}\quad\quad\quad \thepage \quad 页}}
201+
\fancyfoot[LE]{{\large\quad \thepage \quad\quad\quad \pageref{LastPage}\quad 页}}
154202
\renewcommand{\headrulewidth}{1.8pt} % 页眉横线
155203
\renewcommand{\footrulewidth}{1.8pt} % 页脚横线
156204
}

0 commit comments

Comments
 (0)