diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cc83ecc --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +.aux +.log +.lof +.lot +.bbl +.blg +.thm +.toc +.out +.loa +.synctex.gz diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..e43625d --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 whzecomjm + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/README.md b/README.md new file mode 100755 index 0000000..7a6afbc --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# 南科大毕业论文LaTex模板 +本模板主要基于中科大的毕业论文模板修改而成,由一个学长修改成南科大格式,原[repo](https://github.com/whzecomjm/sustcthesis)。我主要做了如下修改: +1. 添加了适用于Linux/Unix的脚本用于生成/清理PDF文件 +2. 修改了新版的校徽和校名。 +3. 删除不必要的信息。 + +![screenshot 2019-03-24 23.33.42](https://ws4.sinaimg.cn/large/006tKfTcgy1g1eb6auhdmj30kq0qx775.jpg) + +## 目录结构 + +1. `bib`存放**Bibtex**引用文件。 +2. `figures` 存放图片文件。 +3. `chapter`存放章节`tex`文件。 +4. `main.pdf`输出论文 + +## 编译: + +本模板使用XeLaTeX进行编译,编译流程如下: + +
XeLaTex -> BibTeX -> XeLaTeX * 2
+ +### 1. Mac & Linux + +```shell +# 生成PDF +$ chmod +x make clean +$ ./make +# 清理 +$ ./clean +``` + +### 2. Windows + +点击`make.bat`或者`clean.bat`. + +效果请查看样例[PDF](). + +## Tips + +推荐在Mac下使用**MacTeX**,Windows下使用**TeXlive**. \ No newline at end of file diff --git a/bib/tex.bib b/bib/tex.bib new file mode 100644 index 0000000..e69de29 diff --git a/chapter/.DS_Store b/chapter/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/chapter/.DS_Store differ diff --git a/chapter/abstract.tex b/chapter/abstract.tex new file mode 100755 index 0000000..94e4e6f --- /dev/null +++ b/chapter/abstract.tex @@ -0,0 +1,11 @@ +\begin{cnabstract} + 本文主要说明了.... + +\keywords{关键词1, 关键词2} +\end{cnabstract} + +\begin{enabstract} +English Abstract Here + +\enkeywords{keyword1, keyword2} +\end{enabstract} diff --git a/chapter/chap-appA.tex b/chapter/chap-appA.tex new file mode 100755 index 0000000..49fee9c --- /dev/null +++ b/chapter/chap-appA.tex @@ -0,0 +1,4 @@ +\chapter{Experiment Results} +\label{chap:appA} +Some descriptions here. +\section{Subsection} diff --git a/chapter/chap-preface.tex b/chapter/chap-preface.tex new file mode 100755 index 0000000..6a1c1fe --- /dev/null +++ b/chapter/chap-preface.tex @@ -0,0 +1,18 @@ +\chapter{Preface} +\label{chap:chap-preface} +\vskip 28pt + +\begin{flushright} + +Alan Mathison Turing + +March, 2019 at SUSTech + +\end{flushright} + + + + + + + \ No newline at end of file diff --git a/chapter/chapter2.tex b/chapter/chapter2.tex new file mode 100644 index 0000000..aaacd7f --- /dev/null +++ b/chapter/chapter2.tex @@ -0,0 +1,2 @@ +\chapter{} +\label{chap:chap-two} \ No newline at end of file diff --git a/chapter/conclusion.tex b/chapter/conclusion.tex new file mode 100755 index 0000000..eea27ef --- /dev/null +++ b/chapter/conclusion.tex @@ -0,0 +1,2 @@ +\chapter*{Conclusions} +\label{chap:conclusion} diff --git a/chapter/denotation.tex b/chapter/denotation.tex new file mode 100755 index 0000000..db85bf6 --- /dev/null +++ b/chapter/denotation.tex @@ -0,0 +1,3 @@ +\begin{denotation} +\item[$\mathbb{Q}$] rational number field +\end{denotation} diff --git a/chapter/honest.tex b/chapter/honest.tex new file mode 100755 index 0000000..ba54116 --- /dev/null +++ b/chapter/honest.tex @@ -0,0 +1,22 @@ +\chapter*{诚信承诺书} +\label{chap:honest} + +\begin{enumerate} +\item 本人郑重承诺所呈交的毕业设计(论文),是在导师的指导下,独立进行研究工作所取得的成果,所有数据、图片资料均真实可靠。 +\item 除文中已经注明引用的内容外,本论文不包含任何其他人或集体已经发表或撰写过的作品或成果。对本论文的研究作出重要贡献的个人和集体,均已在文中以明确的方式标明。 +\item 本人承诺在毕业论文(设计)选题和研究内容过程中没有抄袭他人研究成果和伪造相关数据等行为。 +\item 在毕业论文(设计)中对侵犯任何方面知识产权的行为,由本人承担相应的法律责任。 +\end{enumerate} + +\vskip 3\baselineskip + + +\begin{flushright} + +作者签名: \underline{\hspace{4cm}} +\vskip \baselineskip +\underline{\hspace{1.4cm}}年\underline{\hspace{0.7cm}}月\underline{\hspace{0.7cm}}日 + +\end{flushright} + + diff --git a/chapter/introduction.tex b/chapter/introduction.tex new file mode 100755 index 0000000..b00c434 --- /dev/null +++ b/chapter/introduction.tex @@ -0,0 +1,2 @@ +\chapter{Introduction} +\label{chp:introduction} \ No newline at end of file diff --git a/chapter/thanks.tex b/chapter/thanks.tex new file mode 100755 index 0000000..512578a --- /dev/null +++ b/chapter/thanks.tex @@ -0,0 +1,13 @@ +\begin{thanks} +感谢所有为此\LaTeX{}模板做出贡献的人 +\vskip 18pt + +\begin{flushright} + +Alan Mathison Turing + +March, 2019 + +\end{flushright} + +\end{thanks} diff --git a/clean b/clean new file mode 100755 index 0000000..4e0ff45 --- /dev/null +++ b/clean @@ -0,0 +1,11 @@ +#!/bin/bash +find . -name '*.aux' -delete +find . -name '*.log' -delete +find . -name '*.lof' -delete +find . -name '*.bbl' -delete +find . -name '*.blg' -delete +find . -name '*.thm' -delete +find . -name '*.toc' -delete +find . -name '*.out' -delete +find . -name '*.loa' -delete +find . -name '*.synctex.gz' -delete diff --git a/clean.bat b/clean.bat new file mode 100755 index 0000000..cba22f8 --- /dev/null +++ b/clean.bat @@ -0,0 +1,10 @@ +del *.aux /s +del *.log /s +del *.lof /s +del *.lot /s +del *.bbl /s +del *.blg /s +del *.thm /s +del *.toc /s +del *.out /s +del *.loa /s \ No newline at end of file diff --git a/figures/sustech_logo_fig.png b/figures/sustech_logo_fig.png new file mode 100644 index 0000000..1a23d23 Binary files /dev/null and b/figures/sustech_logo_fig.png differ diff --git a/figures/sustech_logo_text.png b/figures/sustech_logo_text.png new file mode 100755 index 0000000..dc2cdd6 Binary files /dev/null and b/figures/sustech_logo_text.png differ diff --git a/main.pdf b/main.pdf new file mode 100644 index 0000000..5fcb622 Binary files /dev/null and b/main.pdf differ diff --git a/main.tex b/main.tex new file mode 100755 index 0000000..f2f43fb --- /dev/null +++ b/main.tex @@ -0,0 +1,155 @@ +% !TEX program = xelatex +\documentclass[bachelor,openright,notchinese]{sustcthesis} +% 默认twoside 双面打印 +% 将master修改为bachelor, doctor or master +% 要使用adobe字体,添加adobefonts选项 +% 使用euler数学字体,如不愿使用,去掉euler +% 使用外文写作,请添加notchinese + +% 设置图形文件的搜索路径 +\graphicspath{{figures/}} + +% 用到的宏包 +\usepackage{algorithmicx} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% 封面部分 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % 中文封面内容 + \title{毕业论文}%一般情况下扉页和封皮、书脊共用一个标题文本,可以不用定义\spinetitle(仅硕博有用), \covertitle(本硕博均有用)和\encovertitle(仅本科有用)。特殊情况见下。 + %特殊情况1:本例中\title命令里含有换行控制字符,这会导致制作书脊的时候出现错误,例如如果你注释掉\spinetitle{...}这一行就会报错。这时需要定义一个不含换行等命令的\spinetitle,这并不表示\spinetitle里不能有任何命令——只能使用有限的命令。 + %特殊情况2:本例中标题过长,所以需要缩小书脊标题的字号。 + %特殊情况3:本例中中英文混排,由于tex竖排的原理限制,中英文基线不重合,所以需要人工调整英文的基线。具体调整量根据不同字体有所不同。 + %\covertitle{六次循环域} + %\covertitle{中文题目第一行\\中文题目第二行} + %不要在此调整封皮字体大小! Do not set Cover Page font size here! + %特殊情况4:本例中\title中含有多个换行,导致标题超过了两行。根据制本厂规定,封皮标题不能超过两行。因此需要定义封皮使用的标题\covertitle. 如果你注释掉这一行,就会发现封皮不符合规定。 + %\encovertitle{On Cyclic Sextic Fields} + %\encovertitle{English Title Line 1\\English Title Line 2\\English Title Line 3} + %不要在此调整封皮字体大小! Do not set Cover Page font size here! + %特殊情况5:仅本科生有用。本科封皮中有英文标题,不超过三行。与上类似。 + \author{张 \ 三 } + \depart{计算机科学与工程}%系别,硕博请用系代号,本科请用全称如 + \major{计算机专业}%专业,硕博请用全称,本科不需要 + \advisor{XXXX \ 教授} + % \coadvisor{XXX\ 教授,\ XXX\ 教授}%第二导师,没有请注释掉 + \studentid{XXXXX}%For bachelor only + \submitdate{二〇一九年三月} + + % 英文封面内容 + \entitle{Bachelor Thesis} + \enauthor{Alan Mathison Turing} + \studentid{XXXX} + \endepart{Computer Science and Engineering} + \enmajor{Computer Science} + \enadvisor{Prof. XXX} + % \encoadvisor{} + % \encoadvisorsec{} + \ensubmitdate{March, 2019} + +\begin{document} + +% 封面 +\maketitle + +%特别注意,以下述顺序为准,在对应部分添加文档部件,切勿颠倒顺序: +%本科论文的文档部件顺序是: +% frontmatter:致谢、目录、中文摘要、英文摘要、 +% mainmatter: 正文章节 +% backmatter: 参考文献或资料注释、附录 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% 前言部分 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\frontmatter +\makeatletter + +\ifustc@bachelor + %%%%%%%%%%%%%%%%% + %本科论文修改这里 + %%%%%%%%%%%%%%%%% + % 致谢 + \include{chapter/honest} + \include{chapter/chap-preface} + + + %目录部分 + %目录 + \tableofcontents + %默认表格、插图、算法索引名称分别为“表格索引”、“插图索引”和“算法索引” + %如果需要自行修改lot,lof,loa的名称,请定义 + %\ustclotname{...} + %\ustclofname{...} + %\ustcloaname{...} + + % 表格索引 + %\ustclot + % 插图索引 + %\ustclof + %算法索引 + %如果需要使用算法环境并列出算法索引,请加入补充宏包。 + %\ustcloa + + % 摘要 + \include{chapter/abstract}%此文件中含有中英文摘要 + \include{chapter/denotation} + +\else + %%%%%%%%%%%%%%%%% + %硕博论文修改这里 + %%%%%%%%%%%%%%%%% + % 摘要 + \include{chapter/abstract}%此文件中含有中英文摘要 + % 目录 + \tableofcontents + %默认表格、插图、算法索引名称分别为“表格索引”、“插图索引”和“算法索引” + %如果需要自行修改lot,lof,loa的名称,请定义 + %\ustclotname{...} + %\ustclofname{...} + %\ustcloaname{...} + + % 表格索引 + \ustclot + % 插图索引 + \ustclof + %算法索引 + %如果需要使用算法环境并列出算法索引,请加入补充宏包。 + %\ustcloa + + %符号说明,需要加入补充包 + \include{chapter/denotation}%不是必需的,如果不想列出请注释掉 +\fi +\makeatother + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% 正文部分 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\mainmatter + \include{chapter/introduction} + %自行添加 + \include{chapter/chapter2} + \include{chapter/conclusion} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% 附件部分 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\backmatter + %结语 + + % 参考文献 + % 使用 BibTeX + % 选择参考文献的排版格式。注意ustcbib这个格式不保证完全符合要求,请自行决定是否使用 + \bibliographystyle{sustcbib}%{GBT7714-2005NLang-UTF8} + \bibliography{bib/tex} + \nocite{*} % for every item + % 不使用 BibTeX + % \include{chapter/bib} + % 附录,没有请注释掉 + \begin{appendix} + + \include{chapter/chap-appA} + + \end{appendix} + \include{chapter/thanks} +\end{document} diff --git a/make b/make new file mode 100755 index 0000000..044a1c3 --- /dev/null +++ b/make @@ -0,0 +1,8 @@ +#!/bin/bash +./clean +xelatex main +bibtex main +xelatex main +xelatex main +./clean +open main.pdf \ No newline at end of file diff --git a/make.bat b/make.bat new file mode 100755 index 0000000..b555c60 --- /dev/null +++ b/make.bat @@ -0,0 +1,11 @@ +call clean + +xelatex main + +bibtex main + +xelatex main + +xelatex main +call clean +main.pdf \ No newline at end of file diff --git a/sustcbib.bst b/sustcbib.bst new file mode 100755 index 0000000..3ce733b --- /dev/null +++ b/sustcbib.bst @@ -0,0 +1,1203 @@ +% BibTeX standard bibliography style `sustcbib.bst' derived from `unsrt' +% This file is part of `sustcthesis' package. +% +% $Id: sustcbib.bst 178 2009-01-04 13:37:39Z littleleo $ + +ENTRY + { address + author + booktitle + chapter + edition + editor + howpublished + institution + journal + key + lang + month + note + number + organization + pages + publisher + school + series + title + type + volume + year + url + } + {} + { label } + +INTEGERS { output.state before.all mid.sentence after.sentence after.block } + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} + +STRINGS { s t } + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output.year} +{ 't := + number empty$ + volume empty$ + and + { add.period$ write$ } + { ", " * write$ } + if$ + t +} + +STRINGS {z} +FUNCTION {remove.dots} +{ 'z := + "" + { z empty$ not} + { z #1 #1 substring$ + z #2 global.max$ substring$ 'z := + duplicate$ "." = 'pop$ + { * } + if$ + } + while$ + %z +} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem{" write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {fin.entry} +{ duplicate$ empty$ + 'pop$ + 'write$ + if$ + newline$ + "\unskip." write$ + newline$ +} + +% FUNCTION {fin.entry} +% { add.period$ +% write$ +% %remove.dots +% newline$ +% } + +% FUNCTION {fin.entry} +% { duplicate$ empty$ +% 'pop$ +% 'write$ +% if$ +% newline$ +% } + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "{\em " swap$ * "}" * } + if$ +} + +INTEGERS { nameptr namesleft numnames } + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.cn.etal} +{ "等." } + +FUNCTION {format.lang} +{ lang empty$ + 'skip$ + 'skip$ + if$ + } + +FUNCTION {format.names} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + %"{ff }{ll}" + "{ll }{f{~}}" + format.name$ + remove.dots + %bibinfo bibinfo.check + 't := + nameptr #1 > + { + nameptr #3 + #1 + = + numnames #3 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { numnames #2 > + { "" * } + 'skip$ + if$ + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + lang empty$ + { ", " * bbl.etal * } + { lang "zh" = + { ", " * bbl.cn.etal * } + 'skip$ + if$ + } + if$ + } + { + lang empty$ + { ", " * t * } + { lang "zh" = + { ", " * t * } + 'skip$ + if$ + } + if$ + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {format.authors} +{ author empty$ + { "" } + { author format.names } + if$ +} + +FUNCTION {editors.names} +{ lang empty$ + { ", (eds.)" } + { ", 编" } + if$ +} + + +FUNCTION {format.editors} +{ editor empty$ + { "" } + { editor format.names + % editor num.names$ #1 > + %{ ", editors" * } + %{ ", editor" * } + % if$ + editors.names * + } + if$ +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { title } + if$ +} + +FUNCTION {n.dashify} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {format.date} +{ year empty$ + { month empty$ + { "" } + { "there's a month but no year in " cite$ * warning$ + month + } + if$ + } + { month empty$ + 'year + { month ", " * year * } + if$ + } + if$ +} + +FUNCTION {format.btitle} +{ title %emphasize +} + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { "volume" volume tie.or.space.connect + series empty$ + 'skip$ + { " of " * series emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { output.state mid.sentence = + { "number" } + { "Number" } + if$ + number tie.or.space.connect + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { " in " * series * } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { output.state mid.sentence = + { edition "l" change.case$ " ed." * } + { edition "t" change.case$ " ed." * } + if$ + } + if$ +} + + +FUNCTION {format.url} +{ url empty$ + { "" } + { new.block " {\url{" url * "}}" * } + if$ +} + + +INTEGERS { multiresult } + +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {format.pages} +{ pages empty$ + { "" } + { pages multi.page.check + { "" pages n.dashify tie.or.space.connect } + { "" pages tie.or.space.connect } + if$ + } + if$ +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + number empty$ + 'skip$ + { "(" number * ")" * * + volume empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + } + if$ + pages empty$ + 'skip$ + { duplicate$ empty$ + { pop$ format.pages } + { ":" * pages n.dashify * } + if$ + } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + { "" } + { type empty$ + { "chapter" } + { type "l" change.case$ } + if$ + chapter tie.or.space.connect + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {collection.in} +{ lang empty$ + { "In: " } + { "见: " } + if$ +} + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { lang empty$ + { "Proceedings of " booktitle * } + { " " booktitle * } + if$ + } + { lang empty$ + { collection.in format.editors * ". Proceedings of " * booktitle * } + { collection.in format.editors * ". " * booktitle * } + if$ + } + if$ + } + if$ +} + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { "Technical Report" } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +FUNCTION {format.article.crossref} +{ key empty$ + { journal empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * + warning$ + "" + } + { "In {\em " journal * "\/}" * } + if$ + } + { "In " key * } + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.crossref.editor} +{ editor #1 "{ll }{f{~}}" format.name$ + editor num.names$ duplicate$ + #2 > + { pop$ " et~al." * } + { #2 < + 'skip$ + { editor #2 "{ll }{f{~}}" format.name$ "others" = + { " et~al." * } + { " and " * editor #2 "{ll }{f{~}}" format.name$ * } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + "In " + } + { "Volume" volume tie.or.space.connect + " of " * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { "{\em " * series * "\/}" * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.incoll.inproc.crossref} +{ editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { booktitle empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + "" + } + { "In {\em " booktitle * "\/}" * } + if$ + } + { "In " key * } + if$ + } + { "In " format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.address.publisher} +{ address empty$ + { publisher empty$ + { "" } + { "there's a publisher but no address in " cite$ * warning$ + publisher + } + if$ + } + { publisher empty$ + 'address + { address ": " * publisher * } + if$ + } + if$ +} + +FUNCTION {format.address.school} +{ address empty$ + { school empty$ + { "" } + { "there's a school but no address in " cite$ * warning$ + school + } + if$ + } + { school empty$ + 'address + { address ": " * school * } + if$ + } + if$ +} + + +FUNCTION {format.title.type} +{ title empty$ + { type empty$ + { "" } + { "there's a type but no title in " cite$ * warning$ + type + } + if$ + } + { type empty$ + 'title + { title ": " * type * } + if$ + } + if$ +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + new.block + format.number.series output + %new.sentence + %format.address.publisher output + } + { new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + format.address.publisher output + pages empty$ + { format.date "year" output.check + % new.sentence + % format.pages output + } + { format.date ":" * format.pages * output } + if$ + fin.entry +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + crossref missing$ + { %journal emphasize "journal" output.check + journal "journal" output.check + %format.date "year" output.check + %new.block + year output + format.vol.num.pages output.year + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.block + format.note output + fin.entry +} + +FUNCTION {booklet} +{ output.bibitem + format.authors output + new.block + format.title "title" output.check + howpublished address new.block.checkb + howpublished output + address output + format.date output + new.block + note output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + %format.chapter.pages "chapter and pages" output.check + new.block + format.number.series output + new.sentence + publisher "publisher" output.check + address output + } + { format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + pages empty$ + { format.date output } + { format.date ":" * format.pages * output } + if$ + % format.date "." * format.pages * output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + %format.bvolume output + format.number.series output + format.chapter.pages output + new.sentence + format.address.publisher output + %address output + %publisher "publisher" output.check + %format.edition output + % format.date "year" output.check + % format.date ". " * format.pages * output + format.date ":" * format.pages * output + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + % new.block + % note output + fin.entry +} + +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + %format.number.series output + %format.pages output + address empty$ + { organization publisher new.sentence.checkb + organization output + publisher output + %format.date "year" output.check + year output + } + { %address output.nonnull + format.address.publisher output + %format.date "year" output.check + year output + new.sentence + organization output + %publisher output + } + if$ + new.block + format.pages output + %remove.dots + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {conference} { inproceedings } + +FUNCTION {manual} +{ output.bibitem + author empty$ + { organization empty$ + 'skip$ + { organization output.nonnull + address output + } + if$ + } + { format.authors output.nonnull } + if$ + new.block + format.btitle "title" output.check + author empty$ + { organization empty$ + { address new.block.checka + address output + } + 'skip$ + if$ + } + { organization address new.block.checkb + organization output + address output + } + if$ + format.edition output + format.date output + new.block + note output + fin.entry +} + +FUNCTION {masterthesis.type} +{ lang empty$ + { "[M]" } + { "[硕士学位论文]" } + if$ +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" add.period$ output.check + new.block + % format.title remove.dots ": " * masterthesis.type * output + format.title remove.dots masterthesis.type * output + new.block + format.address.school output + %format.madd "address" output.check + %school "school" output.check + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + format.title output + howpublished new.block.checka + howpublished output + format.date output + format.url output + new.block + note output + fin.entry + empty.misc.check +} + +FUNCTION {phdthesis.type} +{ lang empty$ + { "[D]" } + { "[博士学位论文]" } + if$ +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" add.period$ output.check + new.block + % format.title remove.dots ": " * phdthesis.type * output + format.title remove.dots phdthesis.type * output + new.block + format.address.school output + %address output + %school "school" output.check + format.date "year" output.check + new.block + note output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization output } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + address empty$ + { editor empty$ + { publisher new.sentence.checka } + { organization publisher new.sentence.checkb + organization output + } + if$ + publisher output + format.date "year" output.check + } + { address output.nonnull + format.date "year" output.check + new.sentence + editor empty$ + 'skip$ + { organization output } + if$ + publisher output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.tr.number output.nonnull + institution "institution" output.check + address output + format.date "year" output.check + format.url output + new.block + note output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + note "note" output.check + format.date output + fin.entry +} + +FUNCTION {default.type} { misc } + +MACRO {jan} {"January"} + +MACRO {feb} {"February"} + +MACRO {mar} {"March"} + +MACRO {apr} {"April"} + +MACRO {may} {"May"} + +MACRO {jun} {"June"} + +MACRO {jul} {"July"} + +MACRO {aug} {"August"} + +MACRO {sep} {"September"} + +MACRO {oct} {"October"} + +MACRO {nov} {"November"} + +MACRO {dec} {"December"} + +MACRO {acmcs} {"ACM Computing Surveys"} + +MACRO {acta} {"Acta Informatica"} + +MACRO {cacm} {"Communications of the ACM"} + +MACRO {ibmjrd} {"IBM Journal of Research and Development"} + +MACRO {ibmsj} {"IBM Systems Journal"} + +MACRO {ieeese} {"IEEE Transactions on Software Engineering"} + +MACRO {ieeetc} {"IEEE Transactions on Computers"} + +MACRO {ieeetcad} + {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} + +MACRO {ipl} {"Information Processing Letters"} + +MACRO {jacm} {"Journal of the ACM"} + +MACRO {jcss} {"Journal of Computer and System Sciences"} + +MACRO {scp} {"Science of Computer Programming"} + +MACRO {sicomp} {"SIAM Journal on Computing"} + +MACRO {tocs} {"ACM Transactions on Computer Systems"} + +MACRO {tods} {"ACM Transactions on Database Systems"} + +MACRO {tog} {"ACM Transactions on Graphics"} + +MACRO {toms} {"ACM Transactions on Mathematical Software"} + +MACRO {toois} {"ACM Transactions on Office Information Systems"} + +MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} + +MACRO {tcs} {"Theoretical Computer Science"} + +READ + +STRINGS { longest.label } + +INTEGERS { number.label longest.label.width } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} + +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} + +EXECUTE {initialize.longest.label} + +ITERATE {longest.label.pass} + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * write$ newline$ +} + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} diff --git a/sustcthesis.cls b/sustcthesis.cls new file mode 100755 index 0000000..115a7a4 --- /dev/null +++ b/sustcthesis.cls @@ -0,0 +1,828 @@ +% +% South University of Science and Technology Thesis Template +% For Bachelor, Master and Doctor +% +% Modified from the ustcthesis. +% +% Version +% Beta +% Created +% 2014.03.26 by ywg@USTC +% Last Modified +% 2014.08.29 by whzecomjm@SUSTC +% + +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesClass{sustcthesis}[2014/08/26 SUSTCthesis document class. Created: 2014.03.26 by ywg@USTC, Last Modified: 2014.08.29 by whzecomjm@SUSTC] + +%Dew class options +\newif\ifustc@basic\ustc@basicfalse +\newif\ifustc@oldfontcfg\ustc@oldfontcfgfalse +\newif\ifustc@master\ustc@masterfalse +\newif\ifustc@doctor\ustc@doctorfalse +\newif\ifustc@bachelor\ustc@bachelorfalse +\newif\ifustc@adobefont\ustc@adobefontfalse +\newif\ifustc@euler\ustc@eulerfalse +\newif\ifustc@notchinese\ustc@notchinesefalse + +%Define new commands +\def\ustc@define@term#1{ + \expandafter\gdef\csname #1\endcsname##1{% + \expandafter\gdef\csname ustc@#1\endcsname{##1}} + \csname #1\endcsname{}} + +\DeclareOption{basic}{\ustc@basictrue} + +\DeclareOption{oldfontcfg}{\ustc@oldfontcfgtrue} +%Dissertation categories - use only one option at a time, never try to use more than one options. +\DeclareOption{master}{\ustc@mastertrue} +\DeclareOption{doctor}{\ustc@doctortrue} +\DeclareOption{bachelor}{\ustc@bachelortrue} +%For English and/or other language users +\DeclareOption{notchinese}{\ustc@notchinesetrue} +%Use Euler math font +\DeclareOption{euler}{\ustc@eulertrue} + + +%Enhance compatibility +\DeclareOption{adobefonts}{\ustc@adobefonttrue\PassOptionsToClass{adobefonts}{ctexbook}} +\DeclareOption{adobefont}{\ustc@adobefonttrue\PassOptionsToClass{adobefonts}{ctexbook}} + +%Pass all unprocessed/unknown options to ctexbook. If a wrong option is specified, perhaps ctexbook will throw an error. +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}} +\ProcessOptions + +%Minimum xeCJK version:3.2.10, date:2014/03/01 +\PassOptionsToPackage{CJKchecksingle}{xeCJK} +%不再鼓励使用$$...$$的方式输入公式,可能会引起奇怪的问题 +%如果一定要用$$...$$输入公式。请在更新到上述版本后加入PlainEquation选项。 + +\LoadClass[cs4size,a4paper,fancyhdr,fntef]{ctexbook} + +%Check if extra pack should be used. +\ifustc@basic\relax\else\input{sustcxtra.cls}\relax\fi + +% Alter some LaTeX defaults for better treatment of figures: +% See p.105 of "TeX Unbound" for suggested values. +% See pp. 199-200 of Lamport's "LaTeX" book for details. +% General parameters, for ALL pages: +\renewcommand{\topfraction}{0.9} % max fraction of floats at top +\renewcommand{\bottomfraction}{0.8} % max fraction of floats at bottom +% Parameters for TEXT pages (not float pages): +\setcounter{topnumber}{2} +\setcounter{bottomnumber}{2} +\setcounter{totalnumber}{4} % 2 may work better +\setcounter{dbltopnumber}{2} % for 2-column pages +\renewcommand{\dbltopfraction}{0.9} % fit big float above 2-col. text +\renewcommand{\textfraction}{0.07} % allow minimal text w. figs +% Parameters for FLOAT pages (not text pages): +\renewcommand{\floatpagefraction}{0.7} % require fuller float pages +% N.B.: floatpagefraction MUST be less than topfraction !! +\renewcommand{\dblfloatpagefraction}{0.7} % require fuller float pages +%remember to use [htp] or [htpb] for placement + +%Check if user has specified one dissertation option. +\ifustc@master\relax\else + \ifustc@doctor\relax\else + \ifustc@bachelor\relax\else + \ClassError{USTCthesis}{You have to specify one of thesis options: bachelor, master or doctor.}{} + \fi + \fi +\fi + +%Ensure only one dissertation option is specified. +\newcommand\ustc@error{\ClassError{USTCthesis}{You can ONLY specify ONE KEY option: bachelor, master or doctor!}{}} +\ifustc@doctor + \ifustc@master + \ustc@error + \else + \ifustc@bachelor + \ustc@error + \fi + \fi +\else + \ifustc@master + \ifustc@bachelor + \ustc@error + \fi + \fi +\fi + +%load basic packages +\RequirePackage{amsmath,amsthm,amsfonts,amssymb,bm} +\RequirePackage{titletoc} +\RequirePackage{titlesec} +\RequirePackage[ + left=3.17cm, + right=2.57cm, + top=2.50cm, + bottom=2.50cm, + headsep=0.25cm, + headheight=1.5cm, + footskip=0.79cm, +% showframe%uncomment this if you want to check the page setup. + ]{geometry} +\RequirePackage{multicol} +\RequirePackage{multirow} +\RequirePackage{hyperref} +\pdfstringdefDisableCommands{\def\and{and }} +\hypersetup{ + CJKbookmarks=true,% + bookmarksnumbered=true,% + bookmarksopen=true, + breaklinks=true, + colorlinks=true,% + linkcolor=black,% + citecolor=black,% + plainpages=false,% + pdfstartview=FitH,} +\AtBeginDocument{\hypersetup{% + pdftitle={\ustc@entitle},% + pdfauthor={\ustc@author,\ustc@enauthor},% + pdfkeywords={},%Either put keywords here or not, as you wish. + pdfcreator={LaTeX using SUSTC LaTeX Thesis Template for Bachelor, created by whzecomjm}}} +\RequirePackage[numbers,sort&compress,square]{natbib} +\def\bibfont{\wuhao} +\setlength{\bibsep}{0pt plus1pt minus1pt} +\setlength{\bibhang}{2\ccwd}%Applied only to author-year style +\RequirePackage{caption} +%\RequirePackage[format=hang,labelsep=quad]{caption} +\DeclareCaptionFont{c5size}{\wuhao} +\captionsetup{labelfont={c5size,bf}} +\captionsetup{textfont=c5size} + +%Chinese font size +\newcommand{\chuhao} {\fontsize{42pt} {\baselineskip}\selectfont} +\newcommand{\xiaochu} {\fontsize{36pt} {\baselineskip}\selectfont} +\newcommand{\xiaochuhao}{\fontsize{36pt} {\baselineskip}\selectfont} +\newcommand{\yihao} {\fontsize{28pt} {\baselineskip}\selectfont} +\newcommand{\erhao} {\fontsize{21pt} {\baselineskip}\selectfont} +\newcommand{\xiaoer} {\fontsize{18pt} {\baselineskip}\selectfont} +\newcommand{\xiaoerhao} {\fontsize{18pt} {\baselineskip}\selectfont} +\newcommand{\sanhao} {\fontsize{15.75pt}{\baselineskip}\selectfont} +\newcommand{\xiaosan} {\fontsize{15pt} {\baselineskip}\selectfont} +\newcommand{\xiaosanhao}{\fontsize{15pt} {\baselineskip}\selectfont} +\newcommand{\sihao} {\fontsize{14pt} {\baselineskip}\selectfont} +\newcommand{\xiaosi} {\fontsize{12pt} {\baselineskip}\selectfont} +\newcommand{\xiaosihao} {\fontsize{12pt} {\baselineskip}\selectfont} +\newcommand{\wuhao} {\fontsize{10.5pt} {\baselineskip}\selectfont} +\newcommand{\xiaowu} {\fontsize{9pt} {\baselineskip}\selectfont} +\newcommand{\xiaowuhao} {\fontsize{9pt} {\baselineskip}\selectfont} +\newcommand{\liuhao} {\fontsize{7.875pt}{\baselineskip}\selectfont} +\newcommand{\qihao} {\fontsize{5.25pt} {\baselineskip}\selectfont} + +%Define font for vertical typesetting. +\ifustc@adobefont + \setCJKfamilyfont{verthei}[RawFeature={vertical:}]{Adobe Heiti Std}\relax +\else% + \setCJKfamilyfont{verthei}[RawFeature={vertical:}]{SimHei}\relax +\fi +\newcommand{\ustc@verthei}{\CJKfamily{verthei}} + +%Set section numbering to subsubsection +\setcounter{secnumdepth}{3} +%Set numbering style to X.X +\numberwithin{equation}{chapter} +\numberwithin{figure}{chapter} +\numberwithin{table}{chapter} + +%Title setup +\CTEXsetup[format={\centering}]{chapter}%规定16pt,三号为15.75pt +\CTEXsetup[nameformat={\bfseries\sanhao}]{chapter} +\CTEXsetup[titleformat={\bfseries\sanhao}]{chapter} +\CTEXsetup[beforeskip={0pt}]{chapter} +\CTEXsetup[afterskip={18pt}]{chapter} +\CTEXsetup[format={\flushleft\bfseries\sihao}]{section}%规定14pt,即四号 +\CTEXsetup[format={\flushleft\bfseries\fontsize{13pt}\baselineskip}]{subsection}%规定13pt +\CTEXsetup[format={\flushleft\bfseries\xiaosihao}]{subsubsection}%规定12pt,即小四号 +\ifustc@notchinese + \CTEXsetup[name={Part\space,}]{part} + \CTEXsetup[name={Chapter\space,}]{chapter} + \CTEXsetup[number={\Roman{part}}]{part} + \CTEXsetup[number={\arabic{chapter}}]{chapter} + \CTEXsetup[name={Appendix\space}]{appendix} + \CTEXoptions[contentsname={Table of Contents}] + \CTEXoptions[listfigurename={List of Figures}] + \CTEXoptions[listtablename={List of Tables}] + \CTEXoptions[figurename={Figure}] + \CTEXoptions[tablename={Table}] + \CTEXoptions[indexname={Indexes}] + \CTEXoptions[bibname={References}] +\else + \relax +\fi + +%Define new commands for List of Figures/Tables +\ustc@define@term{ustclofname} +\ustc@define@term{ustclotname} +\ifustc@notchinese + \ustclofname{List of Figures} + \ustclotname{List of Tables} +\else + \ustclofname{插图索引} + \ustclotname{表格索引} +\fi +\CTEXoptions[listfigurename={\ustc@ustclofname}] +\CTEXoptions[listtablename={\ustc@ustclotname}] +\newcommand\ustclot{\cleardoublepage\addcontentsline{toc}{chapter}{\ustc@ustclotname}\listoftables} +\newcommand\ustclof{\cleardoublepage\addcontentsline{toc}{chapter}{\ustc@ustclofname}\listoffigures} + +%New mathematical environments +\ifustc@notchinese + \newtheorem{theorem}{\textbf{Theorem}}[section] + \newtheorem{lemma}{\textbf{Lemma}}[section] + \newtheorem{example}{\textbf{Example}}[section] + \newtheorem{definition}{\textbf{Definition}}[section] + \newtheorem{axiom}{\textbf{Axiom}}[section] + \newtheorem{property}{\textbf{Property}}[section] + \newtheorem{proposition}{\textbf{Proposition}}[section] + \newtheorem{corollary}{\textbf{Corollary}}[section] + \newtheorem{remark}{\textbf{Remark}}[section] + \newtheorem{condition}{\textbf{Condition}}[section] + \newtheorem{conclusion}{\textbf{Conclusion}}[section] + \newtheorem{assumption}{\textbf{Assumption}}[section] + \newtheorem{prove}{\textbf{Prove}}[section] + \renewcommand{\proofname}{Proof} + \renewcommand\appendixname{Appendix} + %New autorefname + \def\equationautorefname{Equation} + \def\footnoteautorefname{Footnote} + \def\itemautorefname{Item} + \def\figureautorefname{Figure} + \def\subfigureautorefname{Figure} + \def\tableautorefname{Table} + \def\partautorefname{Part} + \def\appendixautorefname{Appendix} + \def\chapterautorefname{Chapter} + \def\sectionautorefname{Section} + \def\subsectionautorefname{Subsection} + \def\theoremautorefname{Theorem} + \def\assumptionautorefname{Assumption} + \def\propertyautorefname{Property} +\else + \newtheorem{theorem}{\textbf{\hspace{0.7cm}定理}}[section] + \newtheorem{lemma}{\textbf{\hspace{0.7cm}引理}}[section] + \newtheorem{example}{\textbf{\hspace{0.7cm}例}}[section] + \newtheorem{definition}{\textbf{\hspace{0.7cm}定义}}[section] + \newtheorem{axiom}{\textbf{\hspace{0.7cm}公理}}[section] + \newtheorem{property}{\textbf{\hspace{0.7cm}性质}}[section] + \newtheorem{proposition}{\textbf{\hspace{0.7cm}命题}}[section] + \newtheorem{corollary}{\textbf{\hspace{0.7cm}推论}}[section] + \newtheorem{remark}{\textbf{\hspace{0.7cm}注解}}[section] + \newtheorem{condition}{\textbf{\hspace{0.7cm}条件}}[section] + \newtheorem{conclusion}{\textbf{\hspace{0.7cm}结论}}[section] + \newtheorem{assumption}{\textbf{\hspace{0.7cm}假设}}[section] + \newtheorem{prove}{\textbf{\hspace{0.7cm}证明}}[section] + \renewcommand{\proofname}{证明} + \renewcommand\appendixname{附录} + %New autorefname + \def\equationautorefname{式} + \def\footnoteautorefname{脚注} + \def\itemautorefname{项} + \def\figureautorefname{图} + \def\subfigureautorefname{图} + \def\tableautorefname{表} + \def\partautorefname{篇} + \def\appendixautorefname{附录} + \def\chapterautorefname{章} + \def\sectionautorefname{节} + \def\subsectionautorefname{小节} + \def\theoremautorefname{定理} + \def\assumptionautorefname{假设} + \def\propertyautorefname{性质} +\fi + +%Line and par setup +%It seems unnecessary since CTeX has already set the \baselinestretch etc. +%\renewcommand\baselinestretch{1.4} +\newcommand\ustc@underline[2][6em]{\hskip1pt\underline{\hb@xt@ #1{\hss#2\hss}}\hskip3pt} +\setlength{\parskip}{0pt plus3pt minus0pt}%{1ex plus1.5ex minus0.5ex}%{0.5\baselineskip}%{1.5pt plus1pt minus1pt} +\setlength{\parindent}{2\ccwd} +%\setlength{\parskip}{3pt plus1pt minus2pt} +%\setlength{\baselineskip}{22pt plus1pt minus1pt} +%\setlength{\textheight}{21true cm} +%\setlength{\headsep}{1 cm} +%\setlength{\textwidth}{14.5true cm} +%\setlength{\belowcaptionskip}{5pt} + +%Title page setup +\newcommand\USTCHUGE{\fontsize{56}{67.2}\selectfont}%中文扉页第二行 +\newcommand\USTCHuge{\fontsize{30}{40}\selectfont}%中文扉页第二行 +\newcommand\USTCLARGE{\fontsize{26}{30}\selectfont}%英文扉页第二行 +\newcommand\USTCLarge{\fontsize{20}{30}\selectfont}%英文扉页第一行 +\newcommand\USTCTspace{\protect\CTEX@spaceChar} +\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else + \thispagestyle{empty}% + \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi} + +% !! Never try to set this value greater than 0.7. +% !! This value has already set previously. So, leave it here as a reminder. +%\renewcommand{\floatpagefraction}{0.80} + +%Information used for title page and book spine +\renewcommand\title[1]{\def\ustc@title{#1}} +\renewcommand\author[1]{\def\ustc@author{#1}} +\ustc@define@term{advisor} +\ustc@define@term{coadvisor} +\ustc@define@term{major}%硕士博士论文适用专业全称,不可用缩写。本科论文不需要此项 Not used in bachelor thesis. For master and doctor thesis, use full name -- NEVER use abbr. +\ustc@define@term{submitdate} +\ustc@define@term{depart}%硕士博士论文用院系代号,仅用于书脊。本科论文用院系全称,仅用于扉页 For bachelor use full name(only used in title page). Currently unused for master and doctor + +%English +\ustc@define@term{entitle} +\ustc@define@term{enauthor} +\ustc@define@term{enadvisor} +\ustc@define@term{encoadvisor} +\ustc@define@term{encoadvisorsec} +\ustc@define@term{ensubmitdate} +\ustc@define@term{enmajor} +\ustc@define@term{endepart}%本科论文用院系全称,仅用于扉页。硕博暂时没有用 For bachelor use full name(only used in title page). Currently unused for master and doctor + +%Other language strings +\ustc@define@term{otherustcstr}%A translation of `University of Science and Technology' in your language +\ustc@define@term{otherthesisstr}%A translation of `A dissertation for doctor's degree' in your language +\ustc@define@term{otherauthorstr}%A translation of `Author' in your language +\ustc@define@term{otherdepartmentstr}%A translation of `Department' in your language +\ustc@define@term{otherstudentidstr}%A translation of `Student ID' in your language +\ustc@define@term{othersupervisorstr}%A translation of `Supervisor' in your language +\ustc@define@term{otherfinishedtimestr}%A translation of `Finished Time' in your language +\ustc@define@term{otherspecialitystr}%A translation of `Speciality' in your language +\ustc@define@term{othertitle} +\ustc@define@term{otherauthor} +\ustc@define@term{otheradvisor} +\ustc@define@term{othercoadvisor} +\ustc@define@term{othersubmitdate} +\ustc@define@term{othermajor} +\ustc@define@term{otherdepart}%本科论文用院系全称,仅用于扉页。硕博暂时没有用 For bachelor use full name(only used in title page). Currently unused for master and doctor +\ustc@define@term{studentid}%学号,仅本科论文 Student ID, only for bachelor +\ustc@define@term{spinetitle}%书脊使用的标题,当title里含有控制字符时使用此命令输入文本标题 Use this command to generate spine when there are some control commands in \title{} +\ustc@define@term{covertitle}%封皮使用的标题,当title里存在强制换行导致标题超过了三行时,或者存在其他特殊情况时,请使用此命令输入封皮的标题。根据制本厂的规定,封皮标题最多两行。 +\ustc@define@term{encovertitle}%本科专用。封皮使用的英文标题,当entitle里存在强制换行导致标题超过了四行时,或者存在其他特殊情况时,请使用此命令输入封皮的英文标题。根据制本厂的规定,封皮英文标题最多三行。 + + + +\RequirePackage{subfiles} +\RequirePackage{xparse} +\DeclareDocumentCommand{\makecover}{ O{17pt} O{17pt} }{\make@bookspine{#1}{#2}} + +\renewcommand\maketitle{ +% \make@cntitle +% If you need a chinese title, please remove this "%" sign! + \make@entitle + \ifustc@notchinese + \ifx\ustc@othertitle\@empty + \relax + \else + \make@othertitle + \fi + \fi + \ifustc@bachelor + \relax + \else + \make@authorization + \fi} + +%Chinese title page +\newcommand\make@cntitle{% + \newgeometry{% + top=3.8cm, + bottom=3.8cm, + left=3.2cm, + right=3.2cm + } + \pdfbookmark[-1]{\ustc@title}{title} + \cleardoublepage + \thispagestyle{empty} + \begin{center} + \vspace*{0.5cm plus 0.5cm minus 1cm} + \includegraphics[width=10cm]{sustech_logo_text.png} + \vskip -0.5cm + \bfseries\USTCHUGE\ifustc@doctor + {博士学位论文} + \else\ifustc@master + {硕士学位论文} + \else + {学士学位论文} + \fi\fi + + \ifustc@bachelor\vskip 1cm\relax\else\vskip 1.5cm\fi + \includegraphics[width=4.5cm]{sustech_logo_fig.png} + \ifustc@bachelor\relax\else\vskip 0.5cm\fi %0.75cm + \renewcommand{\baselinestretch}{0.5}%Leading + \parbox[c]{11cm}%\begin{minipage} + {\center\bfseries\yihao\ustc@title} + %\end{minipage} + \end{center} + \vskip 1.0cm %0.6cm 0.7cm 2.3cm + \begin{center} + {\sanhao + \ifustc@bachelor\begin{tabular}{lc}% + \bfseries{姓\hspace{2\ccwd}名:} & \ustc@underline[6cm]{\ustc@author}\\ + \bfseries{院\hspace{2\ccwd}系:} & \ustc@underline[6cm]{\ustc@depart}\\ + \bfseries{学\hspace{2\ccwd}号:} & \ustc@underline[6cm]{\ustc@studentid}\\ + \bfseries{导\hspace{2\ccwd}师:} & \ustc@underline[6cm]{\ustc@advisor}\\ + \ifx\ustc@coadvisor\@empty\else & \ustc@underline[6cm]{\ustc@coadvisor}\\\fi + \bfseries{完成时间:} & \ustc@underline[6cm]{\ustc@submitdate} + \end{tabular} + \else \begin{tabular}{lc}% + \bfseries{作者姓名:} & \ustc@underline[6cm]{\ustc@author}\\ + \bfseries{学科专业:} & \ustc@underline[6cm]{\ustc@major}\\ + \bfseries{导师姓名:} & \ustc@underline[6cm]{\ustc@advisor}\\ + \ifx\ustc@coadvisor\@empty\else + & \ustc@underline[6cm]{\ustc@coadvisor}\\\fi + \bfseries{完成时间:} & \ustc@underline[6cm]{\ustc@submitdate} + \end{tabular} + \fi} + \end{center} + \clearpage + \restoregeometry + \if@twoside + \thispagestyle{empty} + \cleardoublepage + \fi +} + +%English title page +\newcommand\make@entitle{% + \newgeometry{% + top=1.5cm, + bottom=3.0cm, + left=3.0cm, + right=3.0cm + } + \pdfbookmark{Cover Page}{etitle} + \cleardoublepage + \thispagestyle{empty} + \begin{center} + \begin{tabular}{lr}CLC\underline{\hspace{2cm}}\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad &Number\underline{\hspace{2cm}}\\ UDC\underline{\hspace{2cm}}&Classification Level\underline{\hspace{2cm}}\end{tabular}\vspace*{1.5cm} + \vskip 0cm + \USTCLarge{\ttfamily{SOUTH UNIVERSITY OF SCIENCE AND TECHNOLOGY}} + \vskip 0.0cm + \USTCHuge{\ttfamily\ifustc@doctor + {A Dissertation for Doctor's Degree} + \else\ifustc@master + {A Dissertation for Master's Degree} + \else + {Undergraduate Thesis} + \fi\fi} + \vskip 1.0cm %1.25cm + \includegraphics[width=4.7cm]{sustech_logo_fig.png} + \vskip 1.0cm %2.4cm + \renewcommand{\baselinestretch}{1} + \bfseries\yihao\ustc@entitle + \end{center} + \vskip 1.0cm %1.8cm 2cm 3.1cm + \begin{center} + {\sanhao + \ifustc@bachelor + \begin{tabular}{lc} + Author :& \ustc@underline[7cm]{\ustc@enauthor}\\ + Student ID :& \ustc@underline[7cm]{\ustc@studentid}\\ + Department :& \ustc@underline[7cm]{\ustc@endepart}\\ + Major :& \ustc@underline[7cm]{\ustc@enmajor}\\ + Supervisor :& \ustc@underline[7cm]{\ustc@enadvisor}\\ + \ifx\ustc@encoadvisor\@empty\else + Acad. Supervisors:& \ustc@underline[7cm]{\ustc@encoadvisor}\\ + \fi + \ifx\ustc@encoadvisorsec\@empty\else + & \ustc@underline[7cm]{\ustc@encoadvisorsec}\\ + \fi + Finished Time :& \ustc@underline[6cm]{\ustc@ensubmitdate} + \end{tabular} + + \else + \begin{tabular}{lc} + Author :& \ustc@underline[6cm]{\ustc@enauthor}\\ + Speciality :& \ustc@underline[6cm]{\ustc@enmajor}\\ + Supervisor :& \ustc@underline[6cm]{\ustc@enadvisor}\\ + \ifx\ustc@encoadvisor\@empty\else + & \ustc@underline[6cm]{\ustc@encoadvisor}\\ + \fi + Finished Time :& \ustc@underline[6cm]{\ustc@ensubmitdate} + \end{tabular} + \fi} + \end{center} + \clearpage + \restoregeometry + \if@twoside + \thispagestyle{empty} + \cleardoublepage + \fi +} + +%Other language title page +\newcommand\make@othertitle{% + \newgeometry{% + top=3.8cm, + bottom=3.8cm, + left=3.2cm, + right=3.2cm + } + %\pdfbookmark{英文标题}{etitle} + \cleardoublepage + \thispagestyle{empty} + \begin{center} + \vspace*{0cm} + \USTCLarge{\ttfamily{\ustc@otherustcstr}} + \vskip -0.2cm %-0.6cm + \USTCLARGE{\ttfamily\ustc@otherthesisstr} + \vskip 1.5cm %1.25cm + \includegraphics[width=4.7cm]{sustech_logo_fig.png} + \vskip 1.5cm %2.4cm + \renewcommand{\baselinestretch}{1} + \bfseries\yihao\ustc@othertitle + \end{center} + \vskip 1.0cm %1.8cm 2cm 3.1cm + \begin{center} + {\sanhao + \ifustc@bachelor + \begin{tabular}{lc} + \ustc@otherauthorstr :& \ustc@underline[6cm]{\ustc@otherauthor}\\ + \ustc@otherdepartmentstr :& \ustc@underline[6cm]{\ustc@otherdepart}\\ + \ustc@otherstudentidstr :& \ustc@underline[6cm]{\ustc@studentid}\\ + \ustc@othersupervisorstr :& \ustc@underline[6cm]{\ustc@otheradvisor}\\ + \ifx\ustc@encoadvisor\@empty\else + & \ustc@underline[6cm]{\ustc@othercoadvisor}\\ + \fi + \ustc@otherfinishedtimestr :& \ustc@underline[6cm]{\ustc@othersubmitdate} + \end{tabular} + \else + \begin{tabular}{lc} + \ustc@otherauthorstr :& \ustc@underline[6cm]{\ustc@otherauthor}\\ + \ustc@otherspecialitystr :& \ustc@underline[6cm]{\ustc@othermajor}\\ + \ustc@othersupervisorstr :& \ustc@underline[6cm]{\ustc@otheradvisor}\\ + \ifx\ustc@othercoadvisor\@empty\else + & \ustc@underline[6cm]{\ustc@othercoadvisor}\\ + \fi + \ustc@otherfinishedtimestr :& \ustc@underline[6cm]{\ustc@othersubmitdate} + \end{tabular} + \fi} + \end{center} + \clearpage + \restoregeometry + \if@twoside + \thispagestyle{empty} + \cleardoublepage + \fi +} + +%Cover page and book spine for bachelor, master and doctor +\newcommand{\cover@cnfontsize}{\relax} +\newcommand{\cover@enfontsize}{\relax} +\newcommand{\cover@defaultfontsize}{\fontsize{17pt}{\baselineskip}\selectfont} +\newlength{\cover@cnvoffset} +\newlength{\cover@cnhoffset} +\newlength{\cover@envoffset} +\newlength{\cover@enhoffset} +\newlength{\cover@cntitleh} +\newlength{\cover@entitleh} +\newcommand{\c@scn}[4]{ + \def\c@s@default{17pt} + \def\c@s@var{#1} + \ifx\c@s@var\c@s@default\renewcommand{\cover@cnfontsize}{\cover@defaultfontsize}\else\renewcommand{\cover@cnfontsize}{\zihao{#1}}\fi + \setlength{\cover@cnvoffset}{#2} + \setlength{\cover@cnhoffset}{#3} + \setlength{\cover@cntitleh}{#4}} +\newcommand{\c@sen}[4]{ + \def\c@s@default{17pt} + \def\c@s@var{#1} + \ifx\c@s@var\c@s@default\renewcommand{\cover@enfontsize}{\cover@defaultfontsize}\else\renewcommand{\cover@enfontsize}{\zihao{#1}}\fi + \setlength{\cover@envoffset}{#2} + \setlength{\cover@enhoffset}{#3} + \setlength{\cover@entitleh}{#4}} + +\newcommand\make@bookspine[2]{ + \def\cover@varcn{#1} + \def\cover@varen{#2} + \def\cover@san{3} + \def\cover@ssan{-3} + \def\cover@si{4} + \def\cover@ssi{-4} + \def\cover@wu{5} + \def\cover@swu{-5} + + \ifustc@bachelor%cover page for bachelor + \ifx\cover@varcn\cover@san\c@scn{#1}{0mm}{-8.5mm}{1.6cm}\else + \ifx\cover@varcn\cover@ssan\c@scn{#1}{0.5mm}{-8.5mm}{1.55cm}\else + \ifx\cover@varcn\cover@si\c@scn{#1}{1mm}{-8.5mm}{1.5cm}\else + \ifx\cover@varcn\cover@ssi\c@scn{#1}{1.5mm}{-8.5mm}{1.45cm}\else + \ifx\cover@varcn\cover@wu\c@scn{#1}{2mm}{-8.5mm}{1.4cm}\else + \ifx\cover@varcn\cover@swu\c@scn{#1}{2.5mm}{-8.5mm}{1.35cm}\else + \c@scn{17pt}{0mm}{-0.85cm}{1.6cm} + \fi + \fi + \fi + \fi + \fi + \fi + \ifx\cover@varen\cover@san\c@sen{#2}{5mm}{0mm}{2.55cm}\else + \ifx\cover@varen\cover@ssan\c@sen{#2}{5.5mm}{0mm}{2.5cm}\else + \ifx\cover@varen\cover@si\c@sen{#2}{6mm}{0mm}{2.45cm}\else + \ifx\cover@varen\cover@ssi\c@sen{#2}{6.5mm}{0mm}{2.4cm}\else + \ifx\cover@varen\cover@wu\c@sen{#2}{7mm}{0mm}{2.35cm}\else + \ifx\cover@varen\cover@swu\c@sen{#2}{7.5mm}{0mm}{2.3cm}\else + \c@sen{17pt}{4.5mm}{0mm}{2.6cm} + \fi + \fi + \fi + \fi + \fi + \fi + \newgeometry{top=17.4cm,bottom=1.1cm,left=6cm,right=5.5cm} + \clearpage + \thispagestyle{empty} + \rule{0mm}{0mm}\vskip\cover@cnvoffset\hspace{\cover@cnhoffset} + \begin{minipage}[c]{9.7cm} + \begin{minipage}[c][\cover@cntitleh][s]{9.5cm} + \centering\bfseries\cover@cnfontsize\baselineskip=1\baselineskip plus 1fill\lineskip=0pt plus 1fill + \ifx\ustc@covertitle\@empty\ustc@title\else\ustc@covertitle\fi + \end{minipage}\vskip\cover@envoffset\hskip\cover@enhoffset + \begin{minipage}[c][\cover@entitleh][s]{9.5cm} + \centering\bfseries\cover@enfontsize\baselineskip=1\baselineskip plus 1fill\lineskip=0pt plus 1fill + \ifx\ustc@encovertitle\@empty\ustc@entitle\else\ustc@encovertitle\fi + \end{minipage}\vskip 0.5cm\hskip 0cm + \begin{minipage}[c][1.5cm][s]{9.5cm} + \centering\bfseries\cover@defaultfontsize\ustc@depart + \end{minipage}\vskip -0.5cm\hskip 0cm + \begin{minipage}[c][1.5cm][s]{9.5cm} + \centering\bfseries\cover@defaultfontsize\ustc@author\hfil\ustc@studentid + \end{minipage}\vskip -0.5cm\hskip 0cm + \begin{minipage}[c][1.5cm][s]{9.5cm} + \centering\bfseries\cover@defaultfontsize\ustc@advisor\ifx\ustc@coadvisor\@empty\else\quad\ustc@coadvisor\fi + \end{minipage}\vskip -0.5cm\hskip 0cm + \begin{minipage}[c][1.5cm][s]{9.5cm} + \centering\bfseries\cover@defaultfontsize\ustc@submitdate + \end{minipage} + \end{minipage} + \else + \ifx\cover@varcn\cover@san\c@scn{#1}{-7.3cm}{6.2cm}{1.5cm}\else + \ifx\cover@varcn\cover@ssan\c@scn{#1}{-7.3cm}{6.2cm}{1.5cm}\else + \ifx\cover@varcn\cover@si\c@scn{#1}{-7.2cm}{6.2cm}{1.4cm}\else + \ifx\cover@varcn\cover@ssi\c@scn{#1}{-7.2cm}{6.2cm}{1.4cm}\else + \ifx\cover@varcn\cover@wu\c@scn{#1}{-7.1cm}{6.2cm}{1.3cm}\else + \ifx\cover@varcn\cover@swu\c@scn{#1}{-7.1cm}{6.2cm}{1.3cm}\else + \c@scn{17pt}{-7.4cm}{6.2cm}{1.5cm} + \fi + \fi + \fi + \fi + \fi + \fi + \c@sen{17pt}{0cm}{0cm}{10cm} + \newgeometry{top=2cm,bottom=2cm,left=1.2cm,right=19.5cm} + \clearpage + \thispagestyle{empty} + \begin{flushleft} + \rotatebox{-90}{\makebox[23.7cm][c]{\ziju{0.17}\ustc@verthei\zihao{-4}{\ifx\ustc@spinetitle\@empty\ustc@title\else\ustc@spinetitle\fi\hfil\hfil\ustc@depart\hfil\hfil\ustc@author\hfil\hfil{}南方科技大学}}} + \end{flushleft} + \vspace{\cover@cnvoffset}\hspace{\cover@cnhoffset} + \begin{minipage}[c]{12.2cm} + \begin{minipage}[c][\cover@cntitleh][s]{12cm} + \centering\bfseries\cover@cnfontsize\baselineskip=1\baselineskip plus 1fill\lineskip=0pt plus 1fill + \ifx\ustc@covertitle\@empty\ustc@title\else\ustc@covertitle\fi + \end{minipage}\vskip 0.6cm\hskip 0cm + \begin{minipage}[c][1.5cm][s]{12cm} + \centering\bfseries\cover@defaultfontsize\ustc@author + \end{minipage}\vskip -0.6cm\hskip 0cm + \begin{minipage}[c][1.5cm][s]{12cm} + \centering\bfseries\cover@defaultfontsize\ustc@major + \end{minipage}\vskip -0.6cm\hskip 0cm + \begin{minipage}[c][1.5cm][s]{12cm} + \centering\bfseries\cover@defaultfontsize\ustc@advisor\ifx\ustc@coadvisor\@empty\else\quad\ustc@coadvisor\fi + \end{minipage}\vskip -0.6cm\hskip 0cm + \begin{minipage}[c][1.5cm][s]{12cm} + \centering\bfseries\cover@defaultfontsize\ustc@submitdate + \end{minipage} + \end{minipage} + \fi + \if@twoside + \thispagestyle{empty} + \cleardoublepage + \else + \clearpage + \fi + \restoregeometry +} + +%Define head rule +\newcommand{\makeheadrule}{% + \rule[.7\baselineskip]{\headwidth}{1.2pt}\vskip-0.97\baselineskip% + \rule[.6\baselineskip]{\headwidth}{0.4pt}}% +\renewcommand{\headrule}{% + {\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi}% + \makeheadrule} + + + +%Define page style +\fancypagestyle{plain}{} +\pagestyle{fancy} + \fancyhf{} + \ifustc@bachelor\fancyhead[C]{\xiaowuhao{SUSTC's Dissertation for Bachelor's Degree}}\relax\else\fancyhead[C]{\small \nouppercase\leftmark}\fi + \renewcommand{\headrulewidth}{0.7pt} + +\renewcommand\frontmatter{% + \cleardoublepage + \@mainmatterfalse + \pagenumbering{Roman} + \fancyfoot{} + \fancyfoot[C]{\small \thepage}} + + \renewcommand\mainmatter{% + \cleardoublepage + \@mainmattertrue + \pagenumbering{arabic} + \fancyfoot{} + \fancyfoot[RO,LE]{\small \thepage}} + + +%Abstracts and thanks +\newcommand{\ustc@enabstractname}{ABSTRACT} +\newcommand{\ustc@cnabstractname}{摘\rule{\ccwd}{0pt}要} + + +\ifustc@notchinese + \newcommand{\ustc@thanksname}{Acknowledgements} +\else + \newcommand{\ustc@thanksname}{致\rule{\ccwd}{0pt}谢} +\fi + +\newcommand\keywords[1]{% + \vspace{3.5ex}\noindent{\bfseries 关键词:~} #1} +\newcommand\enkeywords[1]{% + \vspace{3.5ex}\noindent{\bf Keywords:~} #1} +\newenvironment{cnabstract} + {\ifustc@bachelor\chapter{\texorpdfstring{\ustc@cnabstractname}{摘要}}\else\chapter[\texorpdfstring{\ustc@cnabstractname}{摘要}]{\protect\vskip-10pt\ustc@cnabstractname}\fi} + {} +\newenvironment{enabstract} + {\ifustc@bachelor\chapter{ABSTRACT}\else\chapter[ABSTRACT]{\protect\vskip-10pt{}ABSTRACT}\fi} + {} +\renewenvironment{thanks} + {\ifustc@bachelor\chapter[\texorpdfstring{\ustc@thanksname}{\ifustc@notchinese{}Acknowledgements\else{}致谢\fi}]{\protect\vskip-10pt\ustc@thanksname}\else\chapter{\texorpdfstring{\ustc@thanksname}{\ifustc@notchinese{}Acknowledgements\else{}致谢\fi}}\fi} + {} + + + +%tableofcontents +\ifustc@notchinese + \renewcommand{\contentsname}{Contents} +\else + \renewcommand{\contentsname}{\texorpdfstring{目\rule{\ccwd}{0pt}录}{目录}} +\fi +\renewcommand\tableofcontents{% + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse + \fi + \chapter[\contentsname]{\protect\vskip-10pt\contentsname}% + \renewcommand{\baselinestretch}{1} + \@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}% + \@starttoc{toc}% + \if@restonecol\twocolumn\fi + } +%% tableofcontent +\titlecontents{chapter}[0em] + {\vspace{6bp}\sihao}%14pt,如果希望美观一些,可以无视章节标题用宋体的规定,自行添加\bfseries + {\thecontentslabel\hspace*{0.5em}} + {} + {\titlerule*[0.5pc]{$\cdot$}\contentspage} +\titlecontents{section}[1.1\ccwd] + {\vspace{1bp} \xiaosi} + {\thecontentslabel\hspace*{0.5em}} + {} + {\titlerule*[0.5pc]{$\cdot$}\contentspage} +\titlecontents{subsection}[2.5\ccwd]%原来是2.3 + {\vspace{1bp} \wuhao}%规定三级标题是10.5pt + {\thecontentslabel\hspace*{0.5em}} + {} + {\titlerule*[0.5pc]{$\cdot$}\contentspage} + + + +\renewcommand{\bibsection}{ + \chapter{\bibname} +\renewcommand{\baselinestretch}{0.8} + %\setlength{\linestretch}{1.0} + \xiaowu%%\small + %\linespread{1.36} + \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}} +%\setlength{\bibsep}{0ex} +\let\OLDappendix\appendix +\newif\if@appendixinbackmatter +\renewenvironment{appendix} +{ + \if@mainmatter + \@appendixinbackmatterfalse\OLDappendix + \else + \@appendixinbackmattertrue\@mainmattertrue\OLDappendix + \fi + \renewcommand\chaptername{\appendixname~\thechapter}} + {\if@appendixinbackmatter\@mainmatterfalse\fi +} + + + +\endinput +%% +%% End of file `SUSTCthesis.cls'. diff --git a/sustcxtra.cls b/sustcxtra.cls new file mode 100755 index 0000000..8698e05 --- /dev/null +++ b/sustcxtra.cls @@ -0,0 +1,315 @@ +% +% South University of Science and Technology Thesis Template +% For Bachelor Master and Doctor +% +% Version +% Beta +% Created +% 2014.03.26 by ywg@USTC +% Last Modified +% 2014.08.24 by whzecomjm@USTC +% + +\RequirePackage{times} +\RequirePackage[lined,boxed,linesnumbered,algochapter]{algorithm2e} +\RequirePackage{graphicx,psfrag} +\RequirePackage{enumerate} +\RequirePackage{subfig,epsfig} +\RequirePackage{float} +\RequirePackage{paralist} +\RequirePackage{booktabs} +\RequirePackage[perpage,symbol]{footmisc} +\RequirePackage[integrals]{wasysym} +\RequirePackage{longtable} + % Set default longtable alignment + \setlength\LTleft{0pt} + \setlength\LTright{0pt} +\RequirePackage{bbm} +\RequirePackage{indentfirst} +\RequirePackage{ifthen} +%\RequirePackage{caption3} +\RequirePackage{array} +\RequirePackage{fancyvrb} +\RequirePackage{xcolor} +\ifustc@euler + \usepackage[OT1,euler-digits]{eulervm} +\fi +\RequirePackage{url} \def\UrlBreaks{\do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X\do\Y\do\Z\do\[\do\\\do\]\do\^\do\_\do\`\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z\do\0\do\1\do\2\do\3\do\4\do\5\do\6\do\7\do\8\do\9\do\.\do\@\do\\\do\/\do\!\do\_\do\|\do\;\do\>\do\]\do\)\do\,\do\?\do\'\do+\do\=\do\#} + + + +\ustc@define@term{ustcloaname} +\ifustc@notchinese + \ustcloaname{List of Algorithm} + \renewcommand{\algorithmcfname}{Algorithm} +\else + \ustcloaname{算法索引} + \renewcommand{\algorithmcfname}{算法} +\fi +\renewcommand{\listalgorithmcfname}{\ustc@ustcloaname} +\newcommand\ustcloa{\cleardoublepage\addcontentsline{toc}{chapter}{\ustc@ustcloaname}\listofalgorithms} + +\ifustc@oldfontcfg + \ifustc@adobefont + \setCJKmainfont[BoldFont={Adobe Heiti Std}, ItalicFont={Adobe Kaiti Std}]{Adobe Song Std} + \setCJKsansfont{Adobe Heiti Std} + \setCJKmonofont{Adobe Fangsong Std} + + \setCJKfamilyfont{song}{Adobe Song Std} + \setCJKfamilyfont{hei}{Adobe Heiti Std} + \setCJKfamilyfont{kai}{Adobe Kaiti Std} + \setCJKfamilyfont{fs}{Adobe Fangsong Std} + %\setCJKfamilyfont{verthei}[RawFeature={vertical:}]{Adobe Heiti Std}%{Adobe Heiti Std} 这里还是改成Adobe Heiti Std吧,在Linux下面SimHei貌似不行,改成这个就好了 + \else + \setCJKmainfont[BoldFont={SimHei}, ItalicFont={KaiTi}]{NSimSun} + \setCJKsansfont{SimHei} + \setCJKmonofont{FangSong} + + \setCJKfamilyfont{song}{NSimSun} + \setCJKfamilyfont{hei}{SimHei} + \setCJKfamilyfont{kai}{KaiTi} % XP对应 KaiTi_GB2312,Vista对应KaiTi,注意根据系统切换 + \setCJKfamilyfont{fs}{FangSong} % XP对应 FangSong_GB2312,Vista对应FangSong,注意根据系统切换 + \fi +\fi + +\newcommand{\song}{\CJKfamily{song}} % 宋体 +\newcommand{\fs}{\CJKfamily{fs}} % 仿宋体 +\newcommand{\kai}{\CJKfamily{kai}} % 楷体 +\newcommand{\hei}{\CJKfamily{hei}} % 黑体 + +\setmainfont{Times New Roman} +\setsansfont[BoldFont={Courier New Bold}]{Courier New} +\setmonofont[BoldFont={Arial:style=Bold}]{Arial} + + + +%在正文中无论是否在图形环境中,用 \figcaption 均可得到图形标题 +%同样,无论是否在表格环境中,用 \tabcaption 均可得到表格标题。 +\newcommand\figcaption{\def\@captype{figure}\caption} +\newcommand\tabcaption{\def\@captype{table}\caption} + +%提供表格环境下p{width}加强版命令,使用L{width}等可以在指定宽度的同时指定对齐方式。 +\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp} +\newcolumntype{C}[1]{>{\PreserveBackslash\centering}p{#1}} +\newcolumntype{R}[1]{>{\PreserveBackslash\raggedleft}p{#1}} +\newcolumntype{L}[1]{>{\PreserveBackslash\raggedright}p{#1}} + +%Superscript reference +\newcommand{\scite}[1]{\textsuperscript{\cite{#1}}} + +\newenvironment{denotation}[1][2.5cm]{ + \ifustc@notchinese + \chapter{Notations} + \else + \chapter{主要符号对照表} % no tocline + \fi + \noindent\begin{list}{}% + {\vskip-30bp%\xiaosihao[1.6] + \renewcommand\makelabel[1]{##1\hfil} + \setlength{\labelwidth}{#1} % 标签盒子宽度 + \setlength{\labelsep}{0.5cm} % 标签与列表文本距离 + \setlength{\itemindent}{0cm} % 标签缩进量 + \setlength{\leftmargin}{\dimexpr\labelwidth+\labelsep} % 左边界,zym@USTC说\dimexpr在texlive2011/12上不正常,替代方法是使用calc宏包 + \setlength{\rightmargin}{0cm} + \setlength{\parsep}{0cm} % 段落间距 + \setlength{\itemsep}{0cm} % 标签间距 + \setlength{\listparindent}{0cm} % 段落缩进量 + \setlength{\topsep}{0pt} % 标签与上文的间距 + }}{\end{list}} + +%upStand Greek Letters +\DeclareMathSymbol{\upGamma}{\mathord}{operators}{0} +\DeclareMathSymbol{\upDelta}{\mathord}{operators}{1} +\DeclareMathSymbol{\upTheta}{\mathord}{operators}{2} +\DeclareMathSymbol{\upLambda}{\mathord}{operators}{3} +\DeclareMathSymbol{\upXi}{\mathord}{operators}{4} +\DeclareMathSymbol{\upPi}{\mathord}{operators}{5} +\DeclareMathSymbol{\upSigma}{\mathord}{operators}{6} +\DeclareMathSymbol{\upUpsilon}{\mathord}{operators}{7} +\DeclareMathSymbol{\upPhi}{\mathord}{operators}{8} +\DeclareMathSymbol{\upPsi}{\mathord}{operators}{9} +\DeclareMathSymbol{\upOmega}{\mathord}{operators}{10} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%自定义代码环境code codex 和codescript +%代码来自:陈硕 (giantchen@gmail.com) +%位于:用LaTeX排版编程技术书籍的一些个人经验 +%经过小幅修改 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newcommand{\labelfont}{\bfseries}%定义label字体 + +\def\FV@SetLineWidth{% + \if@FV@ResetMargins\else + \advance\leftmargin\@totalleftmargin + \fi + \advance\leftmargin\FV@XLeftMargin\relax + \advance\rightmargin\FV@XRightMargin\relax + \linewidth\hsize + %\advance\linewidth-\leftmargin + %\advance\linewidth-\rightmargin + \hfuzz\FancyVerbHFuzz\relax} + + +\def\FV@SingleFrameLine#1{% +%% DG/SR modification end + \hbox to\z@{% + %\kern\leftmargin +%% DG/SR modification begin - Jun. 22, 1998 + \ifnum#1=\z@ + \let\FV@Label\FV@LabelBegin + \else + \let\FV@Label\FV@LabelEnd + \fi + \ifx\FV@Label\relax +%% DG/SR modification end + \FancyVerbRuleColor{\vrule \@width\linewidth \@height\FV@FrameRule}% +%% DG/SR modification begin - Jun. 22, 1998 + \else + \ifnum#1=\z@ + \setbox\z@\hbox{\strut\enspace\labelfont\FV@LabelBegin\strut}% + \else + \setbox\z@\hbox{\strut\enspace\labelfont\FV@LabelEnd\strut}% + \fi + \@tempdimb=\dp\z@ + \advance\@tempdimb -.5\ht\z@ + \@tempdimc=\linewidth + \advance\@tempdimc -\wd\z@ + %\divide\@tempdimc\tw@ + \ifnum#1=\z@ % Top line + \ifx\FV@LabelPositionTopLine\relax + \FancyVerbRuleColor{\vrule \@width\linewidth \@height\FV@FrameRule}% + \else + \FV@FrameLineWithLabel + \fi + \else % Bottom line + \ifx\FV@LabelPositionBottomLine\relax + \FancyVerbRuleColor{\vrule \@width\linewidth \@height\FV@FrameRule}% + \else + \FV@FrameLineWithLabel + \fi + \fi + \fi +%% DG/SR modification end + \hss}} + + +%% DG/SR modification begin - May. 19, 1998 +\def\FV@FrameLineWithLabel{% + \ht\z@\@tempdimb\dp\z@\@tempdimb% + \FancyVerbRuleColor{% + \raise 0.5ex\hbox{\vrule \@width\@tempdimc \@height\FV@FrameRule}% + \raise\@tempdimb\box\z@}} +%% DG/SR modification end + + +\def\FV@EndListFrame@Lines{% + \begingroup + %\vskip 0.5ex + \baselineskip\z@skip + \kern\FV@FrameSep\relax +%% DG/SR modification begin - May. 19, 1998 +%% \FV@SingleFrameLine + \FV@SingleFrameLine{\@ne}% +%% DG/SR modification end + \endgroup} + +\newskip\mytopsep +\setlength{\mytopsep}{4pt plus 2pt minus 3pt} + +\def\FV@ListVSpace{% + \@topsepadd\mytopsep + \if@noparlist\advance\@topsepadd\partopsep\fi + \if@inlabel + \vskip\parskip + \else + \if@nobreak + \vskip\parskip + \clubpenalty\@M + \else + \addpenalty\@beginparpenalty + \@topsep\@topsepadd + \advance\@topsep\parskip + \addvspace\@topsep + \fi + \fi + %\showthe \@topsepadd + %\showthe \topsep + %\showthe \partopsep + %\showthe \parskip + \global\@nobreakfalse + \global\@inlabelfalse + \global\@minipagefalse + \global\@newlistfalse} + +\def\FV@EndList{% + \FV@ListProcessLastLine + \FV@EndListFrame + %\showthe \@topsepadd + \@endparenv + \endgroup + \@endpetrue} + +\def\theFancyVerbLine{\sffamily\scriptsize\arabic{FancyVerbLine}} + +\DefineVerbatimEnvironment% + {Codex}{Verbatim} + {fontsize=\small,baselinestretch=0.9,xleftmargin=3mm,% + frame=lines,labelposition=all,framesep=5pt} + +\DefineVerbatimEnvironment% + {Code}{Verbatim} + {fontsize=\small,baselinestretch=0.9,xleftmargin=3mm} + +\DefineVerbatimEnvironment% + {CodeScript}{Verbatim} + {fontsize=\scriptsize,baselinestretch=0.9,xleftmargin=3mm} +\DefineVerbatimEnvironment% + {CodexScript}{Verbatim} + {fontsize=\scriptsize,baselinestretch=0.9,xleftmargin=3mm,% + frame=lines,labelposition=all,framesep=5pt} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%code environment, from ctex-faq +%没有经过实际测试,注意大小写 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\definecolor{example@bkcolor}{gray}{.875} +% +\newwrite\example@out +\def\example@start{% + \begingroup% Lets Keep the Changes Local + \@bsphack + \immediate\openout \example@out \jobname.exa + \let\do\@makeother\dospecials\catcode`\^^M\active + \def\verbatim@processline{% + \immediate\write\example@out{\the\verbatim@line}}% + \verbatim@start} +\def\example@finish{\immediate\closeout\example@out\@esphack\endgroup} +\def\example@code#1#2{% + \colorbox{#1}{% + \begin{minipage}[c]{#2}% + \small\verbatiminput{\jobname.exa}% + \end{minipage}% + }% +} +\def\example@output#1{% + \let\savefboxrule\fboxrule% + \let\savefboxsep\fboxsep% + \setlength{\fboxrule}{0.1pt}% + \setlength{\fboxsep}{3mm}% + \fbox{% + \begin{minipage}[c]{#1}% + \setlength{\fboxrule}{\savefboxrule}% + \setlength{\fboxsep}{\savefboxsep}% + \setlength{\parskip}{1ex plus 0.4ex minus 0.2ex}% + \begin{trivlist}\item\small\input{\jobname.exa}\end{trivlist} + \end{minipage} + }% +} +\newenvironment{code}% + {\example@start}% + {\example@finish% + \list{}{\itemindent-\leftmargin}\item\relax% + \makebox[\textwidth][c]{% + \example@code{example@bkcolor}{0.96\textwidth}% + }% + \endlist}