Skip to content

Commit

Permalink
update: twoside init (#36)
Browse files Browse the repository at this point in the history
* update: twoside init

* update: main.tex
  • Loading branch information
RizhongLin authored Jun 4, 2023
1 parent 69ec4e2 commit 0b6b588
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ The project has been configured with GitHub Actions in `.github/workflows/*.yaml

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

## Use double-sided printing version (optional)

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`.

## Use more complete Adobe fonts (optional)

### Style modification
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ pip install Pygments

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

## 使用双面打印版(可选)

如果您需要使用双面打印版,请在 `main.tex` 中将第 1 行的 `\documentclass[oneside]{tongjithesis}` 修改为 `\documentclass[twoside]{tongjithesis}`

## 使用字库更完整的 Adobe 字体(可选)

### 样式修改
Expand Down
24 changes: 23 additions & 1 deletion main.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\documentclass{tongjithesis}
\documentclass[oneside]{tongjithesis}
\usepackage{tongjithesis}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand All @@ -23,12 +23,34 @@

\input{sections/frontcover.tex}

\makeatletter
\@ifclasswith{tongjithesis}{twoside}{%
\cleardoublepage
}{%
\clearpage
}
\makeatother

\pagestyle{firststyle}
\input{sections/00_abstract.tex}

\makeatletter
\@ifclasswith{tongjithesis}{twoside}{%
\cleardoublepage
}{%
\clearpage
}
\makeatother

\tableofcontents %放置目录

\makeatletter
\@ifclasswith{tongjithesis}{twoside}{%
\cleardoublepage
}{%
\clearpage
}
\makeatother

\pagestyle{mainstyle}
\input{sections/01_intro}
Expand Down
7 changes: 7 additions & 0 deletions sections/00_abstract.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
关键词1,关键词2,关键词3通常是与文章内容相关的几个词语,用于帮助读者更好地了解文章主题和内容。关键词的选择应该与文章的主题和研究领域密切相关,通常应该选择具有代表性、权威性、独特性和可搜索性的词语。
}{关键词1,关键词2,关键词3}

\makeatletter
\@ifclasswith{tongjithesis}{twoside}{%
\cleardoublepage
}{%
}
\makeatother

\MakeAbstractEng{
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.

Expand Down
60 changes: 54 additions & 6 deletions style/tongjithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,54 @@
\RequirePackage[a4paper,top=4.2cm,bottom=2.7cm,left=3.3cm,right=1.8cm]{geometry}


% 重新定义 \cleardoublepage 命令
\let\origdoublepage\cleardoublepage
\newcommand{\clearemptydoublepage}{
\clearpage
{\pagestyle{empty}\origdoublepage}
}
\let\cleardoublepage\clearemptydoublepage


% 画边界线
\RequirePackage{fancybox}

\makeatletter
\@ifclasswith{tongjithesis}{twoside}{%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-4.3cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-4.9cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-5.5cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-6.1cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-6.7cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-7.3cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-7.9cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-8.5cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-9.1cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-9.7cm){$|$}%
\fancyput*(\ifodd\value{page} -1.0cm\else 16.5cm\fi,-10.3cm){装}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-10.9cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-11.5cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-12.1cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-12.7cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-13.3cm){$|$}%
\fancyput*(\ifodd\value{page} -1.0cm\else 16.5cm\fi,-13.9cm){订}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-14.5cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-15.1cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-15.7cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-16.3cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-16.9cm){$|$}%
\fancyput*(\ifodd\value{page} -1.0cm\else 16.5cm\fi,-17.5cm){线}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-18.1cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-18.7cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-19.3cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-19.9cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-20.5cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-21.1cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-21.7cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-22.3cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-22.9cm){$|$}%
\fancyput*(\ifodd\value{page} -0.8cm\else 16.7cm\fi,-23.5cm){$|$}%
}{%
\fancyput*(-0.8cm,-4.3cm){$|$}%
\fancyput*(-0.8cm,-4.9cm){$|$}%
\fancyput*(-0.8cm,-5.5cm){$|$}%
Expand Down Expand Up @@ -57,7 +103,8 @@
\fancyput*(-0.8cm,-22.3cm){$|$}%
\fancyput*(-0.8cm,-22.9cm){$|$}%
\fancyput*(-0.8cm,-23.5cm){$|$}%

}
\makeatother

% 设置有序列表与无序列表格式
\RequirePackage{enumerate} % 下面用到了 enumerate
Expand Down Expand Up @@ -135,8 +182,8 @@
\fancypagestyle{firststyle}{
\fancyhf{}
\pagenumbering{Roman} % 页数使用罗马数字
\fancyhead[L]{\qquad \includegraphics[height=1.14cm]{figures/tongji.pdf}} %页眉左侧插入同济大学logo
\fancyhead[R]{\large 毕业设计(论文)~\\}
\fancyhead[LO,RE]{\qquad \includegraphics[height=1.14cm]{figures/tongji.pdf}} %页眉左侧插入同济大学logo
\fancyhead[RO,LE]{\large 毕业设计(论文)~\\}
\fancyfoot[C]{\large \thepage}
\renewcommand{\headrulewidth}{1.8pt} % 页眉横线
\renewcommand{\footrulewidth}{0pt}
Expand All @@ -148,9 +195,10 @@
\fancypagestyle{mainstyle}{
\fancyhf{}
\pagenumbering{arabic}
\fancyhead[L]{\qquad \includegraphics[height=1.14cm]{figures/tongji.pdf}} %页眉左侧插入同济大学logo
\fancyhead[R]{\large 毕业设计(论文)~\\}
\fancyfoot[R]{{\large\quad \pageref{LastPage}\quad\quad\quad \thepage \quad 页}} %偶数页左侧(LE),奇数页右侧(RO)标页码,oneside打印只用写RO
\fancyhead[LO,RE]{\qquad \includegraphics[height=1.14cm]{figures/tongji.pdf}} %页眉左侧插入同济大学logo
\fancyhead[RO,LE]{\large 毕业设计(论文)~\\}
\fancyfoot[RO]{{\large\quad \pageref{LastPage}\quad\quad\quad \thepage \quad 页}}
\fancyfoot[LE]{{\large\quad \thepage \quad\quad\quad \pageref{LastPage}\quad 页}}
\renewcommand{\headrulewidth}{1.8pt} % 页眉横线
\renewcommand{\footrulewidth}{1.8pt} % 页脚横线
}
Expand Down

0 comments on commit 0b6b588

Please sign in to comment.