├── .gitignore
├── FZLanTing.ttf
├── FZXBsong.ttf
├── HanYikaishu.ttf
├── README.md
├── clean.bat
├── data
├── abstract.tex
├── acknowledgement.tex
├── appendix.tex
├── chap01.tex
├── chap02.tex
├── chap03.tex
├── chap04.tex
├── denotation.tex
└── publications.tex
├── dtx-style.sty
├── figures
├── shu.pdf
├── shublack.pdf
├── shulogo.pdf
├── shulogo.png
└── shulogoblack.pdf
├── main.pdf
├── main.tex
├── make-doc.bat
├── reference
└── refs.bib
├── shuthesis.bst
├── shuthesis.cfg
├── shuthesis.cls
├── shuthesis.dtx
├── shuthesis.ins
├── shuthesis.pdf
└── shuthesis.sty
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Core latex/pdflatex auxiliary files:
2 | *.aux
3 | *.lof
4 | *.log
5 | *.lot
6 | *.fls
7 | *.out
8 | *.toc
9 | *.fmt
10 | *.fot
11 | *.cb
12 | *.cb2
13 |
14 | ## Intermediate documents:
15 | *.dvi
16 | *-converted-to.*
17 | # these rules might exclude image files for figures etc.
18 | # *.ps
19 | # *.eps
20 | # *.pdf
21 |
22 | ## Generated if empty string is given at "Please type another file name for output:"
23 | .pdf
24 |
25 | ## Bibliography auxiliary files (bibtex/biblatex/biber):
26 | *.bbl
27 | *.bcf
28 | *.blg
29 | *-blx.aux
30 | *-blx.bib
31 | *.run.xml
32 |
33 | ## Build tool auxiliary files:
34 | *.fdb_latexmk
35 | *.synctex
36 | *.synctex(busy)
37 | *.synctex.gz
38 | *.synctex.gz(busy)
39 | *.pdfsync
40 |
41 | ## Auxiliary and intermediate files from other packages:
42 | # algorithms
43 | *.alg
44 | *.loa
45 |
46 | # achemso
47 | acs-*.bib
48 |
49 | # amsthm
50 | *.thm
51 |
52 | # beamer
53 | *.nav
54 | *.pre
55 | *.snm
56 | *.vrb
57 |
58 | # changes
59 | *.soc
60 |
61 | # cprotect
62 | *.cpt
63 |
64 | # elsarticle (documentclass of Elsevier journals)
65 | *.spl
66 |
67 | # endnotes
68 | *.ent
69 |
70 | # fixme
71 | *.lox
72 |
73 | # feynmf/feynmp
74 | *.mf
75 | *.mp
76 | *.t[1-9]
77 | *.t[1-9][0-9]
78 | *.tfm
79 |
80 | #(r)(e)ledmac/(r)(e)ledpar
81 | *.end
82 | *.?end
83 | *.[1-9]
84 | *.[1-9][0-9]
85 | *.[1-9][0-9][0-9]
86 | *.[1-9]R
87 | *.[1-9][0-9]R
88 | *.[1-9][0-9][0-9]R
89 | *.eledsec[1-9]
90 | *.eledsec[1-9]R
91 | *.eledsec[1-9][0-9]
92 | *.eledsec[1-9][0-9]R
93 | *.eledsec[1-9][0-9][0-9]
94 | *.eledsec[1-9][0-9][0-9]R
95 |
96 | # glossaries
97 | *.acn
98 | *.acr
99 | *.glg
100 | *.glo
101 | *.gls
102 | *.glsdefs
103 |
104 | # gnuplottex
105 | *-gnuplottex-*
106 |
107 | # gregoriotex
108 | *.gaux
109 | *.gtex
110 |
111 | # hyperref
112 | *.brf
113 |
114 | # knitr
115 | *-concordance.tex
116 | # TODO Comment the next line if you want to keep your tikz graphics files
117 | *.tikz
118 | *-tikzDictionary
119 |
120 | # listings
121 | *.lol
122 |
123 | # makeidx
124 | *.idx
125 | *.ilg
126 | *.ind
127 | *.ist
128 |
129 | # minitoc
130 | *.maf
131 | *.mlf
132 | *.mlt
133 | *.mtc[0-9]*
134 | *.slf[0-9]*
135 | *.slt[0-9]*
136 | *.stc[0-9]*
137 |
138 | # minted
139 | _minted*
140 | *.pyg
141 |
142 | # morewrites
143 | *.mw
144 |
145 | # nomencl
146 | *.nlo
147 |
148 | # pax
149 | *.pax
150 |
151 | # pdfpcnotes
152 | *.pdfpc
153 |
154 | # sagetex
155 | *.sagetex.sage
156 | *.sagetex.py
157 | *.sagetex.scmd
158 |
159 | # scrwfile
160 | *.wrt
161 |
162 | # sympy
163 | *.sout
164 | *.sympy
165 | sympy-plots-for-*.tex/
166 |
167 | # pdfcomment
168 | *.upa
169 | *.upb
170 |
171 | # pythontex
172 | *.pytxcode
173 | pythontex-files-*/
174 |
175 | # thmtools
176 | *.loe
177 |
178 | # TikZ & PGF
179 | *.dpth
180 | *.md5
181 | *.auxlock
182 |
183 | # todonotes
184 | *.tdo
185 |
186 | # easy-todo
187 | *.lod
188 |
189 | # xindy
190 | *.xdy
191 |
192 | # xypic precompiled matrices
193 | *.xyc
194 |
195 | # endfloat
196 | *.ttt
197 | *.fff
198 |
199 | # Latexian
200 | TSWLatexianTemp*
201 |
202 | ## Editors:
203 | # WinEdt
204 | *.bak
205 | *.sav
206 |
207 | # Texpad
208 | .texpadtmp
209 |
210 | # Kile
211 | *.backup
212 |
213 | # KBibTeX
214 | *~[0-9]*
215 |
216 | # auto folder when using emacs and auctex
217 | /auto/*
218 |
219 | # expex forward references with \gathertags
220 | *-tags.tex
221 |
--------------------------------------------------------------------------------
/FZLanTing.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahhylau/shuthesis/b5437e3b745e8fc2282691f8ec26f38bfe1de1ad/FZLanTing.ttf
--------------------------------------------------------------------------------
/FZXBsong.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahhylau/shuthesis/b5437e3b745e8fc2282691f8ec26f38bfe1de1ad/FZXBsong.ttf
--------------------------------------------------------------------------------
/HanYikaishu.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahhylau/shuthesis/b5437e3b745e8fc2282691f8ec26f38bfe1de1ad/HanYikaishu.ttf
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # What's ShuThesis?
2 | ShuThesis is a LaTeX thesis template package for Shanghai University supporting master, doctor.
3 | Since the users of this package are supposed to be Chinese or those understand Chinese, the following
4 | of this file and all other documents are written in Chinese only.
5 |
6 | # ShuThesis 是什么?
7 | ShuThesis 为 Shanghai University Thesis LaTeX Template 的缩写.
8 |
9 | 此宏包旨在建立一个简单易用的上海大学学位论文 LaTeX 模板, 包括硕士论文、博士论文.
10 |
11 | # 文档
12 | 请[下载](https://github.com/ahhylau/shuthesis)模板, 里面包括具体使用说明以及示例文档:
13 |
14 | * 模板使用说明 (shuthesis.pdf)
15 | * 示例文档 (main.pdf)
16 |
17 | # 下载
18 |
19 | * [GitHub](https://github.com/ahhylau/shuthesis)
20 |
21 | # 升级
22 |
23 | ## 手动更新
24 | 从 [GitHub](https://github.com/ahhylau/shuthesis) 下载放入论文目录, 执行命令 (Windows 用户在文件夹空白处按`Shift+鼠标右键`, 点击“在此处打开命令行窗口”):
25 |
26 | latex shuthesis.ins
27 |
28 | 即可得到 `shuthesis.cls` 和 `shuthesis.cfg` 等模板文件.
29 |
30 | # 提问
31 |
32 | * [Github Issues](http://github.com/ahhylau/shuthesis/issues)
33 |
34 |
--------------------------------------------------------------------------------
/clean.bat:
--------------------------------------------------------------------------------
1 | ctex -clean
2 | del *.aux /s
3 | del *.log /s
4 | del *.gz /s
5 | del *.thm /s
6 | del *.toc /s
7 | del *.bak /s
8 | del *.blg /s
9 | del *.idx /s
10 | del *.ind /s
11 | del *.out /s
12 | del *.bbl /s
13 | del *.ilg /s
14 | del *.loe /s
15 | del *.lof /s
16 | del *.lot /s
17 | del *.glo /s
18 | del *.idx /s
19 | del *.gls /s
20 | del *.hd /s
21 |
--------------------------------------------------------------------------------
/data/abstract.tex:
--------------------------------------------------------------------------------
1 | % 中英文摘要和关键字
2 | \begin{cabstract}
3 | 这里是中文摘要.
4 | \end{cabstract}
5 |
6 | \ckeywords{\TeX, \LaTeX, 模板, 论文}
7 |
8 | \begin{eabstract}
9 | Abstract in English.
10 | \end{eabstract}
11 |
12 | \ekeywords{\TeX, \LaTeX, Template, Thesis}
13 |
--------------------------------------------------------------------------------
/data/acknowledgement.tex:
--------------------------------------------------------------------------------
1 | % 致谢
2 | \begin{acknowledgement}
3 | 衷心感谢导师 xxx 教授对本人的精心指导.
4 | \end{acknowledgement}
5 |
--------------------------------------------------------------------------------
/data/appendix.tex:
--------------------------------------------------------------------------------
1 | \chapter{经典不等式}
2 | 论文中用到的经典不等式.\\
3 |
4 | \noindent{\bfseries (H\"older Inequality)}
5 | 设~$a_i\geq0$, $b_i\geq0$, $i=1$, $2$, $\cdots$, $n$, 且~$p>1$, $q>1$
6 | 满足~$1/p+1/q=1$. 则有
7 | \[
8 | \sum_{i=1}^{n}a_ib_i\leq\left(\sum_{i=1}^{n}a_i^p\right)^{\frac1p}
9 | \cdot\left(\sum_{i=1}^{n}b_i^q\right)^{\frac1q},
10 | \]
11 | 等号成立当且仅当存在一个常数~$c$ 满足~$a_i^p=cb_i^q$.\\
12 |
13 | \noindent{\bfseries (PM Inequality)}
14 | 设~$x_1$, $x_2$, $\ldots$, $x_n$ 是~$n$ 个非负实数. 如果~$0
1$, $q>1$ 满足 $1/p+1/q=1$. 证明
80 | \[
81 | \sum_{i=1}^{n}a_ib_i\leq\left(\sum_{i=1}^{n}a_i^p\right)^{1/p}
82 | \cdot\left(\sum_{i=1}^{n}b_i^q\right)^{1/q},
83 | \]
84 | 等号成立当且仅当 $a_i^p=cb_i^q$.
85 | \end{exercise}
86 |
87 | \begin{problem}
88 | 回答还是不回答, 是个问题.
89 | \end{problem}
--------------------------------------------------------------------------------
/data/chap04.tex:
--------------------------------------------------------------------------------
1 | % !Mode:: "TeX:UTF-8"
2 | \chapter{参考文献}
3 | \label{cha:bib}
4 | 参考文献可以直接写在 \texttt{thebibliography} 环境里, 利用 \cs{bibitem} 罗列文献条
5 | 目. 虽然费点功夫, 但是好控制, 各种格式可以自己随意改写.
6 |
7 | 本模板推荐使用 BIB\TeX, 样式文件为 \texttt{shuthesis.bst}, 基本符合学校的参考文献格
8 | 式. 看看这个例子: 关于书的~\cite{tex1989,algebra2000}, 还有这些 \cite{nikiforov2014,
9 | BuFanZhou2016:Z-eigenvalues,HuQiShao2013:Cored-Hypergraphs,KangNikiforov2014:Extremal-Problems,
10 | LinZhou2016:Distance-Spectral,LuMan2016:Small-Spectral-Radius,Nikiforov2017:Symmetric-Spectrum,
11 | Qi2014:H-Plus-Eigenvalues}.
12 |
13 | 有时候一些参考文献没有纸质出处, 需要标注 URL. 缺省情况下, URL 不会在连字符处断行,
14 | 这可能使得用连字符代替空格的网址分行很难看. 如果需要, 可以将模板类文件中
15 | \begin{verbatim}
16 | \RequirePackage{hyperref}
17 | \end{verbatim}
18 | 一行改为:
19 | \begin{verbatim}
20 | \PassOptionsToPackage{hyphens}{url}
21 | \RequirePackage{hyperref}
22 | \end{verbatim}
23 | 使得连字符处可以断行. 更多设置可以参考 \texttt{url} 宏包文档.
--------------------------------------------------------------------------------
/data/denotation.tex:
--------------------------------------------------------------------------------
1 | % !Mode:: "TeX:UTF-8"
2 | \begin{denotation}[2.5cm]
3 | \item[$\mathcal{T}$] 张量
4 | \item[$H$] 超图
5 | \item[$\mathcal{A}(H)$] 超图 $H$ 的邻接张量
6 | \item[$\mathcal{L}(H)$] 超图 $H$ 的拉普拉斯张量
7 | \item[$\mathcal{Q}(H)$] 超图 $H$ 的无符号拉普拉斯张量
8 | \item[$\rho$] 谱半径
9 | \item[$G$] 图
10 | \item[$\kappa$] 连通度
11 | \item[$\chi$] 染色数
12 | \item[$\Delta$] 最大度
13 | \item[$\delta$] 最小度
14 | \end{denotation}
15 |
--------------------------------------------------------------------------------
/data/publications.tex:
--------------------------------------------------------------------------------
1 | \begin{publications}
2 | \researchitem{发表的学术论文}
3 | \begin{enumerate}
4 | \item Lele Liu, Liying Kang, Xiying Yuan,
5 | On the principal eigenvectors of uniform hypergraphs.
6 | Linear Algebra and its Applications, 511 (2016) 430-446. (SCI 收录)
7 |
8 | \item Wei Zhang, Lele Liu, Liying Kang, Yanqin Bai,
9 | Some properties of the spectral radius for general hypergraphs.
10 | Linear Algebra and its Applications, 513 (2017) 103–119. (SCI 收录)
11 | \end{enumerate}
12 |
13 | \researchitem{研究成果}
14 | \begin{enumerate}
15 | \item Ahhy Lau, 上海大学研究生(硕博)学位论文 \LaTeX\ 模板 \shuthesis.
16 | \end{enumerate}
17 | \end{publications}
--------------------------------------------------------------------------------
/dtx-style.sty:
--------------------------------------------------------------------------------
1 | %%
2 | %% This is file `dtx-style.sty',
3 | %% generated with the docstrip utility.
4 | %%
5 | %% The original source files were:
6 | %%
7 | %% shuthesis.dtx (with options: `dtx-style')
8 | %%
9 | %% This is a generated file.
10 | %%
11 | %% Copyright (C) 2017-2017 by Lele Liu
12 | %%
13 | %% This file may be distributed and/or modified under the
14 | %% conditions of the LaTeX Project Public License, either version 1.3a
15 | %% of this license or (at your option) any later version.
16 | %% The latest version of this license is in:
17 | %%
18 | %% http://www.latex-project.org/lppl.txt
19 | %%
20 | %% and version 1.3a or later is part of all distributions of LaTeX
21 | %% version 2004/10/01 or later.
22 | %%
23 | %% To produce the documentation run the original source files ending with `.dtx'
24 | %% through LaTeX.
25 | %%
26 | \ProvidesPackage{dtx-style}
27 | \RequirePackage{hypdoc}
28 | \RequirePackage[UTF8,scheme=chinese]{ctex}
29 | \RequirePackage{newpxtext}
30 | \RequirePackage{newpxmath}
31 | \RequirePackage[
32 | top=2.5cm,
33 | bottom=2.5cm,
34 | left=4cm,
35 | right=2cm,
36 | headsep=3mm]{geometry}
37 | \RequirePackage{hyperref}
38 | \hypersetup{%
39 | linktoc=all,
40 | bookmarksnumbered=true,
41 | bookmarksopen=true,
42 | bookmarksopenlevel=1,
43 | breaklinks=true,
44 | colorlinks=true,
45 | citecolor=blue,
46 | linkcolor=blue,
47 | urlcolor=blue,
48 | plainpages=false,
49 | pdfborder=0 0 0}
50 | \RequirePackage{array,longtable,booktabs,makecell}
51 | \RequirePackage{listings}
52 | \RequirePackage{fancyhdr}
53 | \RequirePackage{xcolor}
54 | \RequirePackage{enumitem}
55 | \RequirePackage{etoolbox}
56 | \RequirePackage{metalogo}
57 |
58 | \definecolor{medpurple}{RGB}{170,0,255}
59 | \definecolor{lightpurple}{RGB}{223,63,250}
60 | \colorlet{shu@macro}{blue!60!black}
61 | \colorlet{shu@env}{blue!70!black}
62 | \colorlet{shu@option}{purple}
63 | \patchcmd{\PrintMacroName}{\MacroFont}{\MacroFont\bfseries\color{shu@macro}}{}{}
64 | \patchcmd{\PrintDescribeMacro}{\MacroFont}{\MacroFont\bfseries\color{shu@macro}}{}{}
65 | \patchcmd{\PrintDescribeEnv}{\MacroFont}{\MacroFont\bfseries\color{shu@env}}{}{}
66 | \patchcmd{\PrintEnvName}{\MacroFont}{\MacroFont\bfseries\color{shu@env}}{}{}
67 |
68 | \def\DescribeOption{%
69 | \leavevmode\@bsphack\begingroup\MakePrivateLetters%
70 | \Describe@Option}
71 | \def\Describe@Option#1{\endgroup
72 | \marginpar{\raggedleft\PrintDescribeOption{#1}}%
73 | \shu@special@index{option}{#1}\@esphack\ignorespaces}
74 | \def\PrintDescribeOption#1{\strut \MacroFont\bfseries\sffamily\color{shu@option} #1\ }
75 | \def\shu@special@index#1#2{\@bsphack
76 | \begingroup
77 | \HD@target
78 | \let\HDorg@encapchar\encapchar
79 | \edef\encapchar usage{%
80 | \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}%
81 | }%
82 | \index{#2\actualchar{\string\ttfamily\space#2}
83 | (#1)\encapchar usage}%
84 | \index{#1:\levelchar#2\actualchar
85 | {\string\ttfamily\space#2}\encapchar usage}%
86 | \endgroup
87 | \@esphack}
88 |
89 | \lstdefinestyle{lstStyleBase}{%
90 | basicstyle=\small\ttfamily,
91 | aboveskip=\medskipamount,
92 | belowskip=\medskipamount,
93 | lineskip=0pt,
94 | boxpos=c,
95 | showlines=false,
96 | extendedchars=true,
97 | upquote=true,
98 | tabsize=2,
99 | showtabs=false,
100 | showspaces=false,
101 | showstringspaces=false,
102 | numbers=none,
103 | linewidth=\linewidth,
104 | xleftmargin=4pt,
105 | xrightmargin=0pt,
106 | resetmargins=false,
107 | breaklines=true,
108 | breakatwhitespace=false,
109 | breakindent=0pt,
110 | breakautoindent=true,
111 | columns=flexible,
112 | keepspaces=true,
113 | gobble=2,
114 | framesep=3pt,
115 | rulesep=1pt,
116 | framerule=1pt,
117 | backgroundcolor=\color{gray!5},
118 | stringstyle=\color{green!40!black!100},
119 | keywordstyle=\bfseries\color{blue!50!black},
120 | commentstyle=\slshape\color{black!60}}
121 |
122 | \lstdefinestyle{lstStyleShell}{%
123 | style=lstStyleBase,
124 | frame=l,
125 | rulecolor=\color{lightpurple},
126 | language=bash}
127 |
128 | \lstdefinestyle{lstStyleLaTeX}{%
129 | style=lstStyleBase,
130 | frame=l,
131 | rulecolor=\color{lightpurple},
132 | language=[LaTeX]TeX}
133 |
134 | \lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{}
135 | \lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{}
136 |
137 | \setlist{nosep}
138 |
139 | \DeclareDocumentCommand{\option}{m}{\textsf{#1}}
140 | \DeclareDocumentCommand{\env}{m}{\texttt{#1}}
141 | \DeclareDocumentCommand{\pkg}{s m}{%
142 | \texttt{#2}\IfBooleanF#1{\shu@special@index{package}{#2}}}
143 | \DeclareDocumentCommand{\file}{s m}{%
144 | \texttt{#2}\IfBooleanF#1{\shu@special@index{file}{#2}}}
145 | \newcommand{\myentry}[1]{%
146 | \marginpar{\raggedleft\color{purple}\bfseries\strut #1}}
147 | \newcommand{\note}[2][Note]{{%
148 | \color{medpurple}{\bfseries #1}\emph{#2}}}
149 |
150 | \def\shuthesis{\textsc{Shu}\-\textsc{Thesis}}
151 | \endinput
152 | %%
153 | %% End of file `dtx-style.sty'.
154 |
--------------------------------------------------------------------------------
/figures/shu.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahhylau/shuthesis/b5437e3b745e8fc2282691f8ec26f38bfe1de1ad/figures/shu.pdf
--------------------------------------------------------------------------------
/figures/shublack.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahhylau/shuthesis/b5437e3b745e8fc2282691f8ec26f38bfe1de1ad/figures/shublack.pdf
--------------------------------------------------------------------------------
/figures/shulogo.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahhylau/shuthesis/b5437e3b745e8fc2282691f8ec26f38bfe1de1ad/figures/shulogo.pdf
--------------------------------------------------------------------------------
/figures/shulogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahhylau/shuthesis/b5437e3b745e8fc2282691f8ec26f38bfe1de1ad/figures/shulogo.png
--------------------------------------------------------------------------------
/figures/shulogoblack.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahhylau/shuthesis/b5437e3b745e8fc2282691f8ec26f38bfe1de1ad/figures/shulogoblack.pdf
--------------------------------------------------------------------------------
/main.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahhylau/shuthesis/b5437e3b745e8fc2282691f8ec26f38bfe1de1ad/main.pdf
--------------------------------------------------------------------------------
/main.tex:
--------------------------------------------------------------------------------
1 | % !Mode:: "TeX:UTF-8"
2 | \documentclass[type=doctor,openany,pifootnote]{shuthesis}
3 | % 选项:
4 | % type=[master|doctor], % 必选
5 | % secret, % 可选 (如果论文需要保密, 这一项需要打开)
6 | % pifootnote, % 可选(建议打开)
7 | % openany|openright, % 可选 (章首页是右开还是任意开, 默认是右开)
8 | % nocolor % 提交最终版本时请打开此选项
9 | \usepackage{shuthesis}
10 | \graphicspath{{figures/}}
11 |
12 | \begin{document}
13 | \frontmatter
14 | \shusetup{
15 | %%%%%%%% 1. 配置里面不要出现空行. 2. 不需要的配置信息可以删除. %%%%%%%%%%%
16 | secretlevel={公开}, % 秘级
17 | % 中文信息
18 | ctitle={上海大学研究生(硕博)学位\\ 论文 \LaTeX\ 模板使用示例文档 v\version},
19 | cdisciplines={理学},
20 | cdepartment={理学院},
21 | cmajor={运筹学与控制论},
22 | cauthor={ahhylau},
23 | csupervisor={},
24 | id={15820019},
25 | catalognumber={O157},
26 | cdate={2017 年 5 月},
27 | coverdate={\zhdigits{2017}年\zhnumber{5}月},
28 | % 英文信息
29 | etitle={An Introduction to \LaTeX{} Thesis Template of Shanghai University v\version},
30 | edisciplines={Science},
31 | edepartment={Department of Mathematics},
32 | emajor={Operational Research and Control Theory},
33 | eauthor={ahhylau},
34 | esupervisor={},
35 | edate={May, 2017}
36 | }
37 |
38 | \input{data/abstract}
39 | \makefirstpage % 生成带有学校 logo 的封面
40 | \makecover
41 |
42 | \tableofcontents % 目录
43 |
44 | \input{data/denotation} % 符号对照表
45 |
46 | % 正文部分
47 | \mainmatter
48 | \include{data/chap01}
49 | \include{data/chap02}
50 | \include{data/chap03}
51 | \include{data/chap04}
52 | \listoffigures % 插图索引
53 | \listoftables % 表格索引
54 | % 参考文献.
55 | \bibliographystyle{shuthesis}
56 | \bibliography{reference/refs}
57 |
58 | \include{data/publications} % 发表论文清单
59 | \include{data/acknowledgement} % 致谢
60 |
61 | \backmatter
62 | \begin{appendix}
63 | \input{data/appendix}
64 | \end{appendix}
65 |
66 | \end{document}
67 |
--------------------------------------------------------------------------------
/make-doc.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | latex shuthesis.ins
3 | xelatex shuthesis.dtx
4 | makeindex -s gind.ist -o shuthesis.ind shuthesis.idx
5 | makeindex -s gglo.ist -o shuthesis.gls shuthesis.glo
6 | xelatex shuthesis.dtx
7 | xelatex shuthesis.dtx
8 | call clean.bat
9 | cls
10 | echo ****************************************************
11 | echo make done!!!
12 | echo ****************************************************
13 | pause
14 |
--------------------------------------------------------------------------------
/reference/refs.bib:
--------------------------------------------------------------------------------
1 | @book{tex1989,
2 | author = {Donald E. Knuth},
3 | title = {The {\TeX} Book},
4 | publisher = {Addison-Wesley Publishing Company},
5 | address = {Reading, MA},
6 | year = {1989},
7 | edition = {15th},
8 | }
9 |
10 | @article{nikiforov2014,
11 | author = {Nikiforov, Vladimir},
12 | title = {Analytic methods for uniform hypergraphs},
13 | journal = {Linear Algebra and its Applications},
14 | pages = {455-535},
15 | volume = {457},
16 | year = {2014},
17 | }
18 |
19 | @book{algebra2000,
20 | title = {代数学引论},
21 | author = {聂灵沼 and 丁石孙},
22 | publisher = {高等教育出版社},
23 | address = {北京},
24 | year = {2000},
25 | }
26 |
27 | @Article{LuMan2016:Small-Spectral-Radius,
28 | author = {Lu, L. and Man, S.},
29 | title = {Connected hypergraphs with small spectral radius},
30 | journal = {Linear Algebra and its Applications},
31 | year = {2016},
32 | volume = {509},
33 | pages = {206-227},
34 | doi = {10.1016/j.laa.2016.07.013},
35 | }
36 |
37 | @Article{HuQiShao2013:Cored-Hypergraphs,
38 | author = {Hu, S. and Qi, L. and Shao, J.},
39 | title = {Cored hypergraphs, power hypergraphs and their {L}aplacian {H}-eigenvalues},
40 | journal = {Linear Algebra and its Applications},
41 | year = {2013},
42 | volume = {439},
43 | pages = {2980-2998},
44 | doi = {10.1016/j.laa.2013.08.028},
45 | }
46 |
47 | @Article{LinZhou2016:Distance-Spectral,
48 | author = {Lin, H. and Zhou, B.},
49 | title = {Distance spectral radius of uniform hypergraphs},
50 | journal = {Linear Algebra and its Applications},
51 | year = {2016},
52 | volume = {506},
53 | pages = {564-578},
54 | doi = {10.1016/j.laa.2016.06.011},
55 | }
56 |
57 | @Article{KangNikiforov2014:Extremal-Problems,
58 | author = {Kang, L. and Nikiforov, V.},
59 | title = {Extremal problems for the $p$-spectral radius of graphs},
60 | journal = {Electronic Journal of Combinatorics},
61 | year = {2014},
62 | volume = {21},
63 | number = {3},
64 | pages = {P3.21},
65 | }
66 |
67 | @Article{Qi2014:H-Plus-Eigenvalues,
68 | author = {Qi, L.},
69 | title = {H$^+$-eigenvalues of {L}aplacian and signless {L}aplacian tensors},
70 | journal = {Communications in Mathematical Sciences},
71 | year = {2014},
72 | volume = {12},
73 | number = {6},
74 | pages = {1045-1064},
75 | }
76 |
77 | @Article{Nikiforov2017:Symmetric-Spectrum,
78 | author = {Nikiforov, V.},
79 | title = {Hypergraphs and hypermatrices with symmetric spectrum},
80 | journal = {Linear Algebra and its Applications},
81 | year = {2017},
82 | volume = {519},
83 | pages = {1-18},
84 | doi = {10.1016/j.laa.2016.12.038},
85 | }
86 |
87 | @Article{BuFanZhou2016:Z-eigenvalues,
88 | author = {Bu, C. and Fan, Y. and Zhou, J.},
89 | title = {Laplacian and signless {L}aplacian {Z}-eigenvalues of uniform hypergraphs},
90 | journal = {Frontiers of Mathematics in China},
91 | year = {2016},
92 | volume = {11},
93 | number = {3},
94 | pages = {511-520},
95 | }
96 |
97 |
98 |
--------------------------------------------------------------------------------
/shuthesis.bst:
--------------------------------------------------------------------------------
1 | %% shuthesis.bst
2 | %%
3 | %% 上海大学学位论文参考文献 BibTeX 样式. 本样式基于 TJUThesis.bst.
4 | %%
5 | %% 更新记录:
6 | %% $LastChangedBy$
7 | %% $LastChangedDate$
8 | %% $LastChangedRevision$
9 |
10 | %% 一些设置的缺省值
11 | % 英文姓名排版格式字符串, 按~<, Jr.>格式
12 | FUNCTION {default.name.format.string} {"{vv~}{ll}{~f}{, Jj}"}
13 |
14 | % 列出的最多作者数目, 即当作者数目超过下列数字时, 超出部分的作者姓名将略去
15 | FUNCTION {default.max.num.names.before.forced.et.al} { #3 }
16 |
17 | % 是否为盲审版本, #0 表示盲审将隐去作者信息, #1 表示非盲审
18 | FUNCTION {default.is.for.peer.review} { #0 }
19 | %%%%%%%%%%%%%%
20 | % 一些辅助函数
21 | %%%%%%%%%%%%%%
22 | % #0 不在终端显示开始/完成的提示信息
23 | % #1 显示提示信息
24 | FUNCTION {is.print.banners.to.terminal} {#1}
25 |
26 | %%%%%%%%%%%%%%%%
27 | % 版本与提示信息
28 | %%%%%%%%%%%%%%%%
29 | % 版本信息
30 | FUNCTION{bst.file.version} { "2.0" }
31 | FUNCTION{bst.file.date} { "2017/05/05" }
32 |
33 | % 开始提示信息
34 | FUNCTION {banner.message}{
35 | is.print.banners.to.terminal
36 | { "-- shuthesis.bst version" " " * bst.file.version *
37 | " (" * bst.file.date * ") " * "by ahhylau." *
38 | top$
39 | "-- See the " quote$ * "shuyhesis.pdf" * quote$ *
40 | " manual for usage information." *
41 | top$
42 | }
43 | { skip$ }
44 | if$
45 | }
46 |
47 | % 完成提示信息
48 | FUNCTION {completed.message} {
49 | is.print.banners.to.terminal
50 | { "" top$ "Done." top$ }
51 | { skip$ }
52 | if$
53 | }
54 |
55 | %%%%%%%%%%%%%%%%%%%
56 | %% 预定义的字符串宏
57 | %%%%%%%%%%%%%%%%%%%
58 | % 英文月份
59 | MACRO {jan} {"January"}
60 | MACRO {feb} {"February"}
61 | MACRO {mar} {"March"}
62 | MACRO {apr} {"April"}
63 | MACRO {may} {"May"}
64 | MACRO {jun} {"June"}
65 | MACRO {jul} {"July"}
66 | MACRO {aug} {"August"}
67 | MACRO {sep} {"September"}
68 | MACRO {oct} {"October"}
69 | MACRO {nov} {"November"}
70 | MACRO {dec} {"December"}
71 |
72 | %%%%%%%%%%%%
73 | %% 条目定义
74 | %%%%%%%%%%%%
75 | ENTRY { address % 地址
76 | assignee % 标准授权人
77 | author % 作者
78 | booktitle % 专著/论文集名
79 | chapter %
80 | day %
81 | dayfiled %
82 | edition % 版本
83 | editor % 编者
84 | howpublished % 出版形式
85 | esubtype % 电子文献子类
86 | institution %
87 | journal % 期刊
88 | key %
89 | language % 语言
90 | month % 月
91 | monthfiled %
92 | nationality %
93 | newsletter %
94 | note %
95 | number %
96 | number2 %
97 | organization %
98 | pages %
99 | publisher %
100 | refdate %
101 | update % 电子文档更新或修改日期
102 | school %
103 | series %
104 | title %
105 | translator %
106 | type %
107 | volume %
108 | volume2 %
109 | year %
110 | year2 %
111 | yearfiled %
112 | url % URL
113 | pubaddress % 出版地
114 | CTLname_format_string % 作者英文姓名排版格式
115 | CTLmax_names_forced_etal % 强制略去的最大作者数
116 | CTLauthor_name_english % 作者英文姓名
117 | CTLauthor_name_chinese % 作者中文姓名
118 | CTLfor_peer_review % 是否匿名
119 | }
120 | {}
121 | { label }
122 |
123 | %%%%%%%%%%%%%
124 | %% 字符串常量
125 | %%%%%%%%%%%%%
126 | % FUNCTION {bbl.anonymous} { language empty$ { "Anon" } { "佚名" } if$ }
127 | FUNCTION {bbl.anonymous} { "" }
128 | FUNCTION {bbl.etal} { language empty$ { "et~al" } { "等" } if$ }
129 | FUNCTION {bbl.sine.loco} { language empty$ { "S.~l." } { "出版地不详" } if$ }
130 | FUNCTION {bbl.sine.nomine} { language empty$ { "s.~n." } { "出版者不详" } if$ }
131 |
132 | FUNCTION {bbl.comma} { language empty$ { ", " } { "," } if$ }
133 | FUNCTION {bbl.colon} { language empty$ { ": " } { ":" } if$ }
134 | FUNCTION {bbl.period} { language empty$ { "." } { "." } if$ }
135 | FUNCTION {bbl.parallel} { "~//~" }
136 |
137 | FUNCTION {bbl.st} { "st" } % 序数词后缀
138 | FUNCTION {bbl.nd} { "nd" } % 序数词后缀
139 | FUNCTION {bbl.rd} { "rd" } % 序数词后缀
140 | FUNCTION {bbl.th} { "th" } % 序数词后缀
141 |
142 | FUNCTION {bbl.number} { "第" }
143 | FUNCTION {bbl.author} { "作者" }
144 |
145 | %%%%%%%%%%%%
146 | %% 整型变量
147 | %%%%%%%%%%%
148 | INTEGERS { output.state before.all mid.sentence after.title after.sentence url.sentence after.block before.pages }
149 | INTEGERS { number.label longest.label.width multiresult
150 | nameptr namesleft numnames lastnamecapitalized namelength charptr }
151 | INTEGERS { max.num.names.before.forced.et.al }
152 | INTEGERS { is.for.peer.review }
153 |
154 | %%%%%%%%%%%%%
155 | %% 字符串变量
156 | %%%%%%%%%%%%%
157 | STRINGS { s
158 | t
159 | longest.label
160 | thename
161 | name.emph.author.en % 强调现实的作者英文姓名
162 | name.emph.author.zh % 强调显示的作者中文姓名
163 | name.format.string % 姓名的格式字符串
164 | author.name.in.english % 作者英文姓名
165 | author.name.in.chinese % 作者中文姓名
166 | }
167 |
168 | %%%%%%%%%%%%%%%%%%%%%
169 | %% LaTeX 参考文献代码
170 | %%%%%%%%%%%%%%%%%%%%%
171 |
172 | % 输出 .bbl 文件开始
173 | FUNCTION {begin.bib} {
174 | "% Generated by shuthesis.bst, version: " bst.file.version *
175 | " (" * bst.file.date * ")" *
176 | write$ newline$ % 输出注释行, 说明产生该 bbl 的 bst 及版本
177 |
178 | preamble$ empty$ % 输出前导
179 | 'skip$
180 | { preamble$ write$ newline$ }
181 | if$
182 |
183 | "\begin{thebibliography}{" longest.label * "}" *
184 | write$ newline$ % 输出 \begin{thebiliography}{x}
185 | }
186 |
187 | % 输出 .bbl 文件结束部分
188 | FUNCTION {end.bib} {
189 | newline$
190 | "\end{thebibliography}"
191 | write$ newline$
192 | }
193 |
194 | %%%%%%%%%%%%
195 | %% 底层函数
196 | %%%%%%%%%%%%
197 |
198 | % 控制变量初始化
199 | FUNCTION {initialize.controls} {
200 | default.name.format.string 'name.format.string :=
201 | default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al :=
202 | default.is.for.peer.review 'is.for.peer.review :=
203 | }
204 |
205 | % 初始化最长 label
206 | FUNCTION {initialize.longest.label} {
207 | "" 'longest.label :=
208 | #1 'number.label :=
209 | #0 'longest.label.width :=
210 | }
211 |
212 | % 最长 label pass
213 | FUNCTION {longest.label.pass}
214 | { number.label int.to.str$ 'label :=
215 | number.label #1 + 'number.label :=
216 | label width$ longest.label.width >
217 | { label 'longest.label :=
218 | label width$ 'longest.label.width :=
219 | }
220 | { skip$ }
221 | if$
222 | }
223 |
224 | % 逻辑非: 栈顶元素的逻辑非
225 | FUNCTION {not} {
226 | { #0 }
227 | { #1 }
228 | if$
229 | }
230 |
231 | % 逻辑与
232 | FUNCTION {and} {
233 | { skip$ }
234 | { pop$ #0 }
235 | if$
236 | }
237 |
238 | % 逻辑或
239 | FUNCTION {or} {
240 | { pop$ #1 }
241 | { skip$ }
242 | if$
243 | }
244 |
245 | % 返回 #1 : 栈顶字符是数字"0"~"9"
246 | % 返回 #0 : 其他
247 | FUNCTION {is.num} {
248 | chr.to.int$
249 | duplicate$ "0" chr.to.int$ < not
250 | swap$ "9" chr.to.int$ > not and
251 | }
252 |
253 | % 栈顶整数乘以 10
254 | FUNCTION {bump.int.mag} {
255 | #0 'multiresult := % 初始化乘运算结果 y <- 0
256 | { duplicate$ #0 > } % 栈顶整数 x = 0 时才停止循环
257 | { #1 - % x <- x - 1
258 | multiresult #10 +
259 | 'multiresult := % y <- y + 10
260 | }
261 | while$
262 | pop$ % 释放 x
263 | multiresult % y 压栈返回
264 | }
265 |
266 | % 将栈顶字符("0"~"9")转换为整数(0~9)
267 | FUNCTION {char.to.integer} {
268 | duplicate$
269 | is.num
270 | { chr.to.int$ "0" chr.to.int$ - }
271 | { "noninteger character " quote$ * swap$ * quote$ *
272 | " in integer field of " * cite$ * warning$
273 | #0 % 如果栈定字符不是("0"~"9"), 给出警告返回 0
274 | }
275 | if$
276 | }
277 |
278 | % 将栈顶字符串转换为整数
279 | FUNCTION {string.to.integer} {
280 | duplicate$ text.length$ 'namesleft := % namesleft <- 字符串长度
281 | #1 'nameptr := % nameptr <- 1
282 | #0 'numnames := % numnames <- 0
283 | { nameptr namesleft > not } % while( ! ( nameptr > namesleft ) )
284 | { duplicate$ nameptr #1 substring$ % 取第 nameptr 个字符 x
285 | char.to.integer numnames bump.int.mag +
286 | 'numnames := % numnames <- chr2int( x ) + 10 * numnames
287 | nameptr #1 +
288 | 'nameptr := % nameptr <- nameptr + 1
289 | }
290 | while$
291 | pop$ % 释放栈顶元素
292 | numnames % numnames 压栈返回
293 | }
294 |
295 | % convert the strings "yes" or "no" to #1 or #0 respectively
296 | FUNCTION {yes.no.to.int}
297 | { "l" change.case$ duplicate$
298 | "yes" =
299 | { pop$ #1 }
300 | { duplicate$ "no" =
301 | { pop$ #0 }
302 | { "unknown boolean " quote$ * swap$ * quote$ *
303 | " in " * cite$ * warning$
304 | #0
305 | }
306 | if$
307 | }
308 | if$
309 | }
310 |
311 | % 初始化状态常量
312 | FUNCTION {initialize.status.constants}
313 | { #0 'before.all := % 起始
314 | #1 'mid.sentence := % 句中
315 | #2 'after.sentence := % 句末
316 | #3 'after.block := % 块后
317 | #4 'after.title := %
318 | #5 'before.pages := %
319 | }
320 |
321 | FUNCTION {remove.char}
322 | { 't :=
323 | 's :=
324 | ""
325 | { s empty$ not }
326 | { s #1 #1 substring$
327 | s #2 global.max$ substring$ 's :=
328 | duplicate$ t = 'pop$
329 | { * }
330 | if$
331 | }
332 | while$
333 | }
334 |
335 | STRINGS {z}
336 | FUNCTION {remove.period}
337 | { 'z :=
338 | ""
339 | { z empty$ not }
340 | { z #1 #1 substring$
341 | z #2 global.max$ substring$ 'z :=
342 | duplicate$ "." = 'pop$
343 | { * }
344 | if$
345 | }
346 | while$
347 | }
348 |
349 | FUNCTION {remove.dots} {
350 | duplicate$ "input=" swap$ * warning$
351 | "language=" language * warning$
352 | language empty$
353 | { "." remove.char
354 | duplicate$ "output('.')=" swap$ * warning$ }
355 | { "." remove.char
356 | duplicate$ "output('.')=" swap$ * warning$
357 | "." remove.char
358 | duplicate$ "output('.')=" swap$ * warning$ }
359 | if$
360 | }
361 |
362 | FUNCTION {bibinfo.check}
363 | { swap$
364 | duplicate$ missing$
365 | {
366 | pop$ pop$
367 | ""
368 | }
369 | { duplicate$ empty$
370 | {
371 | swap$ pop$
372 | }
373 | { swap$
374 | pop$
375 | }
376 | if$
377 | }
378 | if$
379 | }
380 |
381 | %%%%%%%%%%%%
382 | %% 调试例程
383 | %%%%%%%%%%%%
384 |
385 | % 默认调试输出函数
386 | FUNCTION {debug.output} {
387 | "[DEBUG] " swap$ * top$
388 | }
389 |
390 | % 状态调试输出函数
391 | FUNCTION {debug.output.status} {
392 | "---- output.state="
393 | output.state before.all =
394 | { "before.all" }
395 | { output.state mid.sentence =
396 | { "mid.sentence" }
397 | { output.state after.sentence =
398 | { "after.sentence" }
399 | { output.state url.sentence =
400 | { "url.sentence" }
401 | { output.state before.pages =
402 | { "before.pages" }
403 | { "after.block" }
404 | if$
405 | }
406 | if$
407 | }
408 | if$
409 | }
410 | if$
411 | }
412 | if$
413 | * debug.output
414 | }
415 |
416 | FUNCTION {output.year}
417 | { 't :=
418 | number empty$
419 | volume empty$
420 | and
421 | { add.period$ write$ }
422 | { ", " * write$ }
423 | if$
424 | t
425 | }
426 |
427 | % STRINGS {z}
428 | % FUNCTION {remove.dots}
429 | % { 'z :=
430 | % ""
431 | % { z empty$ not }
432 | % { z #1 #1 substring$
433 | % z #2 global.max$ substring$ 'z :=
434 | % duplicate$ bbl.period = 'pop$
435 | % { * }
436 | % if$
437 | % }
438 | % while$
439 | % %z
440 | % }
441 |
442 | % 对于中文文献, 用全角句点替换英文句点
443 | FUNCTION {replace.half.width.period} {
444 | % % DEBUG
445 | % duplicate$ "-- replace.half.width.period(" swap$ * ")" * debug.output
446 | % % END OF DEBUG
447 | language empty$
448 | { " " * } % 对于英文文献, 在句点后加一空格
449 | { duplicate$ text.length$ 'numnames := % numnames 等于字符串长度
450 | % % DEBUG
451 | % numnames int.to.str$ "---- text.length$=" swap$ * debug.output
452 | % % END OF DEBUG
453 | duplicate$ numnames #1 substring$ "." =
454 | { % % DEBUG
455 | % "---- Found '.' at the end" debug.output
456 | % % END OF DEBUG
457 | numnames #1 -
458 | #1 swap$ substring$
459 | bbl.period *
460 | }
461 | { skip$ }
462 | if$
463 | }
464 | if$
465 | % % DEBUG
466 | % duplicate$ "---- Return=" swap$ * debug.output
467 | % % END OF DEBUG
468 | }
469 |
470 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
471 | %% 输出例程: 输出栈顶项并根据需要添加标点符号
472 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
473 |
474 | % 非空项输出函数: 用于输出非空项
475 | FUNCTION {output.nonnull} {
476 | % % DEBUG
477 | % duplicate$ "output.nonnull(" swap$ * ")" * debug.output
478 | % debug.output.status
479 | % % END OF DEBUG
480 | swap$
481 | % 根据当前输出状态添加前置标点符号
482 | % before.all 起始, 不添加任何标点符号直接输出
483 | % mid.sentence 句中, 前置逗号输出
484 | % after.sentence 句末, 前置句号输出
485 | % after.block 块后, 前置句号, 后置 \newblock 输出
486 | % after.title
487 | output.state mid.sentence =
488 | { bbl.comma * write$ } % mid.sentence 前置逗号
489 | { output.state after.block =
490 | { add.period$ % 块后, 后置句号
491 | replace.half.width.period % 为中文文献替换句点
492 | write$
493 | newline$
494 | % "\newblock " write$
495 | } % 后置 \newblock 输出
496 | { output.state before.all =
497 | { write$ } % 起始, 不添加任何标点符号直接输出
498 | { output.state after.title =
499 | { bbl.parallel *
500 | write$ }
501 | { output.state before.pages =
502 | { bbl.colon *
503 | write$ }
504 | { add.period$ % 句末, 前置句号输出
505 | replace.half.width.period
506 | write$ } %
507 | if$
508 | }
509 | if$
510 | }
511 | if$
512 | }
513 | if$
514 | mid.sentence 'output.state :=
515 | }
516 | if$
517 | % s
518 | }
519 |
520 | % 无警告输出函数
521 | FUNCTION {output} {
522 | duplicate$ empty$
523 | { pop$ } % 若输出项为空, 则舍去空输出项
524 | { output.nonnull } % 否则调用非空输出函数
525 | if$
526 | }
527 |
528 | % 警告输出函数: 同 output, 但是对于空项给出警告提示
529 | FUNCTION {output.warn}
530 | { 't :=
531 | duplicate$ empty$
532 | { pop$ "empty " t * " in " * cite$ * warning$ }
533 | { output.nonnull }
534 | if$
535 | }
536 |
537 | % 将数字字符串转换成序数词形式字符串(例如: "7" -> "7th")
538 | FUNCTION {num.to.ordinal} {
539 | duplicate$ #-1 #1 substring$ "1" =
540 | { bbl.st * }
541 | { duplicate$ #-1 #1 substring$ "2" =
542 | { bbl.nd * }
543 | { duplicate$ #-1 #1 substring$ "3" =
544 | { bbl.rd * }
545 | { bbl.th * }
546 | if$
547 | }
548 | if$
549 | }
550 | if$
551 | }
552 |
553 | % 从字符串中提取前导数字的函数
554 | % 如果栈顶字符串以数字开头(例如: "11th"), 则将字符串用其数字部分(即,"11")
555 | % 替换. 否则, 保持原字符串不变. 用于版本转换函数(convert.edition)
556 | % s 保存提取出的数字, t 保存剩余待扫描的字符串.
557 | FUNCTION {extract.num} {
558 | duplicate$ 't := % t <- 输入字符串
559 | "" 's := % s <- ""
560 | { t empty$ not } % while( t != "" ) {
561 | { t #1 #1 substring$ % tmp <- t[0]
562 | t #2 global.max$ substring$
563 | 't := % t <- t[2:global.max$]
564 | duplicate$ is.num % if( is.num( tmp ) )
565 | { s swap$ * 's := } % s <- s & tmp
566 | { pop$ "" 't := } % else t <- ""
567 | if$ % }
568 | } %
569 | while$ % if( s == "" )
570 | s empty$ % ;
571 | 'skip$ % else
572 | { pop$ s } % return s
573 | if$ %
574 | }
575 |
576 | % 将1st~10th单词形式的序数词转换成阿拉伯数字形式
577 | FUNCTION {word.to.num} {
578 | duplicate$ "l" change.case$
579 | 's := % s <- lower( arg )
580 | s "first" = % if ( s == "first" )
581 | { pop$ "1" } % return "1"
582 | { skip$ }
583 | if$
584 | s "second" = % if ( s == "second" )
585 | { pop$ "2" } % return "2"
586 | { skip$ }
587 | if$
588 | s "third" =
589 | { pop$ "3" }
590 | { skip$ }
591 | if$
592 | s "fourth" =
593 | { pop$ "4" }
594 | { skip$ }
595 | if$
596 | s "fifth" =
597 | { pop$ "5" }
598 | { skip$ }
599 | if$
600 | s "sixth" =
601 | { pop$ "6" }
602 | { skip$ }
603 | if$
604 | s "seventh" =
605 | { pop$ "7" }
606 | { skip$ }
607 | if$
608 | s "eighth" =
609 | { pop$ "8" }
610 | { skip$ }
611 | if$
612 | s "ninth" =
613 | { pop$ "9" }
614 | { skip$ }
615 | if$
616 | s "tenth" =
617 | { pop$ "10" }
618 | { skip$ }
619 | if$
620 | }
621 |
622 | % 转换字符串形式的序数词为数字形式的序数词
623 | % 例如: 将 "Eleventh" 转换为 "11th"
624 | FUNCTION {convert.edition} {
625 | duplicate$ empty$ 'skip$
626 | { duplicate$ #1 #1 substring$
627 | is.num % if( is.num( arg[1] ) ) {
628 | { extract.num % tmp <- extract.num( arg )
629 | num.to.ordinal % tmp <- num.to.ordinal( tmp )
630 | } % } else {
631 | { word.to.num % tmp <- word.to.num( arg )
632 | duplicate$ #1 #1 substring$
633 | is.num % if( is.num( tmp[1] ) )
634 | { num.to.ordinal } % tmp <- num.to.ordinal( tmp )
635 | { "edition ordinal word "
636 | quote$ * edition * quote$ *
637 | " may be too high (or improper) for conversion" *
638 | " in " * cite$ * warning$ % else output warning
639 | }
640 | if$
641 | }
642 | if$
643 | }
644 | if$
645 | }
646 |
647 | FUNCTION {start.entry}
648 | { newline$
649 | "\bibitem{" write$
650 | cite$ write$
651 | "}" write$
652 | newline$
653 | ""
654 | before.all 'output.state :=
655 | }
656 |
657 | FUNCTION {fin.entry}
658 | { add.period$
659 | replace.half.width.period
660 | write$
661 | newline$
662 | }
663 |
664 | % FUNCTION {fin.entry}
665 | % { duplicate$ empty$
666 | % 'pop$
667 | % 'write$
668 | % if$
669 | % newline$
670 | % }
671 |
672 | FUNCTION {new.block}
673 | { output.state before.all =
674 | 'skip$
675 | { after.block 'output.state := }
676 | if$
677 | }
678 |
679 | FUNCTION {new.sentence}
680 | { output.state after.block =
681 | 'skip$
682 | { output.state before.all =
683 | 'skip$
684 | { after.sentence 'output.state := }
685 | if$
686 | }
687 | if$
688 | }
689 |
690 | FUNCTION {new.block.checka}
691 | { empty$
692 | 'skip$
693 | 'new.block
694 | if$
695 | }
696 |
697 | FUNCTION {new.block.checkb}
698 | { empty$
699 | swap$ empty$
700 | and
701 | 'skip$
702 | 'new.block
703 | if$
704 | }
705 |
706 | FUNCTION {new.sentence.checka}
707 | { empty$
708 | 'skip$
709 | 'new.sentence
710 | if$
711 | }
712 |
713 | FUNCTION {new.sentence.checkb}
714 | { empty$
715 | swap$ empty$
716 | and
717 | 'skip$
718 | 'new.sentence
719 | if$
720 | }
721 |
722 | FUNCTION {field.or.null}
723 | { duplicate$ empty$
724 | { pop$ "" }
725 | 'skip$
726 | if$
727 | }
728 |
729 | FUNCTION {emphasize}
730 | { duplicate$ empty$
731 | { pop$ "" }
732 | { "{\em " swap$ * "}" * }
733 | if$
734 | }
735 |
736 |
737 |
738 | FUNCTION {format.language}
739 | { language empty$
740 | 'skip$
741 | 'skip$
742 | if$
743 | }
744 | FUNCTION {is.space}
745 | { chr.to.int$
746 | duplicate$ #32 =
747 | { pop$ #1 }
748 | { pop$ #0 }
749 | if$
750 | }
751 | FUNCTION {is.lower.char}
752 | {
753 | chr.to.int$
754 | duplicate$ #96 >
755 | { #123 <
756 | { #1 }
757 | { #0 }
758 | if$
759 | }
760 | { pop$ #0 }
761 | if$
762 | }
763 |
764 | % 将 last name 转换为全大写
765 | FUNCTION {capitalize.last.name} {
766 | "u" change.case$
767 | }
768 | % FUNCTION {capitalize.last.name}
769 | % {
770 | % 'thename := % 输入参数 thename
771 | % thename text.length$
772 | % 'namelength := % namelength := thename 的长度
773 | % #1 'charptr :=
774 | % #0 'lastnamecapitalized :=
775 | % ""
776 |
777 | % { charptr #1 - namelength <
778 | % % % debug
779 | % % duplicate$ int.to.str$ "( charptr + #1 > namelength ) == " swap$ * warning$
780 | % % % eod
781 | % }
782 | % {
783 | % % % debug
784 | % % "charptr = " charptr int.to.str$ *
785 | % % ", lastnamecapitalized = " *
786 | % % lastnamecapitalized int.to.str$ * warning$
787 | % % % eod
788 | % lastnamecapitalized #1 =
789 | % { thename charptr namelength charptr - #1 + substring$ *
790 | % namelength #1 + 'charptr :=
791 | % % % debug
792 | % % duplicate$ "top of the stack = " swap$ * warning$
793 | % % % eod
794 | % }
795 | % { thename charptr #1 substring$
796 | % % % debug
797 | % % duplicate$ "the char = " swap$ * warning$
798 | % % % eod
799 | % duplicate$ is.lower.char
800 | % % % debug
801 | % % duplicate$ int.to.str$ "is.lower.char = " swap$ * warning$
802 | % % % eod
803 | % { "u" change.case$ * }
804 | % { duplicate$ is.space
805 | % % % debug
806 | % % duplicate$ int.to.str$ "is.space = " swap$ * warning$
807 | % % % eod
808 | % { #1 'lastnamecapitalized :=
809 | % *
810 | % }
811 | % { *
812 | % }
813 | % if$
814 | % }
815 | % if$
816 | % % % debug
817 | % % duplicate$ "top of the stack = " swap$ * warning$
818 | % % % eod
819 | % charptr #1 + 'charptr :=
820 | % }
821 | % if$
822 | % }
823 | % while$
824 | % }
825 | % 格式化盲审姓名
826 | FUNCTION {format.names.for.peer.review} {
827 | 's := % s := author域
828 | #1 'nameptr := % nameptr 是姓名指针,初始化为 1
829 | s num.names$ 'numnames := % 利用 num.names$ 获得 s 中的作者数量存入 nameptr
830 | numnames 'namesleft := % 未处理的姓名数 namesleft := numnames
831 | % 循环处理所有姓名
832 | { namesleft #0 > } % if namesleft > #0 (还有姓名没有格式化)
833 | { s nameptr % 选择第 nameptr 个姓名
834 | name.format.string % 按 name.format.string 的格式排版
835 | format.name$ % 调用 format.name$
836 | remove.period % 并删除缩写符号'.'
837 | 't := % 格式化后的姓名暂存于 t
838 | language empty$
839 | { author.name.in.english } % 如果是英文文献将 author.name.in.english 压栈
840 | { author.name.in.chinese } % 否则将 author.name.in.chinese 压栈
841 | if$
842 | t = % 用当前的姓名与栈上的姓名做比较
843 | { nameptr int.to.str$ % 将作者序号转化为字符串
844 | "\CJKnumber{" swap$ * "}" * % 使用中文数字
845 | bbl.number swap$ * bbl.author * % 加上``第''和``作者''
846 | % duplicate$ debug.output
847 | }
848 | { skip$ }
849 | if$
850 | nameptr #1 + 'nameptr := % 姓名指针加 1
851 | namesleft #1 - 'namesleft := % 剩余姓名数减 1
852 | }
853 | while$
854 | }
855 | % 格式化非盲审姓名
856 | FUNCTION {format.names.for.non.peer.review} {
857 | % 初始化
858 | 's := % s := author域
859 | #1 'nameptr := % nameptr 是姓名指针,初始化为 1
860 | s num.names$ 'numnames := % 利用 num.names$ 获得 s 中的作者数量存入 nameptr
861 | numnames 'namesleft := % 未处理的姓名数 namesleft := numnames
862 | % 循环处理所有姓名
863 | { namesleft #0 > } % if namesleft > #0 (还有姓名没有格式化)
864 | { s nameptr % 选择第 nameptr 个姓名
865 | name.format.string % 按 name.format.string 的格式排版
866 | format.name$ % 调用 format.name$
867 | % language empty$
868 | % { "u" change.case$ } % 如果不是语言为空, 做大写转换
869 | % { skip$ }
870 | % if$ %
871 | remove.period % 并删除缩写符号'.'
872 | 't := % 格式化后的姓名暂存于 t
873 | nameptr #1 >
874 | { nameptr max.num.names.before.forced.et.al #1 + =
875 | { "others" 't := % 如果当前作者的序数已经超出了最大列显作者数
876 | #1 'namesleft := } % 则置未处理姓名数为#1, 以便跳出循环
877 | { skip$ } % 如果作者序数在允许范围内, 则跳过
878 | if$ %
879 | bbl.comma * % 添加逗号
880 | namesleft #1 > % 若当前姓名不是最后一个
881 | { t * } % 显示当前姓名
882 | { t "others" = % 若当前姓名是最后一个且后面有略去的姓名
883 | { bbl.etal * } % 添加", et~al"或",等"
884 | { t * } % 如果没有略去姓名,以句点结束
885 | if$ %
886 | }
887 | if$ %
888 | }
889 | { t } % 如果是第一个作者, 直接将排版后的姓名压栈
890 | if$
891 | nameptr #1 + 'nameptr := % 姓名指针加 1
892 | namesleft #1 - 'namesleft := % 剩余姓名数减 1
893 | }
894 | while$
895 | }
896 | % 格式化姓名
897 | FUNCTION {format.names} {
898 | is.for.peer.review
899 | { format.names.for.peer.review } % 格式化盲审姓名
900 | { format.names.for.non.peer.review } % 格式化非盲审姓名
901 | if$
902 | }
903 | FUNCTION {format.authors}
904 | { author empty$
905 | { bbl.anonymous
906 | "The author in " cite$ * " is missing." * warning$ }
907 | { author format.names }
908 | if$
909 | }
910 |
911 | FUNCTION {format.editors}
912 | { editor empty$
913 | { bbl.anonymous
914 | "The editor in " cite$ * " is missing." * warning$
915 | }
916 | { editor format.names }
917 | if$
918 | }
919 |
920 | FUNCTION {format.assignees} {
921 | assignee empty$
922 | { "" }
923 | { assignee format.names }
924 | if$
925 | }
926 |
927 | % 译者格式
928 | FUNCTION {format.translators}
929 | { translator empty$
930 | { "" } % 无译者
931 | { new.block % 有译者
932 | translator format.names ",译" *
933 | }
934 | if$
935 | }
936 |
937 | % 机构格式
938 | FUNCTION {format.institution} {
939 | institution empty$
940 | { "" }
941 | { institution }
942 | if$
943 | }
944 |
945 | % 组织格式
946 | FUNCTION {format.organization} {
947 | organization empty$
948 | { "" }
949 | { organization }
950 | if$
951 | }
952 |
953 | % 文献类型标志代码/电子文献载体标志代码
954 | FUNCTION {bib.type.designator} {
955 | % % DEBUG
956 | % "bib.type.designator(type:" type$ * debug.output
957 | % " url: " url empty$ { "" }{ url } if$ * debug.output
958 | % % END OF DEBUG
959 |
960 | % 文献类型标志代码
961 | type$ "book" = type$ "inbook" = or
962 | { "M" }
963 | { type$ "standard" =
964 | { "S" }
965 | { type$ "proceedings" = type$ "conference" = or type$ "inproceedings" = or
966 | { "C" }
967 | { type$ "patent" =
968 | { "P" }
969 | { type$ "phdthesis" = type$ "mastersthesis" = or
970 | { "D" }
971 | { type$ "techreport" =
972 | { "R" }
973 | { type$ "article" = type$ "periodical" = or
974 | { "J" }
975 | { type$ "online" = type$ "webpage" = or type$ "www" = or
976 | { "EB" }
977 | { type$ "electronic" =
978 | { esubtype empty$
979 | { url empty$
980 | { "" }
981 | { "EB" }
982 | if$
983 | }
984 | { esubtype "webpage" =
985 | { "EB" }
986 | { esubtype "database" =
987 | { "DB" }
988 | { esubtype "program" =
989 | { "CP" }
990 | { "" }
991 | if$ % electronics[program]
992 | }
993 | if$ % electronics[database]
994 | }
995 | if$ % electronics[webpage]
996 | }
997 | if$
998 | }
999 | { "" } % 其他
1000 | if$ % electronics
1001 | }
1002 | if$ % online/webpage/www
1003 | }
1004 | if$ % article/periodical
1005 | }
1006 | if$ % techreport
1007 | }
1008 | if$ % phdthesis/mastersthesis
1009 | }
1010 | if$ % patent
1011 | }
1012 | if$ % proceedings/inproceedings/conference
1013 | }
1014 | if$ % standard
1015 | }
1016 | if$ % book/inbook
1017 | % % DEBUG
1018 | % duplicate$ " doc.designator: " swap$ * debug.output
1019 | % % END OF DEBUG
1020 | % 电子文献载体标志代码
1021 | duplicate$ "" =
1022 | { skip$ }
1023 | { "~[" swap$ *
1024 | howpublished empty$
1025 | { url empty$
1026 | { "" }
1027 | { "/OL" }
1028 | if$
1029 | }
1030 | { howpublished "online" =
1031 | { "/OL" }
1032 | { howpublished "magtype" =
1033 | { "MT" }
1034 | { howpublished "disk" =
1035 | { "DK" }
1036 | { howpublished "cdrom" =
1037 | { "CD" }
1038 | { "" }
1039 | if$ % cdrom
1040 | }
1041 | if$ % disk
1042 | }
1043 | if$ % magitude type
1044 | }
1045 | if$ % online
1046 | }
1047 | if$
1048 | * "]" *
1049 | }
1050 | if$
1051 | }
1052 |
1053 | FUNCTION {format.title}
1054 | { title empty$
1055 | { "" }
1056 | { new.block
1057 | title }
1058 | if$
1059 | }
1060 |
1061 | % 格式化年月日``YYYY-MM-DD''
1062 | FUNCTION {format.year.month.day} {
1063 | year empty$
1064 | { "YYYY" }
1065 | { year }
1066 | if$
1067 | "-" *
1068 | month empty$
1069 | { "MM" * }
1070 | { month text.length$ #2 <
1071 | { "0" * }
1072 | { skip$ }
1073 | if$
1074 | month *
1075 | }
1076 | if$
1077 | "-" *
1078 | day empty$
1079 | { "DD" * }
1080 | { day text.length$ #2 <
1081 | { "0" * }
1082 | 'skip$
1083 | if$
1084 | day *
1085 | }
1086 | if$
1087 | }
1088 |
1089 | FUNCTION {format.reference.date} {
1090 | refdate empty$
1091 | { ""
1092 | url empty$
1093 | { skip$ }
1094 | { "The refdate in " cite$ * " is missing." * warning$ }
1095 | if$
1096 | }
1097 | { output.state mid.sentence =
1098 | { before.all 'output.state := }
1099 | { skip$ }
1100 | if$
1101 | "~[" refdate * "]" * }
1102 | if$
1103 | }
1104 |
1105 | % patent的题名项: 专利题名: 专利国别, 专利号~[文献类型标志]
1106 | FUNCTION {format.patent.title} {
1107 | title empty$ % 专利提名
1108 | { "" }
1109 | { new.block
1110 | title bbl.colon *
1111 | nationality empty$ % 专利国别, 专利号
1112 | { % 专利国别为必备项
1113 | "The nationality in " cite$ * " is missing." * warning$
1114 | }
1115 | { number empty$
1116 | { % 专利号为必选项
1117 | "The number in " cite$ * " is missing." * warning$
1118 | }
1119 | { % 产生``专利国别, 专利号''
1120 | nationality * bbl.comma * number *
1121 | }
1122 | if$
1123 | }
1124 | if$
1125 | % 文献类型标志
1126 | bib.type.designator *
1127 | }
1128 | if$
1129 | }
1130 |
1131 | % patent的出版项:
1132 | FUNCTION {format.patent.publication} {
1133 | new.block
1134 | format.year.month.day
1135 | % % DEBUG
1136 | % duplicate$ "End of format.patent.publication, top = " swap$ * debug.output
1137 | % % END OF DEBUG
1138 | url empty$
1139 | { skip$ }
1140 | { refdate empty$
1141 | { "The refdate in " cite$ * " is missing." * warning$ }
1142 | { "~[" * refdate * "]" * }
1143 | if$
1144 | }
1145 | if$
1146 | }
1147 |
1148 | % electronic的主要责任者:
1149 | % author 或 organization
1150 | FUNCTION {format.electronic.authors}
1151 | {
1152 | author empty$
1153 | { organization empty$
1154 | { " " }
1155 | { organization }
1156 | if$
1157 | }
1158 | { format.authors }
1159 | if$
1160 | }
1161 |
1162 | % electronic的出版项
1163 | FUNCTION {format.electronic.publication} {
1164 | new.block
1165 | % 出版地: 出版者
1166 | address empty$
1167 | { "" }
1168 | { address
1169 | publisher empty$
1170 | { skip$ }
1171 | { bbl.colon * publisher * }
1172 | if$
1173 | }
1174 | if$
1175 |
1176 | % 出版年
1177 | year empty$
1178 | { skip$ }
1179 | { publisher empty$
1180 | { "" }
1181 | { bbl.comma }
1182 | if$
1183 | * year * }
1184 | if$
1185 | }
1186 |
1187 | %% article的标题格式
1188 | FUNCTION {format.atitle}
1189 | { title empty$
1190 | { "" }
1191 | { title
1192 | newsletter empty$
1193 | { "~[J" * }
1194 | { newsletter "yes" =
1195 | { "~[N" * }
1196 | { "~[J" * }
1197 | if$
1198 | }
1199 | if$
1200 | url empty$
1201 | { "]" * }
1202 | { "/OL]" * }
1203 | if$
1204 | }
1205 | if$
1206 | }
1207 | %% incollection的标题格式
1208 | FUNCTION {format.ictitle}
1209 | { title empty$
1210 | { "" }
1211 | { title "~[M]~//~" *
1212 | editor format.names *
1213 | }
1214 | if$
1215 | }
1216 | %% inproceedings的标题格式
1217 | FUNCTION {format.iptitle}
1218 | { title empty$
1219 | { "" }
1220 | { title "~[C]~//~" *
1221 | editor format.names *
1222 | }
1223 | if$
1224 | }
1225 |
1226 | FUNCTION {n.dashify}
1227 | { 't :=
1228 | ""
1229 | { t empty$ not }
1230 | { t #1 #1 substring$ "-" =
1231 | { t #1 #2 substring$ "--" = not
1232 | { "--" *
1233 | t #2 global.max$ substring$ 't :=
1234 | }
1235 | { { t #1 #1 substring$ "-" = }
1236 | { "-" *
1237 | t #2 global.max$ substring$ 't :=
1238 | }
1239 | while$
1240 | }
1241 | if$
1242 | }
1243 | { t #1 #1 substring$ *
1244 | t #2 global.max$ substring$ 't :=
1245 | }
1246 | if$
1247 | }
1248 | while$
1249 | }
1250 |
1251 | % 年,卷(期)
1252 | FUNCTION {format.year.volume.number} {
1253 | year empty$
1254 | { "" }
1255 | { type$ "periodical" =
1256 | { new.block }
1257 | { mid.sentence 'output.state := }
1258 | if$
1259 | year
1260 | volume empty$
1261 | 'skip$
1262 | { bbl.comma * volume * }
1263 | if$
1264 | number empty$
1265 | 'skip$
1266 | { "~(" * number * ")" * }
1267 | if$
1268 | year2 empty$
1269 | { skip$ }
1270 | { "~--" *
1271 | year2 "now" =
1272 | { skip$ }
1273 | { year2 *
1274 | volume2 empty$
1275 | { skip$ }
1276 | { bbl.comma * volume2 * }
1277 | if$
1278 | number2 empty$
1279 | 'skip$
1280 | { "~(" * number2 * ")" * }
1281 | if$
1282 | }
1283 | if$
1284 | }
1285 | if$
1286 | }
1287 | if$
1288 | % %% DEBUG
1289 | % duplicate$ "format.year.volume.number=" swap$ * debug.output
1290 | % %% END OF DEBUG
1291 | }
1292 |
1293 | %
1294 | FUNCTION {format.date}
1295 | { year empty$
1296 | { month empty$
1297 | { "" }
1298 | { "there's a month but no year in " cite$ * warning$
1299 | month
1300 | }
1301 | if$
1302 | }
1303 | { month empty$
1304 | { year }
1305 | { month bbl.comma * year * }
1306 | if$
1307 | }
1308 | if$
1309 | }
1310 | function {format.year.year}
1311 | { year empty$
1312 | 'skip$
1313 | { year "--" *
1314 | year2 empty$
1315 | 'skip$
1316 | { year2 "now" =
1317 | 'skip$
1318 | { year2 * }
1319 | if$
1320 | }
1321 | if$
1322 | }
1323 | if$
1324 | }
1325 |
1326 | % 专著标题格式
1327 | FUNCTION {format.book.title} {
1328 | new.block % 生成一个新的block
1329 | title
1330 | type$ "proceedings" =
1331 | { address empty$
1332 | { skip$ }
1333 | { bbl.comma * address * bbl.comma *
1334 | month empty$
1335 | { skip$ }
1336 | { month * }
1337 | if$
1338 | year empty$
1339 | { skip$ }
1340 | { year * }
1341 | if$
1342 | }
1343 | if$
1344 | }
1345 | { skip$ }
1346 | if$
1347 | bib.type.designator * % 标题 + [文献标志代码/电子文献载体标志代码]
1348 | }
1349 |
1350 | % 科技报告标题格式
1351 | FUNCTION {format.techreport.title} {
1352 | title empty$
1353 | { "" }
1354 | { new.block % 生成一个新的block
1355 | title % 标题 +
1356 | number empty$ % 编号 +
1357 | { "" }
1358 | { bbl.comma * number }
1359 | if$ *
1360 | bib.type.designator * % [文献标志代码/电子文献载体标志代码]
1361 | }
1362 | if$
1363 | }
1364 |
1365 | % 连续出版物标题格式
1366 | FUNCTION {format.jtitle}
1367 | { title "~[J" *
1368 | url empty$
1369 | { "]" * }
1370 | { "/OL]" * }
1371 | if$
1372 | }
1373 |
1374 | % 论文集标题格式
1375 | FUNCTION {format.ptitle.volume}
1376 | { title
1377 | volume empty$
1378 | { "~[C]" }
1379 | { bbl.colon volume * "~[C]" * }
1380 | if$ *
1381 | %emphasize
1382 | }
1383 | FUNCTION {tie.or.space.connect}
1384 | { duplicate$ text.length$ #3 <
1385 | { "~" }
1386 | { " " }
1387 | if$
1388 | swap$ * *
1389 | }
1390 |
1391 | FUNCTION {either.or.check}
1392 | { empty$
1393 | 'pop$
1394 | { "can't use both " swap$ * " fields in " * cite$ * warning$ }
1395 | if$
1396 | }
1397 |
1398 | FUNCTION {format.bvolume}
1399 | { volume empty$
1400 | { "" }
1401 | { language empty$
1402 | { "volume" volume tie.or.space.connect }
1403 | { volume }
1404 | if$
1405 | series empty$
1406 | 'skip$
1407 | { " of " * series emphasize * }
1408 | if$
1409 | "volume and number" number either.or.check
1410 | }
1411 | if$
1412 | }
1413 |
1414 | FUNCTION {format.number.series}
1415 | { volume empty$
1416 | { number empty$
1417 | { series field.or.null }
1418 | { output.state mid.sentence =
1419 | { "number" }
1420 | { "Number" }
1421 | if$
1422 | number tie.or.space.connect
1423 | series empty$
1424 | { "there's a number but no series in " cite$ * warning$ }
1425 | { " in " * series * }
1426 | if$
1427 | }
1428 | if$
1429 | }
1430 | { "" }
1431 | if$
1432 | }
1433 |
1434 | % 版本项格式
1435 | FUNCTION {format.edition} {
1436 | edition empty$
1437 | { "" }
1438 | { new.block % 版本项按一个block输出
1439 | language empty$ % 英文文献版本号自动转换成数字形式的序数词
1440 | { edition convert.edition
1441 | "l" change.case$ " ed" *
1442 | }
1443 | { edition } % 中文文献版本号直接输出
1444 | if$
1445 | }
1446 | if$
1447 | }
1448 |
1449 |
1450 | FUNCTION {format.url}
1451 | { url empty$
1452 | { "" }
1453 | { new.block
1454 | "\url{" url * "}" *
1455 | }
1456 | if$
1457 | }
1458 |
1459 | FUNCTION {multi.page.check}
1460 | { 't :=
1461 | #0 'multiresult :=
1462 | { multiresult not
1463 | t empty$ not
1464 | and
1465 | }
1466 | { t #1 #1 substring$
1467 | duplicate$ "-" =
1468 | swap$ duplicate$ "," =
1469 | swap$ "+" =
1470 | or or
1471 | { #1 'multiresult := }
1472 | { t #2 global.max$ substring$ 't := }
1473 | if$
1474 | }
1475 | while$
1476 | multiresult
1477 | }
1478 |
1479 | FUNCTION {format.pages}
1480 | { pages empty$
1481 | { "" }
1482 | { before.pages 'output.state :=
1483 | pages multi.page.check
1484 | { "" pages n.dashify tie.or.space.connect }
1485 | { "" pages tie.or.space.connect }
1486 | if$
1487 | }
1488 | if$
1489 | }
1490 |
1491 | FUNCTION {format.vol.num.pages}
1492 | { volume field.or.null
1493 | number empty$
1494 | 'skip$
1495 | { "(" number * ")" * *
1496 | volume empty$
1497 | { newsletter empty$
1498 | { "there's a number but no volume in " cite$ * warning$ }
1499 | 'skip$
1500 | if$
1501 | }
1502 | 'skip$
1503 | if$
1504 | }
1505 | if$
1506 | pages empty$
1507 | 'skip$
1508 | { duplicate$ empty$
1509 | { pop$ format.pages }
1510 | { bbl.colon * pages n.dashify * }
1511 | if$
1512 | }
1513 | if$
1514 | % duplicate$ "top of stack = " swap$ * warning$
1515 | url empty$
1516 | 'skip$
1517 | { refdate empty$
1518 | { "there's an url but no refdate in " cite$ * warning$ }
1519 | { %duplicate$ "url and refdate is not empty, top of stack = " swap$ * warning$
1520 | "~[" * refdate * "]" *
1521 | }
1522 | if$
1523 | %duplicate$ "top of stack = " swap$ * warning$
1524 | }
1525 | if$
1526 | }
1527 |
1528 | FUNCTION {format.chapter.pages}
1529 | { chapter empty$
1530 | { "" }
1531 | { type empty$
1532 | { "chapter" }
1533 | { type "l" change.case$ }
1534 | if$
1535 | chapter tie.or.space.connect
1536 | pages empty$
1537 | 'skip$
1538 | { ", " * format.pages * }
1539 | if$
1540 | }
1541 | if$
1542 | }
1543 |
1544 | FUNCTION {format.in.booktitle}
1545 | { booktitle empty$
1546 | { "" }
1547 | { editor empty$
1548 | { language empty$
1549 | { " " booktitle * }
1550 | % { "Proceedings of " booktitle * }
1551 | { " " booktitle * }
1552 | if$
1553 | }
1554 | { language empty$
1555 | % { "In: " format.editors * ", Proceedings of " * booktitle * }
1556 | { " " booktitle * }
1557 | { " " booktitle * }
1558 | if$
1559 | }
1560 | if$
1561 | }
1562 | if$
1563 | }
1564 |
1565 | FUNCTION {format.in.ed.booktitle.volume}
1566 | { booktitle empty$
1567 | { "" }
1568 | { editor empty$
1569 | { language empty$
1570 | % { "Proceedings of " booktitle * }
1571 | { " " booktitle * }
1572 | { " " booktitle * }
1573 | if$
1574 | }
1575 | { language empty$
1576 | %{ "In: " format.editors * ", Proceedings of " * booktitle * }
1577 | { " " booktitle * }
1578 | { " " booktitle * }
1579 | if$
1580 | }
1581 | if$
1582 | %% volume
1583 | volume empty$
1584 | 'skip$
1585 | { language empty$
1586 | { "Vol." * volume * }
1587 | { ":第" * volume * "卷" * }
1588 | if$
1589 | }
1590 | if$
1591 | }
1592 | if$
1593 | }
1594 |
1595 | FUNCTION {empty.misc.check}
1596 | { author empty$ title empty$ howpublished empty$
1597 | month empty$ year empty$ note empty$
1598 | and and and and and
1599 | { "all relevant fields are empty in " cite$ * warning$ }
1600 | 'skip$
1601 | if$
1602 | }
1603 |
1604 | FUNCTION {format.thesis.type}
1605 | { type empty$
1606 | 'skip$
1607 | { pop$
1608 | type "t" change.case$
1609 | }
1610 | if$
1611 | }
1612 |
1613 | FUNCTION {format.tr.number}
1614 | { type empty$
1615 | { "Technical Report" }
1616 | 'type
1617 | if$
1618 | number empty$
1619 | { "t" change.case$ }
1620 | { number tie.or.space.connect }
1621 | if$
1622 | }
1623 |
1624 | FUNCTION {format.article.crossref}
1625 | { key empty$
1626 | { journal empty$
1627 | { "need key or journal for " cite$ * " to crossref " * crossref *
1628 | warning$
1629 | ""
1630 | }
1631 | { "In {\em " journal * "\/}" * }
1632 | if$
1633 | }
1634 | { "In " key * }
1635 | if$
1636 | " \cite{" * crossref * "}" *
1637 | }
1638 |
1639 | FUNCTION {format.crossref.editor}
1640 | { editor #1 "{ll }{f{~}}" format.name$
1641 | editor num.names$ duplicate$
1642 | #2 >
1643 | { pop$ " et~al." * }
1644 | { #2 <
1645 | 'skip$
1646 | { editor #2 "{ll }{f{~}}" format.name$ "others" =
1647 | { " et~al." * }
1648 | { " and " * editor #2 "{ll }{f{~}}" format.name$ * }
1649 | if$
1650 | }
1651 | if$
1652 | }
1653 | if$
1654 | }
1655 |
1656 | FUNCTION {format.book.crossref}
1657 | { volume empty$
1658 | { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
1659 | "In "
1660 | }
1661 | { "Volume" volume tie.or.space.connect
1662 | " of " *
1663 | }
1664 | if$
1665 | editor empty$
1666 | editor field.or.null author field.or.null =
1667 | or
1668 | { key empty$
1669 | { series empty$
1670 | { "need editor, key, or series for " cite$ * " to crossref " *
1671 | crossref * warning$
1672 | "" *
1673 | }
1674 | { "{\em " * series * "\/}" * }
1675 | if$
1676 | }
1677 | { key * }
1678 | if$
1679 | }
1680 | { format.crossref.editor * }
1681 | if$
1682 | " \cite{" * crossref * "}" *
1683 | }
1684 |
1685 | FUNCTION {format.incoll.inproc.crossref}
1686 | { editor empty$
1687 | editor field.or.null author field.or.null =
1688 | or
1689 | { key empty$
1690 | { booktitle empty$
1691 | { "need editor, key, or booktitle for " cite$ * " to crossref " *
1692 | crossref * warning$
1693 | ""
1694 | }
1695 | { "In {\em " booktitle * "\/}" * }
1696 | if$
1697 | }
1698 | { "In " key * }
1699 | if$
1700 | }
1701 | { "In " format.crossref.editor * }
1702 | if$
1703 | " \cite{" * crossref * "}" *
1704 | }
1705 |
1706 | % 出版地: 出版者
1707 | FUNCTION {format.address.publisher} {
1708 | new.block
1709 | type$ "inproceedings" =
1710 | { pubaddress empty$
1711 | { "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
1712 | publisher empty$
1713 | { "there's neither pubaddress nor publisher in " cite$ * warning$
1714 | "[" * bbl.sine.nomine * "]" * % 无出版者
1715 | }
1716 | { "there's a publisher but no pubaddress in " cite$ * warning$
1717 | publisher * % 有出版者
1718 | }
1719 | if$
1720 | }
1721 | { pubaddress bbl.colon * % 有出版地
1722 | publisher empty$
1723 | { "there's a pubaddress but no publisher in " cite$ * warning$
1724 | "[" * bbl.sine.nomine * "]" * % 无出版者
1725 | }
1726 | { publisher * } % 有出版者
1727 | if$
1728 | }
1729 | if$
1730 | }
1731 | { address empty$
1732 | { "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
1733 | publisher empty$
1734 | { "there's neither address nor publisher in " cite$ * warning$
1735 | "[" * bbl.sine.nomine * "]" * % 无出版者
1736 | }
1737 | { "there's a publisher but no address in " cite$ * warning$
1738 | publisher * % 有出版者
1739 | }
1740 | if$
1741 | }
1742 | { address bbl.colon * % 有出版地
1743 | publisher empty$
1744 | { "there's a address but no publisher in " cite$ * warning$
1745 | "[" * bbl.sine.nomine * "]" * % 无出版者
1746 | }
1747 | { publisher * } % 有出版者
1748 | if$
1749 | }
1750 | if$
1751 | }
1752 | if$
1753 | }
1754 |
1755 | % 出版地: 出版者, 出版年
1756 | FUNCTION {format.address.publisher.year} {
1757 | % % DEBUG
1758 | % "-- format.address.publisher.year(){" debug.output
1759 | % "-- address =" address * debug.output
1760 | % "-- publisher=" publisher * debug.output
1761 | % "-- year =" year * debug.output
1762 | % % END OF DEBUG
1763 | new.block
1764 | type$ "inproceedings" =
1765 | { pubaddress empty$
1766 | { "" % "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
1767 | publisher empty$
1768 | { "there's neither pubaddress nor publisher in " cite$ * warning$
1769 | "" * % "[" * bbl.sine.nomine * "]" * % 无出版者
1770 | }
1771 | { "there's a publisher but no pubaddress in " cite$ * warning$
1772 | publisher * % 有出版者
1773 | }
1774 | if$
1775 | }
1776 | { publisher empty$
1777 | { "there's a pubaddress but no publisher in " cite$ * warning$
1778 | "" % "[" * bbl.sine.nomine * "]" * % 无出版者
1779 | }
1780 | { pubaddress bbl.colon * % 有出版地
1781 | publisher * } % 有出版者
1782 | if$
1783 | }
1784 | if$
1785 | }
1786 | { address empty$
1787 | { "" % "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
1788 | publisher empty$
1789 | { "there's neither address nor publisher in " cite$ * warning$
1790 | "" * % "[" * bbl.sine.nomine * "]" * % 无出版者
1791 | }
1792 | { "there's a publisher but no address in " cite$ * warning$
1793 | publisher * % 有出版者
1794 | }
1795 | if$
1796 | }
1797 | { publisher empty$
1798 | { "there's a address but no publisher in " cite$ * warning$
1799 | "" % "[" * bbl.sine.nomine * "]" * % 无出版者
1800 | }
1801 | { address bbl.colon * % 有出版地
1802 | publisher * } % 有出版者
1803 | if$
1804 | }
1805 | if$
1806 | }
1807 | if$
1808 |
1809 | % 出版年
1810 | year empty$
1811 | { "there's no year in " cite$ * warning$ }
1812 | { type$ "inproceedings" =
1813 | { bbl.comma * year * }
1814 | { publisher empty$
1815 | { year * }
1816 | { bbl.comma * year * }
1817 | if$
1818 | }
1819 | if$
1820 |
1821 | type$ "periodical" =
1822 | { year2 empty$ % 对连续出版物可以排版 year2
1823 | { skip$ }
1824 | { "--" *
1825 | year2 "l" change.case$ "now" =
1826 | { skip$ }
1827 | { year2 * }
1828 | if$
1829 | }
1830 | if$
1831 | }
1832 | { skip$ }
1833 | if$
1834 | }
1835 | if$
1836 | % % DEBUG
1837 | % duplicate$ "-- }=" swap$ * debug.output
1838 | % % END OF DEBUG
1839 | }
1840 |
1841 | % 出版地: 学校, 出版年
1842 | FUNCTION {format.address.school.year} {
1843 | new.block
1844 | address empty$
1845 | { "[" bbl.sine.loco * "]" * bbl.colon * % 无出版地
1846 | school empty$
1847 | { "there's neither address nor school in " cite$ * warning$
1848 | "[" bbl.sine.nomine * "]" * % 无出版者
1849 | }
1850 | { "there's a school but no address in " cite$ * warning$
1851 | school * % 有出版者
1852 | }
1853 | if$
1854 | }
1855 | { address bbl.colon * % 有出版地
1856 | school empty$
1857 | { "there's a address but no school in " cite$ * warning$
1858 | "[" bbl.sine.nomine * "]" * % 无出版者
1859 | }
1860 | { school * } % 有出版者
1861 | if$
1862 | }
1863 | if$
1864 | % 出版年
1865 | year empty$
1866 | { "there's no year in " cite$ * warning$ }
1867 | { bbl.comma * year * }
1868 | if$
1869 | }
1870 |
1871 |
1872 | % FUNCTION {format.title.type}
1873 | % { title empty$
1874 | % { type empty$
1875 | % { "" }
1876 | % { "there's a type but no title in " cite$ * warning$
1877 | % type
1878 | % }
1879 | % if$
1880 | % }
1881 | % { type empty$
1882 | % 'title
1883 | % { title bbl.colon * type * }
1884 | % if$
1885 | % }
1886 | % if$
1887 | % }
1888 |
1889 | FUNCTION {format.note} {
1890 | note empty$
1891 | { new.block "" }
1892 | { url empty$
1893 | { new.block }
1894 | { before.all 'output.state := }
1895 | if$
1896 | note }
1897 | if$
1898 | }
1899 |
1900 | %%%%%%%%%%%%%%%%%
1901 | %% 著录格式: 专著
1902 | %%%%%%%%%%%%%%%%%
1903 |
1904 | % 普通图书
1905 | FUNCTION {book} {
1906 | start.entry % 开始
1907 |
1908 | author empty$ % 主要责任者
1909 | { format.editors "author and editor" output.warn }
1910 | { format.authors output.nonnull }
1911 | if$
1912 | format.book.title "title" output.warn % 题名项
1913 | format.translators output % 其他责任者(可选)
1914 | format.edition output % 版本项
1915 | format.address.publisher.year output.nonnull %
1916 | format.reference.date output %
1917 | format.url output % 获取或访问路径
1918 | format.note output % 备注
1919 |
1920 | fin.entry
1921 | }
1922 |
1923 | % 标准
1924 | FUNCTION {standard} {
1925 | start.entry
1926 |
1927 | organization empty$ % 主要责任人
1928 | { format.institution "organization and institution" output.warn }
1929 | { format.organization output.nonnull }
1930 | if$
1931 | format.book.title "title" output.warn % 题名项
1932 | format.translators output % 其他责任人
1933 | format.edition output % 版本项
1934 | format.address.publisher.year output.nonnull % 出版项
1935 | format.url output % URL
1936 | format.note output % 备注项
1937 |
1938 | fin.entry
1939 | }
1940 |
1941 | % 学位论文
1942 | FUNCTION {phdthesis} {
1943 | start.entry
1944 |
1945 | format.authors "author" output.warn
1946 | format.book.title "title" output.warn
1947 | format.address.school.year output
1948 | format.note output
1949 |
1950 | fin.entry
1951 | }
1952 |
1953 | % 会议录/论文集
1954 | FUNCTION {proceedings} {
1955 | start.entry
1956 |
1957 | editor empty$
1958 | { organization empty$
1959 | { format.institution "author, organization institution" output.warn }
1960 | { format.organization output.nonnull }
1961 | if$
1962 | }
1963 | { format.editors output.nonnull }
1964 | if$
1965 | format.book.title "title" output.warn
1966 | format.address.publisher.year output
1967 | format.note output
1968 |
1969 | fin.entry
1970 | }
1971 |
1972 | % 科技报告
1973 | FUNCTION {techreport} {
1974 | start.entry
1975 |
1976 | author empty$
1977 | { organization empty$
1978 | { format.institution
1979 | "author, organization and institution" output.warn }
1980 | { format.organization output.nonnull }
1981 | if$
1982 | }
1983 | { format.authors output.nonnull }
1984 | if$
1985 | format.techreport.title "title" output.warn
1986 | format.address.publisher.year output.nonnull
1987 | format.url output
1988 | format.note output
1989 |
1990 | fin.entry
1991 | }
1992 |
1993 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%
1994 | %% 著录格式: 专著中析出的文献
1995 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%
1996 |
1997 | FUNCTION {format.collection.editors} {
1998 | booktitle empty$
1999 | { "" }
2000 | { after.title 'output.state :=
2001 | format.editors }
2002 | if$
2003 | }
2004 | FUNCTION {format.address} {
2005 | booktitle empty$
2006 | { new.block }
2007 | { mid.sentence 'output.state := }
2008 | if$
2009 | address empty$
2010 | { "" }
2011 | { address }
2012 | if$
2013 | }
2014 |
2015 | FUNCTION {format.month.year} {
2016 | month empty$
2017 | { "" }
2018 | { month " " * }
2019 | if$
2020 | year empty$
2021 | { "There is month but no year in " cite$ * warning$ }
2022 | { year * }
2023 | if$
2024 | }
2025 |
2026 | FUNCTION {format.collection.title} {
2027 | booktitle empty$
2028 | { "" }
2029 | { new.block
2030 | "In " booktitle *
2031 | % address empty$
2032 | % { skip$ }
2033 | % { bbl.comma * address * bbl.comma *
2034 | % month empty$
2035 | % { skip$ }
2036 | % { month * }
2037 | % if$
2038 | % year empty$
2039 | % { skip$ }
2040 | % { " " * year * }
2041 | % if$
2042 | % }
2043 | % if$
2044 | }
2045 | if$
2046 | }
2047 | % 图书中析出的文献
2048 | FUNCTION {inbook} {
2049 | start.entry
2050 |
2051 | author empty$
2052 | { format.editors "author and editor" output.warn }
2053 | { format.authors output.nonnull }
2054 | if$
2055 | format.book.title "title" output.warn
2056 | format.collection.editors "editor" output.warn
2057 | format.collection.title "booktitle" output.warn
2058 | format.translators output % 其他责任人
2059 | format.edition output % 版本项
2060 | format.address.publisher.year output.nonnull % 出版项
2061 | format.pages "pages" output.warn %
2062 | format.url output % URL
2063 | format.note output % 备注项
2064 |
2065 | fin.entry
2066 | }
2067 |
2068 | %%%%%%%%%%%%%%%%%
2069 | %% 著录格式: 专利
2070 | %%%%%%%%%%%%%%%%%
2071 | FUNCTION {patent} {
2072 | start.entry
2073 |
2074 | author empty$
2075 | { format.assignees "assignee" output.warn }
2076 | { format.authors output.nonnull }
2077 | if$
2078 | format.patent.title "title" output.warn
2079 | format.patent.publication output
2080 | format.url output
2081 | format.note output
2082 |
2083 | fin.entry
2084 | }
2085 |
2086 | % 电子文献更新或修改日期
2087 | FUNCTION {format.update.date} {
2088 | update empty$
2089 | { "" }
2090 | { output.state mid.sentence =
2091 | { before.all 'output.state := }
2092 | { skip$ }
2093 | if$
2094 | "~(" update * ")" * }
2095 | if$
2096 | }
2097 |
2098 | %%%%%%%%%%%%%%%%%%%%%
2099 | %% 著录格式: 电子文献
2100 | %%%%%%%%%%%%%%%%%%%%%
2101 | FUNCTION {electronic} {
2102 | start.entry
2103 |
2104 | author empty$
2105 | { organization "author and organization" output.warn }
2106 | { format.authors output.nonnull }
2107 | if$
2108 | format.book.title output
2109 | format.electronic.publication output
2110 | format.update.date output
2111 | format.reference.date output
2112 | format.url output
2113 | format.note output
2114 |
2115 | fin.entry
2116 | }
2117 |
2118 | %%%%%%%%%%%%%%%%%%%%%%%
2119 | %% 著录格式: 连续出版物
2120 | %%%%%%%%%%%%%%%%%%%%%%%
2121 | FUNCTION {periodical} {
2122 | start.entry
2123 |
2124 | editor empty$
2125 | { format.organization "editors and organization" output.warn }
2126 | { format.editors output.nonnull }
2127 | if$
2128 | format.book.title "title" output.warn
2129 | format.year.volume.number output
2130 | format.address.publisher.year output
2131 | format.url output
2132 | format.note output
2133 |
2134 | fin.entry
2135 | }
2136 |
2137 | FUNCTION {format.journal.title} {
2138 | journal empty$
2139 | { "" }
2140 | { new.block journal }
2141 | if$
2142 | }
2143 |
2144 | % 连续出版物中析出的文献
2145 | FUNCTION {article}
2146 | { start.entry
2147 |
2148 | format.authors "author" output.warn
2149 | format.book.title "title" output.warn
2150 | format.journal.title "journal" output.warn
2151 | format.year.volume.number output
2152 | format.pages "pages" output.warn
2153 | format.reference.date output
2154 | format.url output
2155 | format.note output
2156 |
2157 | fin.entry
2158 | }
2159 |
2160 | FUNCTION {booklet}
2161 | { start.entry
2162 | format.authors output
2163 | new.block
2164 | format.title "title" output.warn
2165 | howpublished address new.block.checkb
2166 | howpublished output
2167 | address output
2168 | format.date output
2169 | new.block
2170 | note output
2171 | fin.entry
2172 | }
2173 |
2174 | FUNCTION {incollection}
2175 | { start.entry
2176 | format.authors "author" output.warn
2177 | new.block
2178 | format.ictitle "title" output.warn
2179 | new.block
2180 | crossref missing$
2181 | { %format.in.ed.booktitle "booktitle" output.warn
2182 | %format.bvolume output
2183 | format.in.ed.booktitle.volume "booktitle" output.warn
2184 | format.number.series output
2185 | format.chapter.pages output
2186 | new.sentence
2187 | % publisher "publisher" output.warn
2188 | % address output
2189 | format.address.publisher.year output
2190 | format.edition output
2191 | format.date ":" * format.pages * output
2192 | %format.date "year" output.warn
2193 | }
2194 | { format.incoll.inproc.crossref output.nonnull
2195 | format.chapter.pages output
2196 | }
2197 | if$
2198 | new.block
2199 | note output
2200 | fin.entry
2201 | }
2202 |
2203 | % 论文集中析出的文献
2204 | FUNCTION {inproceedings} {
2205 | start.entry
2206 |
2207 | format.authors "author" output.warn
2208 | format.book.title "title" output.warn
2209 | format.collection.editors "editor" output.warn
2210 | format.collection.title "booktitle" output.warn
2211 | format.address output
2212 | format.month.year output
2213 | % format.address.publisher.year output.nonnull % 出版项
2214 | format.pages "pages" output.warn %
2215 | format.url output % URL
2216 | format.note output % 备注项
2217 | % format.in.booktitle "booktitle" output.warn
2218 | % %format.bvolume output
2219 | % %format.number.series output
2220 | % %format.pages output
2221 | % address empty$
2222 | % { organization publisher new.sentence.checkb
2223 | % organization output
2224 | % publisher output
2225 | % %format.date "year" output.warn
2226 | % %year output
2227 | % format.date ":" * format.pages * output
2228 | % }
2229 | % { %address output.nonnull
2230 | % format.address.publisher.year output
2231 | % %format.date "year" output.warn
2232 | % % year output
2233 | % format.date ":" * format.pages * output
2234 | % new.sentence
2235 | % organization output
2236 | % %publisher output
2237 | % }
2238 | % if$
2239 | % new.block
2240 | % pages output
2241 | %remove.dots
2242 |
2243 | % { format.incoll.inproc.crossref output.nonnull
2244 | % format.pages output
2245 | % }
2246 | % if$
2247 | % new.block
2248 | % note output
2249 | fin.entry
2250 | }
2251 |
2252 | FUNCTION {manual}
2253 | { start.entry
2254 | author empty$
2255 | { organization empty$
2256 | 'skip$
2257 | { organization output.nonnull
2258 | address output
2259 | }
2260 | if$
2261 | }
2262 | { format.authors output.nonnull }
2263 | if$
2264 | new.block
2265 | format.book.title "title" output.warn
2266 | author empty$
2267 | { organization empty$
2268 | { address new.block.checka
2269 | address output
2270 | }
2271 | 'skip$
2272 | if$
2273 | }
2274 | { organization address new.block.checkb
2275 | organization output
2276 | address output
2277 | }
2278 | if$
2279 | format.edition output
2280 | format.date output
2281 | new.block
2282 | note output
2283 | fin.entry
2284 | }
2285 |
2286 | % FUNCTION {masterthesis.type}
2287 | % { "~[D]"
2288 | % % language empty$
2289 | % % { "[Master Thesis]" }
2290 | % % { "[硕士学位论文]" }
2291 | % % if$
2292 | % }
2293 |
2294 | % FUNCTION {mastersthesis}
2295 | % { start.entry
2296 | % format.authors "author" add.period$ output.warn
2297 | % new.block
2298 | % format.title remove.dots " " * masterthesis.type * output
2299 | % new.block
2300 | % format.address.school output
2301 | % %address output
2302 | % %school "school" output.warn
2303 | % format.date "year" output.warn
2304 | % new.block
2305 | % note output
2306 | % fin.entry
2307 | % }
2308 |
2309 | FUNCTION {misc}
2310 | { start.entry
2311 |
2312 | format.authors output
2313 | % title howpublished new.block.checkb
2314 | format.title output
2315 | % howpublished new.block.checka
2316 | % howpublished output
2317 | % format.date output
2318 | format.address output
2319 | format.month.year output
2320 | format.pages "pages" output.warn
2321 | format.url output
2322 | % new.block
2323 | format.note output
2324 | fin.entry
2325 | % empty.misc.check
2326 | }
2327 |
2328 | FUNCTION {phdthesis.type}
2329 | { "~[D]"
2330 | % language empty$
2331 | % { "[PhD Thesis]" }
2332 | % { "[博士学位论文]" }
2333 | % if$
2334 | }
2335 |
2336 |
2337 |
2338 |
2339 | FUNCTION {unpublished}
2340 | { start.entry
2341 | format.authors "author" output.warn
2342 | new.block
2343 | format.title "title" output.warn
2344 | new.block
2345 | note "note" output.warn
2346 | format.date output
2347 | fin.entry
2348 | }
2349 |
2350 | % 专用控制条目 SHUThesisBSTCTL 用于提供方便的用户设置接口
2351 | FUNCTION {SHUThesisBSTCTL}{
2352 | is.print.banners.to.terminal
2353 | { "** SHUThesis BST control entry " quote$ * cite$ *
2354 | quote$ * " detected." *
2355 | top$
2356 | }
2357 | { skip$ }
2358 | if$
2359 | % CTLuse_article_number
2360 | % empty$
2361 | % { skip$ }
2362 | % { CTLuse_article_number
2363 | % yes.no.to.int
2364 | % 'is.use.number.for.article :=
2365 | % }
2366 | % if$
2367 | % CTLuse_paper
2368 | % empty$
2369 | % { skip$ }
2370 | % { CTLuse_paper
2371 | % yes.no.to.int
2372 | % 'is.use.paper :=
2373 | % }
2374 | % if$
2375 | % CTLuse_forced_etal
2376 | % empty$
2377 | % { skip$ }
2378 | % { CTLuse_forced_etal
2379 | % yes.no.to.int
2380 | % 'is.forced.et.al :=
2381 | % }
2382 | % if$
2383 | % 显示作者数目
2384 | CTLmax_names_forced_etal
2385 | empty$
2386 | { skip$ }
2387 | { CTLmax_names_forced_etal
2388 | string.to.integer
2389 | 'max.num.names.before.forced.et.al :=
2390 | }
2391 | if$
2392 | % 论文作者英文姓名
2393 | CTLauthor_name_english
2394 | empty$
2395 | { skip$ }
2396 | { CTLauthor_name_english
2397 | 'author.name.in.english :=
2398 | % #1 'is.for.peer.review :=
2399 | "CTLauthor_name_english=" author.name.in.english * debug.output
2400 | }
2401 | if$
2402 | % 论文作者中文姓名
2403 | CTLauthor_name_chinese
2404 | empty$
2405 | { skip$ }
2406 | { CTLauthor_name_chinese
2407 | 'author.name.in.chinese :=
2408 | % #1 'is.for.peer.review :=
2409 | "CTLauthor_name_chinese=" author.name.in.chinese * debug.output
2410 | }
2411 | if$
2412 | CTLfor_peer_review
2413 | empty$
2414 | { skip$ }
2415 | { CTLfor_peer_review
2416 | yes.no.to.int
2417 | 'is.for.peer.review :=
2418 | }
2419 | if$
2420 | % CTLnames_show_etal
2421 | % empty$
2422 | % { skip$ }
2423 | % { CTLnames_show_etal
2424 | % string.to.integer
2425 | % 'num.names.shown.with.forced.et.al :=
2426 | % }
2427 | % if$
2428 | % CTLuse_alt_spacing
2429 | % empty$
2430 | % { skip$ }
2431 | % { CTLuse_alt_spacing
2432 | % yes.no.to.int
2433 | % 'is.use.alt.interword.spacing :=
2434 | % }
2435 | % if$
2436 | % CTLalt_stretch_factor
2437 | % empty$
2438 | % { skip$ }
2439 | % { CTLalt_stretch_factor
2440 | % 'ALTinterwordstretchfactor :=
2441 | % "\renewcommand{\BIBentryALTinterwordstretchfactor}{"
2442 | % ALTinterwordstretchfactor * "}" *
2443 | % write$ newline$
2444 | % }
2445 | % if$
2446 | % CTLdash_repeated_names
2447 | % empty$
2448 | % { skip$ }
2449 | % { CTLdash_repeated_names
2450 | % yes.no.to.int
2451 | % 'is.dash.repeated.names :=
2452 | % }
2453 | % if$
2454 | % CTLname_emph_author_en % 强调显示的作者英文姓名
2455 | % empty$
2456 | % { skip$ } % 若没有给出则跳过
2457 | % { CTLname_emph_author_en
2458 | % 'name.emph.author.en := % 否则更新 name.emph.author.en
2459 | % }
2460 | % if$
2461 | % CTLname_emph_author_zh % 强调显示的作者中文姓名
2462 | % empty$
2463 | % { skip$ } % 若没有给出则跳过
2464 | % { CTLname_emph_author_zh
2465 | % 'name.emph.author.zh := % 否则更新 name.emph.author.zh
2466 | % }
2467 | % if$
2468 | CTLname_format_string % 英文姓名排版格式字符串
2469 | empty$
2470 | { skip$ } % 若没有自定义则跳过
2471 | { CTLname_format_string % 否则更新 name.format.string
2472 | 'name.format.string :=
2473 | }
2474 | if$
2475 | % CTLname_latex_cmd
2476 | % empty$
2477 | % { skip$ }
2478 | % { CTLname_latex_cmd
2479 | % 'name.latex.cmd :=
2480 | % }
2481 | % if$
2482 | % CTLname_url_prefix
2483 | % missing$
2484 | % { skip$ }
2485 | % { CTLname_url_prefix
2486 | % 'name.url.prefix :=
2487 | % }
2488 | % if$
2489 |
2490 |
2491 | % num.names.shown.with.forced.et.al max.num.names.before.forced.et.al >
2492 | % { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$
2493 | % max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al :=
2494 | % }
2495 | % { skip$ }
2496 | % if$
2497 | }
2498 |
2499 | %%%%%%%%%%%%
2500 | %% 条目别名
2501 | %%%%%%%%%%%%
2502 | FUNCTION {mastersthesis} {phdthesis}
2503 | FUNCTION {conference} {inproceedings}
2504 | FUNCTION {online} {electronic}
2505 | FUNCTION {internet} {electronic}
2506 | FUNCTION {webpage} {electronic}
2507 | FUNCTION {www} {electronic}
2508 | FUNCTION {default.type} {misc}
2509 |
2510 |
2511 | %%%%%%%%%%
2512 | %% 主程序
2513 | %%%%%%%%%%
2514 |
2515 | READ
2516 |
2517 | EXECUTE {initialize.controls} % 初始化控制变量
2518 | EXECUTE {initialize.status.constants} % 初始化状态常量
2519 | EXECUTE {banner.message} % 显示初始提示信息
2520 |
2521 | EXECUTE {initialize.longest.label} % 初始化最长的标号
2522 | ITERATE {longest.label.pass} % 处理最长的标号
2523 |
2524 | EXECUTE {begin.bib} % 开始
2525 | ITERATE {call.type$} %
2526 | EXECUTE {end.bib} % 结束
2527 |
2528 | EXECUTE {completed.message} % 显示完成提示信息
2529 |
2530 | %% EOF
2531 |
--------------------------------------------------------------------------------
/shuthesis.cfg:
--------------------------------------------------------------------------------
1 | %%
2 | %% This is file `shuthesis.cfg',
3 | %% generated with the docstrip utility.
4 | %%
5 | %% The original source files were:
6 | %%
7 | %% shuthesis.dtx (with options: `cfg')
8 | %%
9 | %% This is a generated file.
10 | %%
11 | %% Copyright (C) 2017-2017 by Lele Liu
12 | %%
13 | %% This file may be distributed and/or modified under the
14 | %% conditions of the LaTeX Project Public License, either version 1.3a
15 | %% of this license or (at your option) any later version.
16 | %% The latest version of this license is in:
17 | %%
18 | %% http://www.latex-project.org/lppl.txt
19 | %%
20 | %% and version 1.3a or later is part of all distributions of LaTeX
21 | %% version 2004/10/01 or later.
22 | %%
23 | %% This is the configuration file of the shuthesis package with LaTeX2e.
24 | %%
25 | \ProvidesFile{shuthesis.cfg}
26 | [2017/05/05 v2.0 Shanghai University Thesis Template]
27 | \theoremheaderfont{\normalfont\bfseries}
28 | \theoremstyle{plain}
29 | \theoremsymbol{}
30 | \theoremseparator{}
31 | \newtheorem{assumption}{假设}[chapter]
32 | \newtheorem{proposition}{命题}[chapter]
33 | \newtheorem{lemma}{引理}[chapter]
34 | \newtheorem{theorem}{定理}[chapter]
35 | \newtheorem{axiom}{公理}[chapter]
36 | \newtheorem{corollary}{推论}[chapter]
37 | \newtheorem{exercise}{练习}[chapter]
38 | \newtheorem{example}{例}[chapter]
39 | \newtheorem{problem}{问题}[chapter]
40 | \newtheorem{conjecture}{猜想}[chapter]
41 | \theorembodyfont{\normalfont}
42 | \newtheorem{definition}{定义}[chapter]
43 | \newtheorem{remark}{注释}[chapter]
44 | \theoremsymbol{\ensuremath{\square}}
45 | \newtheorem*{proof}{证明:}
46 | \ctexset{%
47 | chapter/name={第,章},
48 | appendixname=附录,
49 | contentsname={目\hspace{\ccwd}录},
50 | listfigurename={插图索引},
51 | listtablename={表格索引},
52 | figurename={图},
53 | tablename={表},
54 | bibname={参考文献},
55 | indexname={索引},
56 | }
57 | \newcommand\equationname{公式}
58 | \newcommand{\cabstractname}{摘\hspace{\ccwd}要}
59 | \newcommand{\eabstractname}{ABSTRACT}
60 | \let\CJK@todaysave=\today
61 | \def\CJK@todaysmall{\the\year 年 \the\month 月}
62 | \def\CJK@todaybig{\zhdigits{\the\year}年\zhnumber{\the\month}月}
63 | \def\CJK@today{\CJK@todaysmall}
64 | \renewcommand\today{\CJK@today}
65 | \newcommand\CJKtoday[1][1]{%
66 | \ifcase#1\def\CJK@today{\CJK@todaysave}
67 | \or\def\CJK@today{\CJK@todaysmall}
68 | \or\def\CJK@today{\CJK@todaybig}
69 | \fi}
70 | \def\shu@keywords@separator{;}
71 | \def\shu@secretyear{\the\year}
72 | \def\shu@secret@content{%
73 | \unskip~$\bigstar$ %
74 | \shu@secretyear~年}
75 | \def\shu@cdegree{\ifshu@doctor 博士\else 硕士\fi}
76 | \def\shu@edegree{\ifshu@doctor Doctor\else Master\fi}
77 | \cdate{\CJK@todaybig}
78 | \edate{\ifcase \month \or January\or February\or March\or April\or May%
79 | \or June\or July \or August\or September\or October\or November
80 | \or December\fi\unskip,\ \ \the\year}
81 | \newcommand{\shu@ckeywords@title}{关键词:}
82 | \newcommand{\shu@denotation@name}{主要符号对照表}
83 | \newcommand{\shu@publications@title}{作者在攻读\shu@cdegree 学位期间发表的论文与研究成果}
84 | \endinput
85 | %%
86 | %% End of file `shuthesis.cfg'.
87 |
--------------------------------------------------------------------------------
/shuthesis.cls:
--------------------------------------------------------------------------------
1 | %%
2 | %% This is file `shuthesis.cls',
3 | %% generated with the docstrip utility.
4 | %%
5 | %% The original source files were:
6 | %%
7 | %% shuthesis.dtx (with options: `cls')
8 | %%
9 | %% This is a generated file.
10 | %%
11 | %% Copyright (C) 2017-2017 by Lele Liu
12 | %%
13 | %% This file may be distributed and/or modified under the
14 | %% conditions of the LaTeX Project Public License, either version 1.3a
15 | %% of this license or (at your option) any later version.
16 | %% The latest version of this license is in:
17 | %%
18 | %% http://www.latex-project.org/lppl.txt
19 | %%
20 | %% and version 1.3a or later is part of all distributions of LaTeX
21 | %% version 2004/10/01 or later.
22 | %%
23 | %% To produce the documentation run the original source files ending with `.dtx'
24 | %% through LaTeX.
25 | %%
26 | \NeedsTeXFormat{LaTeX2e}[1999/12/01]
27 | \ProvidesClass{shuthesis}
28 | [2017/05/05 v2.0 Shanghai University Thesis Template]
29 | \hyphenation{Shu-Thesis}
30 | \def\shuthesis{\textsc{ShuThesis}}
31 | \def\version{2.0}
32 | \RequirePackage{kvoptions}
33 | \SetupKeyvalOptions{
34 | family=shu,
35 | prefix=shu@,
36 | setkeys=\kvsetkeys}
37 | \newif\ifshu@master
38 | \newif\ifshu@doctor
39 | \define@key{shu}{type}{%
40 | \shu@masterfalse
41 | \shu@doctorfalse
42 | \expandafter\csname shu@#1true\endcsname}
43 | \def\shu@deprecated@type@option{%
44 | \kvsetkeys{shu}{type=\CurrentOption} % for compatability.
45 | \ClassError{shuthesis}{Option '\CurrentOption' is deprecated, \MessageBreak
46 | please use 'type=\CurrentOption' instead}{}}
47 | \DeclareVoidOption{master}{\shu@deprecated@type@option}
48 | \DeclareVoidOption{doctor}{\shu@deprecated@type@option}
49 | \DeclareBoolOption{secret}
50 | \DeclareBoolOption{arialtitle}
51 | \DeclareBoolOption{raggedbottom}
52 | \DeclareBoolOption{pifootnote}
53 | \DeclareBoolOption{nocolor}
54 | \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}}
55 | \kvsetkeys{shu}{raggedbottom,arialtitle}
56 | \ProcessKeyvalOptions*
57 | \LoadClass[a4paper,UTF8,zihao=-4,scheme=plain]{ctexbook}
58 | \PassOptionsToPackage{no-math}{fontspec}
59 | \RequirePackage{ifxetex}
60 | \ifxetex
61 | \setCJKfamilyfont{LanTingHei}{FZLanTing.ttf}
62 | \newcommand{\LanTingHei}{\CJKfamily{LanTingHei}}
63 | \setCJKfamilyfont{XBSong}{FZXBsong.ttf}
64 | \newcommand{\XBSong}{\CJKfamily{XBSong}}
65 | \setCJKfamilyfont{HanYikai}{HanYikaishu.ttf}
66 | \newcommand{\HanYikai}{\CJKfamily{HanYikai}}
67 | \else\fi
68 | \ifshu@master\relax\else
69 | \ifshu@doctor\relax\else
70 | \ClassError{shuthesis}%
71 | {Please specify thesis type in option: \MessageBreak
72 | type=[master|doctor]}{}
73 | \fi
74 | \fi
75 | \RequirePackage{etoolbox}
76 | \RequirePackage{xparse}
77 | \RequirePackage{amsmath}
78 | \RequirePackage{amssymb}
79 | \RequirePackage{amsfonts}
80 | \RequirePackage{mathrsfs}
81 | \RequirePackage{bm}
82 | \RequirePackage{mathtools}
83 | \RequirePackage[defaultsups]{newtxtext}
84 | \RequirePackage{courier}
85 | \RequirePackage{graphicx}
86 | \RequirePackage[labelformat=simple]{subcaption}
87 | \RequirePackage[shortlabels]{enumitem}
88 | \RequirePackage{environ}
89 | \ifshu@raggedbottom
90 | \RequirePackage[bottom,perpage,hang]{footmisc}
91 | \raggedbottom
92 | \else
93 | \RequirePackage[perpage,hang]{footmisc}
94 | \fi
95 | \ifshu@pifootnote
96 | \RequirePackage{pifont}
97 | \fi
98 | \RequirePackage{CJKfntef}
99 | \RequirePackage[amsmath,thmmarks,hyperref]{ntheorem}
100 | \RequirePackage{array}
101 | \RequirePackage{longtable}
102 | \RequirePackage{makecell}
103 | \RequirePackage{tabu}
104 | \RequirePackage{booktabs}
105 | \RequirePackage{ulem}
106 | \RequirePackage[numbers,sort&compress]{natbib}
107 | \patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{} % lof
108 | \patchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{10\p@}}}{}{}{} % lot
109 | \RequirePackage{hyperref}
110 | \ifxetex
111 | \hypersetup{%
112 | CJKbookmarks=true}
113 | \else
114 | \hypersetup{%
115 | unicode=true,
116 | CJKbookmarks=false}
117 | \fi
118 | \hypersetup{%
119 | linktoc=all,
120 | bookmarksnumbered=true,
121 | bookmarksopen=true,
122 | bookmarksopenlevel=2,
123 | breaklinks=true,
124 | colorlinks=true,
125 | plainpages=false}
126 | \ifshu@nocolor
127 | \hypersetup{%
128 | citecolor=black,
129 | linkcolor=black,
130 | urlcolor=black}
131 | \else
132 | \hypersetup{%
133 | citecolor=blue,
134 | linkcolor=blue,
135 | urlcolor=blue}
136 | \fi
137 | \urlstyle{same}
138 | \RequirePackage{geometry}
139 | \geometry{
140 | a4paper,
141 | ignoreall,
142 | nomarginpar}
143 | \geometry{
144 | left=28mm,
145 | right=28mm,
146 | headheight=8mm,
147 | headsep=7mm,
148 | top=30mm,
149 | bottom=26mm,
150 | footskip=7mm}
151 | \RequirePackage{fancyhdr}
152 | \def\theoremautorefname{定理}
153 | \def\lemmaautorefname{引理}
154 | \def\definitionautorefname{定义}
155 | \def\corollaryautorefname{推论}
156 | \def\propositionautorefname{命题}
157 | \let\shu@cleardoublepage\cleardoublepage
158 | \newcommand{\shu@clearemptydoublepage}{%
159 | \clearpage{\pagestyle{shu@empty}\shu@cleardoublepage}}
160 | \let\cleardoublepage\shu@clearemptydoublepage
161 | \renewcommand\frontmatter{%
162 | \if@openright\cleardoublepage\else\clearpage\fi
163 | \@mainmatterfalse
164 | \pagenumbering{Roman}
165 | \pagestyle{shu@empty}}
166 | \renewcommand\mainmatter{%
167 | \if@openright\cleardoublepage\else\clearpage\fi
168 | \@mainmattertrue
169 | \pagenumbering{arabic}
170 | \pagestyle{shu@headings}}
171 | \renewcommand\backmatter{%
172 | \if@openright\cleardoublepage\else\clearpage\fi
173 | \@mainmattertrue}
174 | \renewcommand\normalsize{%
175 | \@setfontsize\normalsize{12bp}{20bp}%
176 | \abovedisplayskip=13bp \@plus 2bp \@minus 2bp
177 | \abovedisplayshortskip=13bp \@plus 2bp \@minus 2bp
178 | \belowdisplayskip=\abovedisplayskip
179 | \belowdisplayshortskip=\abovedisplayshortskip}
180 | \def\shu@def@fontsize#1#2{%
181 | \expandafter\newcommand\csname #1\endcsname[1][1.3]{%
182 | \fontsize{#2}{##1\dimexpr #2}\selectfont}}
183 | \shu@def@fontsize{maxsize}{57bp}
184 | \shu@def@fontsize{chuhao}{42bp}
185 | \shu@def@fontsize{xiaochu}{36bp}
186 | \shu@def@fontsize{yihao}{26bp}
187 | \shu@def@fontsize{xiaoyi}{24bp}
188 | \shu@def@fontsize{erhao}{22bp}
189 | \shu@def@fontsize{xiaoer}{18bp}
190 | \shu@def@fontsize{sanhao}{16bp}
191 | \shu@def@fontsize{xiaosan}{15bp}
192 | \shu@def@fontsize{sihao}{14bp}
193 | \shu@def@fontsize{banxiaosi}{13bp}
194 | \shu@def@fontsize{xiaosi}{12bp}
195 | \shu@def@fontsize{dawu}{11bp}
196 | \shu@def@fontsize{wuhao}{10.5bp}
197 | \shu@def@fontsize{xiaowu}{9bp}
198 | \shu@def@fontsize{liuhao}{7.5bp}
199 | \shu@def@fontsize{xiaoliu}{6.5bp}
200 | \shu@def@fontsize{qihao}{5.5bp}
201 | \shu@def@fontsize{bahao}{5bp}
202 | \fancypagestyle{shu@empty}{%
203 | \fancyhf{}
204 | \renewcommand{\headrulewidth}{0pt}
205 | \renewcommand{\footrulewidth}{0pt}}
206 | \fancypagestyle{shu@plain}{%
207 | \fancyhead{}
208 | \fancyfoot[C]{\xiaowu\thepage}
209 | \renewcommand{\headrulewidth}{0pt}
210 | \renewcommand{\footrulewidth}{0pt}}
211 | \fancypagestyle{shu@headings}{%
212 | \fancyhead{}
213 | \fancyhead[CO]{\wuhao\kaishu\leftmark}
214 | \fancyhead[CE]{\wuhao\kaishu 上海大学\shu@cdegree 学位论文}
215 | \fancyfoot{}
216 | \fancyfoot[C]{\wuhao\thepage}
217 | \renewcommand{\headrulewidth}{0.4pt}
218 | \renewcommand{\footrulewidth}{0pt}}
219 | \ctexset{%
220 | space=auto,
221 | autoindent=true}
222 | \setlist{nosep}
223 | \def\shu@textcircled#1{%
224 | \ifnum\value{#1} >9
225 | \ClassError{shuthesis}%
226 | {Too many footnotes in this page.}{Keep footnote less than 10.}
227 | \fi
228 | \ifshu@pifootnote%
229 | \ding{\the\numexpr\value{#1}+171\relax}%
230 | \else%
231 | \textcircled{\xiaoliu\arabic{#1}}%
232 | \fi}
233 | \renewcommand{\thefootnote}{\shu@textcircled{footnote}}
234 | \renewcommand{\thempfootnote}{\shu@textcircled{mpfootnote}}
235 | \def\footnoterule{\vskip-3\p@\hrule\@width0.3\textwidth\@height0.4\p@\vskip2.6\p@}
236 | \let\shu@footnotesize\footnotesize
237 | \renewcommand\footnotesize{\shu@footnotesize\xiaowu[1.5]}
238 | \footnotemargin1.5em\relax
239 | \let\shu@makefnmark\@makefnmark
240 | \def\shu@@makefnmark{\hbox{{\normalfont\@thefnmark}}}
241 | \pretocmd{\@makefntext}{\let\@makefnmark\shu@@makefnmark}{}{}
242 | \apptocmd{\@makefntext}{\let\@makefnmark\shu@makefnmark}{}{}
243 | \allowdisplaybreaks[4]
244 | \numberwithin{equation}{chapter}
245 | \setlength{\floatsep}{20bp \@plus4pt \@minus1pt}
246 | \setlength{\intextsep}{20bp \@plus4pt \@minus2pt}
247 | \setlength{\textfloatsep}{20bp \@plus4pt \@minus2pt}
248 | \setlength{\@fptop}{0bp \@plus1.0fil}
249 | \setlength{\@fpsep}{12bp \@plus2.0fil}
250 | \setlength{\@fpbot}{0bp \@plus1.0fil}
251 | \renewcommand{\textfraction}{0.15}
252 | \renewcommand{\topfraction}{0.85}
253 | \renewcommand{\bottomfraction}{0.65}
254 | \renewcommand{\floatpagefraction}{0.60}
255 | \let\old@tabular\@tabular
256 | \def\shu@tabular{\dawu[1.5]\old@tabular}
257 | \DeclareCaptionLabelFormat{shu}{{\dawu[1.5]\heiti #1~\rmfamily #2}}
258 | \DeclareCaptionLabelSeparator{shu}{\hspace{1em}}
259 | \DeclareCaptionFont{shu}{\dawu[1.5]}
260 | \captionsetup{labelformat=shu,labelsep=shu,font=shu}
261 | \captionsetup[table]{position=top,belowskip={12bp-\intextsep},aboveskip=6bp}
262 | \captionsetup[figure]{position=bottom,belowskip={12bp-\intextsep},aboveskip=6bp}
263 | \captionsetup[sub]{font=shu,skip=6bp}
264 | \renewcommand{\thesubfigure}{(\alph{subfigure})}
265 | \renewcommand{\thesubtable}{(\alph{subtable})}
266 | \let\shu@LT@array\LT@array
267 | \def\LT@array{\dawu[1.5]\shu@LT@array} % set default font size
268 | \def\shu@title@font{%
269 | \ifshu@arialtitle\sffamily\else\relax\fi}
270 | \AtBeginDocument{%
271 | \pagestyle{shu@empty}
272 | \renewcommand{\chaptermark}[1]{\@mkboth{\CTEXthechapter\hskip\ccwd#1}{}}}
273 | \newcommand\shu@chapter@titleformat[1]{%
274 | \ifthenelse%
275 | {\equal{#1}{\eabstractname}}%
276 | {\bfseries #1}%
277 | {#1}%
278 | }
279 | \ctexset{%
280 | chapter={
281 | afterindent=true,
282 | pagestyle={shu@headings},
283 | beforeskip={9bp},
284 | aftername=\hskip\ccwd,
285 | afterskip={24bp},
286 | format={\centering\shu@title@font\heiti\xiaoer[1]},
287 | nameformat=\relax,
288 | number=\chinese{chapter},
289 | numberformat=\relax,
290 | titleformat=\shu@chapter@titleformat,
291 | },
292 | section={
293 | afterindent=true,
294 | beforeskip={24bp\@plus 1ex \@minus .2ex},
295 | afterskip={6bp\@plus .2ex},
296 | format={\shu@title@font\heiti\sanhao[1.4]},
297 | },
298 | subsection={
299 | afterindent=true,
300 | beforeskip={16bp\@plus 1ex \@minus .2ex},
301 | afterskip={6bp \@plus .2ex},
302 | format={\shu@title@font\heiti\sihao[1.5]},
303 | },
304 | subsubsection={
305 | afterindent=true,
306 | beforeskip={16bp\@plus 1ex \@minus .2ex},
307 | afterskip={6bp \@plus .2ex},
308 | format={\csname shu@title@font\endcsname\heiti\sihao[1.6]},
309 | },
310 | paragraph/afterindent=true,
311 | subparagraph/afterindent=true}
312 | \newcounter{shu@bookmark}
313 | \NewDocumentCommand\shu@chapter{s o m o}{
314 | \IfBooleanF{#1}{%
315 | \ClassError{shuthesis}{You have to use the star form: \string\shu@chapter*}{}
316 | }%
317 | \if@openright\cleardoublepage\else\clearpage\fi\phantomsection%
318 | \IfValueTF{#2}{%
319 | \ifthenelse{\equal{#2}{}}{%
320 | \addtocounter{shu@bookmark}\@ne
321 | \pdfbookmark[0]{#3}{shuchapter.\theshu@bookmark}
322 | }{%
323 | \addcontentsline{toc}{chapter}{#3}
324 | }
325 | }{%
326 | \addcontentsline{toc}{chapter}{#3}
327 | }%
328 | \chapter*{#3}%
329 | \IfValueTF{#4}{%
330 | \ifthenelse{\equal{#4}{}}
331 | {\@mkboth{}{}}
332 | {\@mkboth{#4}{#4}}
333 | }{%
334 | \@mkboth{#3}{#3}
335 | }
336 | }
337 | \setcounter{secnumdepth}{3}
338 | \setcounter{tocdepth}{2}
339 | \def\@pnumwidth{2em}
340 | \def\@tocrmarg{\@pnumwidth}
341 | \def\@dotsep{1}
342 | \patchcmd{\@dottedtocline}{#4}{\csname shu@toc@font\endcsname #4}{}{}
343 | \patchcmd{\@dottedtocline}{\hb@xt@\@pnumwidth}{\hbox}{}{}
344 | \renewcommand*\l@chapter[2]{%
345 | \ifnum \c@tocdepth >\m@ne
346 | \addpenalty{-\@highpenalty}%
347 | \vskip 4bp \@plus\p@
348 | \setlength\@tempdima{3.7em}%
349 | \begingroup
350 | \parindent \z@ \rightskip \@pnumwidth
351 | \parfillskip -\@pnumwidth
352 | \leavevmode
353 | \advance\leftskip\@tempdima
354 | \hskip -\leftskip
355 | % numberline is called here, and it uses \@tempdima
356 | {\csname shu@toc@font\endcsname\heiti #1}
357 | \leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill
358 | \nobreak{\normalfont\normalcolor #2}\par
359 | \penalty\@highpenalty
360 | \endgroup
361 | \fi}
362 | \def\shu@def@term#1{%
363 | \define@key{shu}{#1}{\csname #1\endcsname{##1}}
364 | \expandafter\gdef\csname #1\endcsname##1{%
365 | \expandafter\gdef\csname shu@#1\endcsname{##1}}
366 | \csname #1\endcsname{}}
367 | \shu@def@term{secretlevel}
368 | \shu@def@term{secretyear}
369 | \shu@def@term{id}
370 | \shu@def@term{catalognumber}
371 | \shu@def@term{cauthor}
372 | \shu@def@term{eauthor}
373 | \shu@def@term{csupervisor}
374 | \shu@def@term{esupervisor}
375 | \shu@def@term{ctitle}
376 | \shu@def@term{etitle}
377 | \shu@def@term{cdepartment}
378 | \shu@def@term{edepartment}
379 | \shu@def@term{cmajor}
380 | \shu@def@term{emajor}
381 | \shu@def@term{cdisciplines}
382 | \shu@def@term{edisciplines}
383 | \shu@def@term{cdate}
384 | \shu@def@term{edate}
385 | \shu@def@term{coverdate}
386 | \newcommand{\shu@@cabstract}[1]{\long\gdef\shu@cabstract{#1}}
387 | \newenvironment{cabstract}{\Collect@Body\shu@@cabstract}{}
388 | \newcommand{\shu@@eabstract}[1]{\long\gdef\shu@eabstract{#1}}
389 | \newenvironment{eabstract}{\Collect@Body\shu@@eabstract}{}
390 | \def\shu@parse@keywords#1{
391 | \define@key{shu}{#1}{\csname #1\endcsname{##1}}
392 | \expandafter\gdef\csname shu@#1\endcsname{}
393 | \expandafter\gdef\csname #1\endcsname##1{
394 | \@for\reserved@a:=##1\do{
395 | \expandafter\ifx\csname shu@#1\endcsname\@empty\else
396 | \expandafter\g@addto@macro\csname shu@#1\endcsname{%
397 | \ignorespaces\csname shu@keywords@separator\endcsname}
398 | \fi
399 | \expandafter\expandafter\expandafter\g@addto@macro%
400 | \expandafter\csname shu@#1\expandafter\endcsname\expandafter{\reserved@a}
401 | }
402 | }
403 | }
404 | \shu@parse@keywords{ckeywords}
405 | \shu@parse@keywords{ekeywords}
406 | \def\shusetup{\kvsetkeys{shu}}
407 | \def\shu@first@page{\renewcommand{\ULthickness}{1.8pt}%
408 | {\noindent\ifxetex\XBSong\else\bfseries\songti\fi%
409 | 中图分类号:{\bfseries\shu@catalognumber}\hfill 单位代号:{\bfseries 10280\hphantom{000}}\\
410 | 密\hphantom{空白空}级:\expandafter\ifshu@secret\shu@secret@content\else%
411 | \shu@secretlevel\fi\hfill 学\hphantom{空白}号:{\bfseries\shu@id}}
412 | \par\vskip1mm
413 | \noindent\uline{\hspace{105mm}}\par\vskip2mm
414 | \ifshu@nocolor
415 | \raisebox{1ex}[0pt][0pt]{
416 | \includegraphics[height=3cm,width=9.8cm]{shublack.pdf}}\hskip5mm
417 | \includegraphics[height=3.3cm,width=2.7cm]{shulogoblack.pdf}
418 | \else
419 | \raisebox{1ex}[0pt][0pt]{
420 | \includegraphics[height=3cm,width=9.8cm]{shu.pdf}}\hskip5mm
421 | \includegraphics[height=3.3cm,width=2.7cm]{shulogo.pdf}\fi\par\vskip5mm
422 | \hskip3mm{\maxsize\ifxetex\LanTingHei\else\bfseries\heiti\fi\shu@cdegree 学位论文}
423 | \par\vskip-1mm
424 | \noindent\uline{\hskip143mm}\par\vskip1mm
425 | {\zihao{-1}\bfseries
426 | \centerline{SHANGHAI~~UNIVERSITY}
427 | \centerline{\MakeUppercase{\shu@edegree}'S~~DISSERTATION}}
428 | \begin{center}
429 | \tabulinesep=_5mm^5mm
430 | \arrayrulewidth=1pt
431 | \begin{tabu} to 0.9\textwidth{|X[1,c,m]|X[11,c,m]|}
432 | \hline
433 | \zihao{-2}\ifxetex\HanYikai\else\bfseries\kaishu\fi\makecell{题\\ 目} &
434 | \erhao[1.4]\bfseries\ifxetex\LanTingHei\else\heiti\fi\tabulinesep=_1.5mm^1.5mm
435 | \begin{tabu}{X[c,m]}
436 | \shu@ctitle
437 | \end{tabu}\\\hline
438 | \end{tabu}
439 | \end{center}
440 | \vfill\renewcommand{\ULthickness}{1pt}
441 | \begin{center}
442 | {\heiti\xiaoer[1.9]
443 | \begin{tabular}{cl}
444 | 作\hphantom{空白}者 & \uline{\kaishu\makebox[55mm]{\shu@cauthor}}\\
445 | 学科专业 & \uline{\kaishu\makebox[55mm]{\shu@cmajor}}\\
446 | 导\hphantom{空白}师 & \uline{\kaishu\makebox[55mm]{\shu@csupervisor}}\\
447 | 完成日期 & \uline{\kaishu\makebox[55mm]{\shu@coverdate}}\\
448 | \end{tabular}}
449 | \end{center}
450 | \if@openright\cleardoublepage\else\clearpage\fi}
451 | \newcommand{\makefirstpage}{
452 | \newgeometry{left=3.5cm,right=3.5cm,top=3cm,bottom=3.5cm}
453 | \shu@first@page
454 | \restoregeometry}
455 | \newcommand{\shu@committee}{
456 | \noindent\centerline{\zihao{2} 上海大学} \par
457 | \vskip1.5cm
458 | \erhao[1.5] 本论文经答辩委员会全体委员审查,
459 | 确认符合上海大学博士学位论文质量要求。\par
460 | \vskip3.9cm
461 | \zihao{-2} 答辩委员会签名:\par
462 | \vskip1cm
463 | 主席:\par
464 | \vskip1cm
465 | 委员:\par
466 | \vskip6cm
467 | 导\hphantom{空白}师:\par
468 | \vskip1cm
469 | 答辩日期:
470 | \if@openright\cleardoublepage\else\clearpage\fi
471 | }
472 | \newcommand{\shu@authordeclare}{%
473 | \begin{center}
474 | \zihao{2}\ifxetex\XBSong\else\bfseries\songti\fi 原创性声明
475 | \end{center}
476 | \par\vskip1cm\sihao[1.7]
477 | 本人声明:所呈交的论文是本人在导师指导下进行的研究工作。
478 | 除了文中特别加以标注和致谢的地方外,论文中不包含其他人已发表或撰写过
479 | 的研究成果。参与同一工作的其他同志对本研究所做的任何贡献均已在论文中
480 | 作了明确的说明并表示了谢意。
481 | \vskip2.3cm
482 | \hfill 签名: \underline{\hskip3cm}
483 | 日期: \underline{\hskip3cm}\\
484 | \vskip2.5cm
485 | \begin{center}
486 | \zihao{2}\ifxetex\XBSong\else\bfseries\songti\fi 本论文使用授权说明
487 | \end{center}
488 | \par\vskip1.1cm
489 | 本人完全了解上海大学有关保留、使用学位论文的规定。即:学校有权保留论文
490 | 及送交论文复印件,允许论文被查阅和借阅;学校可以公布论文的全部或部分内容。\par
491 | ({\ifxetex\XBSong\else\bfseries\songti\fi 保密的论文在解密后应遵守此规定})
492 | \vskip1.5cm
493 | \noindent\hfill 签名: \underline{\hskip2.7cm}
494 | 导师签名: \underline{\hskip2.7cm}
495 | 日期: \underline{\hskip2.7cm}\hfill
496 | \if@openright\cleardoublepage\else\clearpage\fi}
497 | \newcommand{\shu@cncover}{%
498 | \vspace*{1.3cm}
499 | \centerline{\zihao{2} 上海大学\shu@cdisciplines\shu@cdegree 学位论文}
500 | \vskip3.5cm
501 | \begin{center}\yihao[1.5]{\bfseries{\shu@ctitle}}\end{center}
502 | \vskip3.5cm
503 | \begin{center}\xiaoer[1.8]
504 | \begin{tabular}{cl}
505 | 作\hphantom{空白}者: & \kaishu\shu@cauthor\\
506 | 导\hphantom{空白}师: & \kaishu\shu@csupervisor\\
507 | 学科专业: & \kaishu\shu@cmajor\\
508 | \end{tabular}
509 | \end{center}
510 | \vskip3.5cm
511 | \begin{center}
512 | \sanhao[1.6]\shu@cdepartment\\
513 | 上海大学\\
514 | \shu@cdate
515 | \end{center}
516 | \if@openright\cleardoublepage\else\clearpage\fi}
517 | \newcommand{\shu@engcover}{%
518 | \vspace*{.5cm}
519 | \begin{center}
520 | \sanhao[1.6] A Dissertation Submitted to Shanghai University
521 | for the \\ Degree of \shu@edegree~in \shu@edisciplines\par
522 | \vskip3cm
523 | \begin{center}\zihao{1}{\bfseries{\shu@etitle}}\end{center}
524 | \vskip4cm
525 | \begin{tabular}{rl}
526 | Candidate: & \shu@eauthor\\
527 | Supervisor: & \shu@esupervisor\\
528 | Major: & \shu@emajor\\
529 | \end{tabular}
530 | \vskip4cm
531 | \bfseries\shu@edepartment\\
532 | Shanghai University\\
533 | \shu@edate
534 | \end{center}
535 | \if@openright\cleardoublepage\else\clearpage\fi}
536 | \def\makecover{\shu@setup@pdfinfo\shu@makecover}
537 | \def\shu@setup@pdfinfo{
538 | \hypersetup{
539 | pdftitle={\shu@ctitle},
540 | pdfauthor={\shu@cauthor},
541 | pdfsubject={\shu@cdegree},
542 | pdfkeywords={\shu@ckeywords},
543 | pdfcreator={\shuthesis-v\version}}}
544 | \newcommand{\shu@makecover}{
545 | \phantomsection
546 | \pdfbookmark[-1]{\shu@ctitle}{ctitle}
547 | \normalsize
548 | \shu@committee
549 | \shu@authordeclare
550 | \shu@cncover
551 | \shu@engcover
552 | \normalsize
553 | \shu@makeabstract
554 | \let\@tabular\shu@tabular
555 | \if@openright\cleardoublepage\else\clearpage\fi}
556 | \newbox\shu@kw
557 | \newcommand\shu@put@keywords[2]{%
558 | \begingroup
559 | \setbox\shu@kw=\hbox{#1}
560 | \noindent\hangindent\wd\shu@kw\hangafter1%
561 | \box\shu@kw#2\par
562 | \endgroup}
563 | \newcommand{\shu@makeabstract}{%
564 | \shu@chapter*[]{\cabstractname}
565 | \pagestyle{shu@headings}
566 | \pagenumbering{Roman}
567 | \shu@cabstract
568 | \vskip12bp
569 | \shu@put@keywords{\heiti\shu@ckeywords@title\enskip}{\shu@ckeywords}
570 | \shu@chapter*[]{\eabstractname}
571 | \shu@eabstract
572 | \vskip12bp
573 | \shu@put@keywords{%
574 | \textbf{Keywords}:\enskip}{\shu@ekeywords}}
575 | \newenvironment{denotation}[1][2.5cm]{%
576 | \shu@chapter*[]{\shu@denotation@name} % no tocline
577 | \vskip-30bp\xiaosi[1.6]\begin{shu@denotation}[labelwidth=#1]
578 | }{%
579 | \end{shu@denotation}
580 | }
581 | \newlist{shu@denotation}{description}{1}
582 | \setlist[shu@denotation]{%
583 | nosep,
584 | font=\normalfont,
585 | align=left,
586 | leftmargin=5cm,
587 | rightmargin=2.5cm,
588 | labelindent=0pt,
589 | labelwidth=2.5cm,
590 | labelsep*=0.5cm,
591 | itemindent=0pt,
592 | }
593 | \newenvironment{acknowledgement}{\shu@chapter*[致谢]{致\quad 谢}}{}
594 | \def\shu@starttoc#1{% #1: float type, prepend type name in \listof*** entry.
595 | \let\oldnumberline\numberline
596 | \def\numberline##1{\oldnumberline{\csname #1name\endcsname\hskip.4em ##1}}
597 | \@starttoc{\csname ext@#1\endcsname}
598 | \let\numberline\oldnumberline}
599 | \def\shu@listof#1{% #1: float type
600 | \@ifstar
601 | {\shu@chapter*[]{\csname list#1name\endcsname}\shu@starttoc{#1}}
602 | {\shu@chapter*{\csname list#1name\endcsname}\shu@starttoc{#1}}}
603 | \renewcommand\listoffigures{\shu@listof{figure}}
604 | \renewcommand*\l@figure{\addvspace{6bp}\@dottedtocline{1}{0em}{4em}}
605 | \renewcommand\listoftables{\shu@listof{table}}
606 | \let\l@table\l@figure
607 | \renewenvironment{thebibliography}[1]{%
608 | \shu@chapter*{\bibname}%
609 | \wuhao[1.5]
610 | \list{\@biblabel{\@arabic\c@enumiv}}%
611 | {\renewcommand{\makelabel}[1]{##1\hfill}
612 | \settowidth\labelwidth{1.1cm}
613 | \setlength{\labelsep}{0em}
614 | \setlength{\itemindent}{0pt}
615 | \setlength{\leftmargin}{\labelwidth+\labelsep}
616 | \addtolength{\itemsep}{-0.7em}
617 | \usecounter{enumiv}%
618 | \let\p@enumiv\@empty
619 | \renewcommand\theenumiv{\@arabic\c@enumiv}}%
620 | \sloppy\frenchspacing
621 | \clubpenalty4000
622 | \@clubpenalty \clubpenalty
623 | \widowpenalty4000%
624 | \interlinepenalty4000%
625 | \sfcode`\.\@m}
626 | {\def\@noitemerr
627 | {\@latex@warning{Empty `thebibliography' environment}}%
628 | \endlist\frenchspacing}
629 | \let\shu@appendix\appendix
630 | \renewenvironment{appendix}{%
631 | \let\title\shu@appendix@title
632 | \shu@appendix}{%
633 | \let\title\@gobble}
634 | \newenvironment{publications}[1][\shu@publications@title]{%
635 | \shu@chapter*{#1}}{}
636 | \newcommand{\researchitem}[1]{%
637 | \vspace{32bp}{\sihao\heiti\centerline{#1}}\par\vspace{14bp}}
638 | \AtEndOfClass{\input{shuthesis.cfg}}
639 | \AtEndOfClass{\sloppy}
640 | \endinput
641 | %%
642 | %% End of file `shuthesis.cls'.
643 |
--------------------------------------------------------------------------------
/shuthesis.dtx:
--------------------------------------------------------------------------------
1 | % \iffalse meta-comment
2 | %
3 | % Copyright (C) 2017 by Lele Liu
4 | %
5 | % This file is the thesis template of Shanghai University (shuthesis),
6 | % which is originally derived from ThuThesis.
7 | %
8 | % This file may be distributed and/or modified under the conditions
9 | % of the LaTeX Project Public License, either version 1.3a of this
10 | % license or (at your option) any later version.
11 | % The latest version of this license is in:
12 | %
13 | % http://www.latex-project.org/lppl.txt
14 | %
15 | % and version 1.3a or later is part of all distributions of LaTeX
16 | % version 2004/10/01 or later.
17 | %
18 | % \fi
19 | %
20 | % \iffalse
21 | %<*driver>
22 | \ProvidesFile{shuthesis.dtx}[2017/05/05 2.0 Shanghai University Thesis Template]
23 | \documentclass{ltxdoc}
24 | \usepackage{dtx-style}
25 |
26 | \EnableCrossrefs
27 | \CodelineIndex
28 | \RecordChanges
29 |
30 | \begin{document}
31 | \DocInput{\jobname.dtx}
32 | \end{document}
33 | %
34 | % \fi
35 | %
36 | % \CheckSum{0}
37 | %
38 | % \CharacterTable
39 | % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
40 | % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
41 | % Digits \0\1\2\3\4\5\6\7\8\9
42 | % Exclamation \! Double quote \" Hash (number) \#
43 | % Dollar \$ Percent \% Ampersand \&
44 | % Acute accent \' Left paren \( Right paren \)
45 | % Asterisk \* Plus \+ Comma \,
46 | % Minus \- Point \. Solidus \/
47 | % Colon \: Semicolon \; Less than \<
48 | % Equals \= Greater than \> Question mark \?
49 | % Commercial at \@ Left bracket \[ Backslash \\
50 | % Right bracket \] Circumflex \^ Underscore \_
51 | % Grave accent \` Left brace \{ Vertical bar \|
52 | % Right brace \} Tilde \~}
53 | %
54 | % \DoNotIndex{\newenvironment,\@bsphack,\@empty,\@esphack,\sfcode}
55 | % \DoNotIndex{\addtocounter,\label,\let,\linewidth,\newcounter}
56 | % \DoNotIndex{\noindent,\normalfont,\par,\parskip,\phantomsection}
57 | % \DoNotIndex{\providecommand,\ProvidesPackage,\refstepcounter}
58 | % \DoNotIndex{\RequirePackage,\setcounter,\setlength,\string,\strut}
59 | % \DoNotIndex{\textbackslash,\texttt,\ttfamily,\usepackage}
60 | % \DoNotIndex{\begin,\end,\begingroup,\endgroup,\par,\\}
61 | % \DoNotIndex{\if,\ifx,\ifdim,\ifnum,\ifcase,\else,\or,\fi}
62 | % \DoNotIndex{\let,\def,\xdef,\edef,\newcommand,\renewcommand}
63 | % \DoNotIndex{\expandafter,\csname,\endcsname,\relax,\protect}
64 | % \DoNotIndex{\Huge,\huge,\LARGE,\Large,\large,\normalsize}
65 | % \DoNotIndex{\small,\footnotesize,\scriptsize,\tiny}
66 | % \DoNotIndex{\normalfont,\bfseries,\slshape,\sffamily,\interlinepenalty}
67 | % \DoNotIndex{\textbf,\textit,\textsf,\textsc}
68 | % \DoNotIndex{\hfil,\par,\hskip,\vskip,\vspace,\quad}
69 | % \DoNotIndex{\centering,\raggedright,\ref}
70 | % \DoNotIndex{\c@secnumdepth,\@startsection,\@setfontsize}
71 | % \DoNotIndex{\ ,\@plus,\@minus,\p@,\z@,\@m,\@M,\@ne,\m@ne}
72 | % \DoNotIndex{\@@par,\DeclareOperation,\RequirePackage,\LoadClass}
73 | % \DoNotIndex{\AtBeginDocument,\AtEndDocument}
74 | %
75 | % \GetFileInfo{\jobname.dtx}
76 | %
77 | % \def\indexname{索引}
78 | % \def\glossaryname{版本历史}
79 | % \IndexPrologue{\section{\indexname}}
80 | % \GlossaryPrologue{\section{\glossaryname}}
81 | %
82 | % \title{\bfseries\color{medpurple}\shuthesis: 上海大学学位论文模板}
83 | % \author{{\kaishu 刘乐乐}\\[5pt]\texttt{ahhylau@gmail.com}}
84 | % \date{v\fileversion\ (\filedate)}
85 | % \maketitle\thispagestyle{empty}
86 | %
87 | % \vskip2cm
88 | % \def\abstractname{\large 说\quad 明}
89 | % \begin{abstract}
90 | % \noindent
91 | % \begin{enumerate}
92 | % \item 本模板旨在建立一个简单易用的上海大学学位论文模板, 包括硕士学位论文、博士学位论文.
93 | % \item 本模板为作者根据上海大学研究生院发布的学位论文的 Word 模板编写而成.
94 | % \item 上海大学研究生院只提供了论文的 Word 模板, 并未提供官方的 \LaTeX\ 模板. \shuthesis\
95 | % 为 Word 模板的 \LaTeX\ 实现, 不保证格式审查老师不提意见. 任何由于使用本模板而引起的论文
96 | % 格式审查问题均与本模板作者无关.
97 | % \item 上海大学研究生院对学位论文的格式细节并未做具体的要求, 因此, \shuthesis\ 对部分
98 | % 细节做了设置, 使排版出来的论文尽可能的美观. 使用本模板前, 请认真阅读 \file{shuthesis.pdf}
99 | % 文件.
100 | % \item 本模板是以清华大学学位论文模板 (ThuThesis) 为基础制作的衍生版, 在此对 ThuThesis
101 | % 模板的维护者表示感谢!
102 | % \item 本模板的发布遵守 \LaTeX\ Project Public License, 使用前请认真阅读协议内容.
103 | % \end{enumerate}
104 | % \end{abstract}
105 | %
106 | %
107 | % \clearpage
108 | % \pagestyle{fancy}
109 | % \begin{multicols}{2}[
110 | % \setlength{\columnseprule}{.4pt}
111 | % \setlength{\columnsep}{18pt}]
112 | % \tableofcontents
113 | % \end{multicols}
114 | % \clearpage
115 | %
116 | %
117 | % \section{模板介绍}
118 | % \shuthesis\ (\textbf{S}hanghai \textbf{U}niversity \LaTeX\ Thesis Template)
119 | % 是为了帮助上海大学毕业生撰写学位论文而编写的 \LaTeX\ 论文模板. 模板的开发分为两
120 | % 个阶段: 版本 v1.x 是由水寿松制作完成的, 基于 CJK 宏包开发和使用 GBK 编码, 可在
121 | % \url{http://blog.lehu.shu.edu.cn/shuishousong/A209370.html} 下载. 当前版本
122 | % 是 v2.0, 由 ahhylau 制作完成, 基于 XeCJK 宏包开发, 文件使用 UTF-8 编码.
123 | % \shuthesis\ v2.0 使用文学化编程 (Literate Programming), 利用 \texttt{doc/DocStrip}
124 | % 将代码和说明文档混合编写, 便于以后的升级和维护. 另外, 作者重新制作了上海大学
125 | % logo 的高清矢量图, 看起来更加美观.
126 | %
127 | % 目前 \shuthesis\ 模板的代码托管在 \href{https://github.com/ahhylau/shuthesis}{GitHub}
128 | % 上, 如有修改建议或者其他要求欢迎在 GitHub 上提交 issue, 作者会尽快回复. 非常期待有其他上
129 | % 大的 \TeX\ 使用者加入到模板的开发与维护当中来, 不断完善模板.
130 | %
131 | % \note[注意:]{模板的作用在于减少论文写作过程中格式调整的时间. 前提是遵守模
132 | % 板的用法, 否则即便用了 \shuthesis\ 也难以保证输出的论文符合学校规范.}
133 | %
134 | %
135 | % \section{安装}
136 | % \label{sec:installation}
137 | %
138 | % \subsection{模板的组成}
139 | % 本文档将尽量完整的介绍模板的使用方法, 如有不清楚之处可以参考示例文档. 下表列出了 \shuthesis\
140 | % 的主要文件及其功能介绍:
141 | %
142 | % \begin{longtable}{l|p{8cm}}
143 | % \toprule
144 | % {\heiti 文件 (夹)} & {\heiti 功能描述}\\\midrule
145 | % \endfirsthead
146 | % \midrule
147 | % {\heiti 文件 (夹)} & {\heiti 功能描述}\\\midrule
148 | % \endhead
149 | % \endfoot
150 | % \endlastfoot
151 | % shuthesis.ins & \textsc{DocStrip} 驱动文件 (开发用) \\
152 | % shuthesis.dtx & \textsc{DocStrip} 源文件 (开发用) \\\midrule
153 | % shuthesis.cls & 模板类文件\\
154 | % shuthesis.cfg & 模板配置文件\\
155 | % shuthesis.bst & 参考文献样式文件\\\midrule
156 | % main.tex & 示例文档主文件\\
157 | % reference/ & 示例文档参考文献目录\\
158 | % data/ & 示例文档章节具体内容\\
159 | % figures/ & 示例文档图片路径\\
160 | % shuthesis.sty & 为示例文档加载其它宏包\\\midrule
161 | % \textbf{shuthesis.pdf} & 用户手册 (本文档) \\
162 | % clean.bat & 清理编译过程中生成的缓存文件\\
163 | % make-doc.bat & 一键生成用户手册 shuthesis.pdf\\\midrule
164 | % FZLanTing.ttf & 方正兰亭中黑字体 (\XeLaTeX\ 编译使用)\\
165 | % FZXBsong.ttf & 方正小标宋字体 (\XeLaTeX\ 编译使用)\\
166 | % HanYikaishu.ttf & 汉仪中楷字体 (\XeLaTeX\ 编译使用)\\\bottomrule
167 | % \end{longtable}
168 | %
169 | % 几点说明:
170 | % \begin{itemize}
171 | % \item \file{shuthesis.cls} 和 \file{shuthesis.cfg} 可由 \file{shuthesis.ins}
172 | % 和 \file{shuthesis.dtx} 生成 (见 \ref{sec:generate-cls} 节), 但为了降低新手用户
173 | % 的使用难度, 故将 \file{shuthesis.cls} 和 \file{shuthesis.cfg} 文件一起发布.
174 | % \item 使用前阅读文档: \file{shuthesis.pdf}.
175 | % \end{itemize}
176 | %
177 | % \subsection{生成模板说明文件}
178 | % \label{sec:generate-cls}
179 | % 模板解压缩后生成文件夹 \file{shuthesis-vX.Y}\footnote{\texttt{vX.Y} 为版本号.},
180 | % 其中包括: 模板源文件 (\file{shuthesis.ins} 和 \file{shuthesis.dtx}), 参考文献样式
181 | % \file{shuthesis.bst}, 示例文档 (\file{main.tex}, \file{shuthesis.sty}\footnote{可
182 | % 能用到的包以及一些命令定义都放在这里, 以免 \file{shuthesis.cls} 过分臃肿.},
183 | % \file{data/}, \file{figures/} 和 \file{reference/}) 等. 在使用之前需要先生成模板说
184 | % 明文件 (\file{shuthesis.pdf}) 和配置文件 (\file{shuthesis.cfg}).
185 | %
186 | % \begin{shell}
187 | % $ cd shuthesis-vX.Y
188 | % # 生成 shuthesis.cls 和 shuthesis.cfg
189 | % $ latex shuthesis.ins
190 | %
191 | % # 下面的命令用来生成用户手册, 可以不执行.
192 | % $ xelatex shuthesis.dtx
193 | % $ makeindex -s gind.ist -o shuthesis.ind shuthesis.idx
194 | % $ makeindex -s gglo.ist -o shuthesis.gls shuthesis.glo
195 | % $ xelatex shuthesis.dtx
196 | % $ xelatex shuthesis.dtx % 生成说明文档 shuthesis.pdf
197 | % \end{shell}
198 | %
199 | % \subsection{编译环境}
200 | % \label{sec:generate-thesis}
201 | % 本模板在 Windows 10 和 \TeX Live 2016 下开发, 支持多种平台. 由于历史原因, 目前国内使
202 | % 用 C\TeX 套装的人还是很多. 然而, C\TeX 套装自从 2012 年后就不再更新了, 许多宏包已经很
203 | % 老旧了. 因此本模板不再支持在 C\TeX 套装下使用\footnote{C\TeX\ v2.9.2 及之前的版本均无
204 | % 法使用.}. 随着 \XeTeX 的发展在 \TeX 中使用中文已经非常方便了. 本模板基于 XeCJK 宏包开
205 | % 发, 全部文件均使用 UTF-8 编码. 作者推荐使用 \TeX Live 进行编译.
206 | %
207 | % \note[注意:]{若用户编译不成功, 请将宏包更新至最新.}
208 | %
209 | % 本模板使用 \texttt{ctex} 宏包进行中文字体的配置 (详见第 \ref{sec:chinese-fonts} 节),
210 | % 因此在不同操作系统下的兼容性有保证. 以下将介绍几种常见的生成论文的方法, 用户可根据自己的
211 | % 情况选择. 最简便的方法是使用 \LaTeX 编辑器 (推荐 TeXstudio) 直接编译, 支持使用 \XeLaTeX\
212 | % (推荐)和 PDF\LaTeX 方式编译. 下面介绍在命令行下使用本模板生成论文的方法.
213 | %
214 | % \subsubsection{\XeLaTeX}
215 | % \label{sec:xelatex}
216 | % 首先来看推荐的 \XeLaTeX 方式 (\texttt{\#} 开头的行为注释):
217 | % \begin{shell}
218 | % # 1. 发现里面的引用关系, 文件后缀 .tex 可以省略.
219 | % $ xelatex main
220 | %
221 | % # 2. 编译参考文件源文件, 生成 bbl 文件.
222 | % $ bibtex main
223 | %
224 | % # 3. 下面解决引用.
225 | % $ xelatex main
226 | % $ xelatex main # 此时生成完整的 pdf 文件
227 | % \end{shell}
228 | %
229 | % \subsubsection{PDF\LaTeX}
230 | % \label{sec:pdflatex}
231 | % 如果使用 PDF\LaTeX, 按照第~\ref{sec:xelatex} 节的顺序执行即可, 只需要将命令中
232 | % \texttt{xelatex} 替换为 \texttt{pdflatex} 即可.
233 | %
234 | % 需要注意的是 PDF\LaTeX\ 不能处理常见的 EPS 图形, 需要先用 \texttt{epstopdf} 将
235 | % 其转化成 PDF. 不过 PDF\LaTeX\ 增加了对 png, jpg 等格式的支持, 比较方便. \TeX Live\
236 | % 自从 2010 版本起自动调用 \texttt{epstopdf} 将 EPS 图形转化为 PDF.
237 | %
238 | % \subsubsection{latexmk}
239 | % \label{sec:latexmk}
240 | % \texttt{latexmk} 命令支持全自动生成 \LaTeX\ 编写的文档, 并且支持使用不同的
241 | % 工具链来进行生成, 它会自动运行多次工具直到交叉引用都被解决. 下面给出了一个用
242 | % \texttt{latexmk} 调用 \XeLaTeX\ 生成最终文档的示例:
243 | % \begin{shell}
244 | % # 只需要使用下面这一句就可以了.
245 | % $ latexmk -xelatex main
246 | % \end{shell}
247 | %
248 | %
249 | % \section{使用说明}
250 | % \label{sec:usage}
251 | %
252 | % \subsection{示例文件}
253 | % \label{sec:userguide}
254 | % 模板核心文件有三个: \file{shuthesis.cls}, \file{shuthesis.cfg} 和 \file{shuthesis.bst},
255 | % 但是如果没有示例文档用户会发现很难下手. 所以推荐新用户从模板自带的示例文档入手, 里面包括了
256 | % 论文写作用到的所有命令及其使用方法, 只需要用自己的内容进行相应替换就可以. 对于不清楚的命
257 | % 令可以查阅本手册. 下面的例子描述了模板中章节的组织形式, 来自于示例文档, 具体内容可以参考
258 | % 模板附带的 \file{main.tex} 和 \file{data/}.
259 | %
260 | % \lstinputlisting[style=lstStyleLaTeX]{main.tex}
261 | %
262 | % \subsection{论文选项}
263 | % \label{sec:option}
264 | %
265 | % \DescribeOption{type}
266 | % 选择论文类型, 当前支持: \option{master}, \option{doctor}, 为必选项.
267 | % \begin{latex}
268 | % % 博士论文
269 | % \documentclass[type=doctor]{shuthesis}
270 | %
271 | % % 硕士论文
272 | % \documentclass[type=master]{shuthesis}
273 | % \end{latex}
274 | %
275 | % \DescribeOption{secret}
276 | % 涉秘论文开关 (默认: 关闭). 第 \ref{sec:setup-secret} 节两个配置 (或命令)
277 | % \cs{secretlevel}\marg{级别} 和 \cs{secretyear}\marg{年数} 分别用来指定保
278 | % 密级别和时限.
279 | % \begin{latex}
280 | % \documentclass[secret]{shuthesis} % 打开保密
281 | % \shusetup{
282 | % secretlevel={公开},
283 | % secretyear={10}
284 | % }
285 | % % 或者
286 | % \secretlevel{保密}
287 | % \secretyear{10}
288 | % \end{latex}
289 | %
290 | % \DescribeOption{pifootnote}
291 | % 是否使用 \pkg{pifont} 的带圈字符标记脚注编号, 默认关闭. 一页的脚注建议控制
292 | % 在 9 个以内, 否则大于 10 的数字带圈的效果不太好. 建议使用时打开此选项, 脚注
293 | % 编号很漂亮, 开启方法如下:
294 | % \begin{latex}
295 | % \documentclass[pifootnote]{shuthesis}
296 | % \end{latex}
297 | %
298 | % \DescribeOption{openany}
299 | % \DescribeOption{openright}
300 | % 正规出版物的章节出现在奇数页, 也就是右手边的页面, 这就是 \option{openright}.
301 | % 在这种情况下, 如果前一章的最后一页也是奇数, 那么模板会自动生成一个纯粹的空
302 | % 白页, 很多人不是很习惯这种方式, 而且学校的格式似乎更倾向于页面连续, 那就是
303 | % 通常所说的 \option{openany}. \shuthesis\ 的默认选项是 \option{openright}.
304 | % 如果需要使用 \option{openany}, 可按如下方式开启:
305 | % \begin{latex}
306 | % \documentclass[openany]{shuthesis}
307 | % \end{latex}
308 | %
309 | % \DescribeOption{arialtitle}
310 | % 章节标题中英文是否用 \option{Arial} 字体 (默认打开).
311 | %
312 | % \DescribeOption{nocolor}
313 | % 文字超链接不使用彩色 (默认关闭). 在向图书馆提交最终版本时请打开 \option{nocolor}
314 | % 选项, 因为图书馆要求电子版论文中不允许出现除黑色以外的颜色. 开启方法如下:
315 | % \begin{latex}
316 | % \documentclass[nocolor]{shuthesis}
317 | % \end{latex}
318 | %
319 | % \subsection{中文字体}
320 | % \label{sec:chinese-fonts}
321 | %
322 | % \subsubsection{字体配置}
323 | % \label{sec:font-config}
324 | % 正确配置中文字体是使用模板的第一步. 模板调用 \texttt{ctex} 宏包, 提供如下字体使用方式:
325 | % \begin{itemize}
326 | % \item 基于传统 \pkg{CJK} 包, PDF\LaTeX\ 编译.
327 | % \item 基于 \pkg{xeCJK} 包, 使用 \XeLaTeX\ 编译 (推荐方法).
328 | % \end{itemize}
329 | %
330 | % 模板默认使用 \texttt{ctex} 的字体配置. 关于中文字体安装、配置的所有问题不在本模板讨论
331 | % 范围.
332 | %
333 | % \subsubsection{字体命令}
334 | % \label{sec:fontcmds}
335 | % \myentry{字体和字号}
336 | % \DescribeMacro{\chuhao}
337 | % \DescribeMacro{\xiaochu}
338 | % \DescribeMacro{\yihao}
339 | % \DescribeMacro{\xiaoyi}
340 | % \DescribeMacro{...}
341 | % 切换宋体 \cs{songti}、仿宋 \cs{fangsong}、黑体 \cs{heiti}、
342 | % 楷体 \cs{kaishu} 四种基本字体. 定义字体大小, 分别为:
343 | %
344 | % \begin{center}
345 | % \begin{tabular}{llllll}
346 | % \toprule
347 | % \cs{chuhao} & \cs{xiaochu} & \cs{yihao} & \cs{xiaoyi} & \cs{erhao} & \cs{xiaoer}\\
348 | % \cs{sanhao} & \cs{xiaosan} & \cs{sihao} & \cs{banxiaosi} & \cs{xiaosi} & \cs{dawu}\\
349 | % \cs{wuhao} & \cs{xiaowu} & \cs{liuhao} & \cs{xiaoliu} & \cs{qihao} & \cs{bahao}\\
350 | % \bottomrule
351 | % \end{tabular}
352 | % \end{center}
353 | %
354 | % 使用方法为: \cs{command}\oarg{num}, 其中 command 为字号命令, num 为行距. 比
355 | % 如 \cs{xiaosi}[1.5] 表示选择小四字体, 行距 1.5 倍, 这样更为灵活. 当然, 也可以
356 | % 使用 \texttt{ctex} 宏包定义的 \cs{zihao}\marg{num} 来切换字号, 具体用法参看其文档.
357 | %
358 | % \subsection{封面信息}
359 | % \label{sec:titlepage}
360 | % 封面信息提供两种配置方法: 一是通过统一设置命令 \cs{shusetup} 通过
361 | % \emph{key=value} 形式完成; 二是每个信息利用命令独立设置, 其中命令
362 | % 的名字跟 \emph{key} 相同. 两种方式可以交叉使用, 并按顺序执行 (即后
363 | % 来的设置会覆盖前面的). 以 \texttt{c} 开头的命令跟中文相关, \texttt{e}
364 | % 开头则为对应的英文.
365 | %
366 | % \DescribeMacro{\shusetup}
367 | % \cs{shusetup} 用法与常见 \emph{key=value} 命令相同, 如下:
368 | % \begin{latex}
369 | % \shusetup{
370 | % key1 = {value1},
371 | % key2 = {value2},
372 | % }
373 | % % 可以多次调用
374 | % \shusetup{
375 | % key3 = {value3},
376 | % key1 = {value4}, % 覆盖 value1
377 | % }
378 | % \end{latex}
379 | %
380 | % \note[注意:]{~\cs{shusetup} 使用 \pkg{kvoptions} 机制, 所以配置项之间不能有空行,
381 | % 否则会报错.}
382 | %
383 | % \subsubsection{密级}
384 | % \label{sec:setup-secret}
385 | % \DescribeMacro{\secretlevel}
386 | % \DescribeMacro{\secretyear}
387 | % 定义秘密级别和年限, 需要打开论文的 \option{secret} 选项.
388 | % \begin{latex}
389 | % \shusetup{
390 | % secretyear={10},
391 | % secretlevel={内部},
392 | % }
393 | % % 以下命令方式与上面的等价:
394 | % \secretyear{10}
395 | % \secretlevel{内部}
396 | % \end{latex}
397 | %
398 | % \subsubsection{学号和中图分类号}
399 | % \label{sec:setup-id}
400 | % \DescribeMacro{\id}
401 | % \DescribeMacro{\catalognumber}
402 | % 学号和中图分类号.
403 | % \begin{latex}
404 | % \shusetup{
405 | % id={学号},
406 | % catalognumber={中图分类号},
407 | % }
408 | % % 等价:
409 | % \id{学号}
410 | % \catalognumber{中图分类号}
411 | % \end{latex}
412 | %
413 | % \subsubsection{作者姓名}
414 | % \DescribeMacro{\cauthor}
415 | % \DescribeMacro{\eauthor}
416 | % 作者姓名.
417 | % \begin{latex}
418 | % \shusetup{
419 | % cauthor={中文姓名},
420 | % eauthor={Name in English}
421 | % }
422 | % % 等价:
423 | % \cauthor{中文姓名}
424 | % \eauthor{Name in English}
425 | % \end{latex}
426 | %
427 | % \subsubsection{导师}
428 | % \DescribeMacro{\csupervisor}
429 | % \DescribeMacro{\esupervisor}
430 | % 导师姓名.
431 | % \begin{latex}
432 | % \shusetup{
433 | % csupervisor={导师},
434 | % esupervisor={Supervisor}
435 | % }
436 | % % 等价:
437 | % \csupervisor{导师}
438 | % \esupervisor{Supervisor}
439 | % \end{latex}
440 | %
441 | % \subsubsection{论文标题}
442 | % \DescribeMacro{\ctitle}
443 | % \DescribeMacro{\etitle}
444 | % 中英文标题. 题目内部可以使用换行 ``|\\|".
445 | % \begin{latex}
446 | % \shusetup{
447 | % ctitle={论文中文题目},
448 | % etitle={Thesis English Title}
449 | % }
450 | % % 等价:
451 | % \ctitle{论文中文题目}
452 | % \etitle{Thesis English Title}
453 | % \end{latex}
454 | %
455 | % \subsubsection{申请学位名称}
456 | % \label{sec:degree}
457 | % \shuthesis\ 会根据用户的选择 \texttt{type=master} 或 \texttt{type=doctor} 进行自动设置.
458 | %
459 | % \subsubsection{院系名称}
460 | % \DescribeMacro{\cdepartment}
461 | % \DescribeMacro{\edepartment}
462 | % 院系名称.
463 | % \begin{latex}
464 | % \shusetup{
465 | % cdepartment={院系名称},
466 | % edepartment={Deparment}
467 | % }
468 | % % 等价:
469 | % \cdepartment{院系名称}
470 | % \edepartment{Department}
471 | % \end{latex}
472 | %
473 | % \subsubsection{专业名称}
474 | % \DescribeMacro{\cmajor}
475 | % \DescribeMacro{\emajor}
476 | % 专业名称.
477 | % \begin{latex}
478 | % \shusetup{
479 | % cmajor={专业名称},
480 | % emajor={Major in English}
481 | % }
482 | % % 等价:
483 | % \cmajor{专业名称}
484 | % \emajor{Major in English}
485 | % \end{latex}
486 | %
487 | % \subsubsection{学科分类名称}
488 | % \DescribeMacro{\cdisciplines}
489 | % \DescribeMacro{\edisciplines}
490 | % 学科分类名称, 即理学、工学、文学.
491 | % \begin{latex}
492 | % \shusetup{
493 | % cdisciplines={学科分类名称},
494 | % edisciplines={Subject in English}
495 | % }
496 | % % 等价:
497 | % \cdisciplines{学科分类名称}
498 | % \edisciplines{Subject in English}
499 | % \end{latex}
500 | %
501 | % \subsubsection{论文完成日期}
502 | % \DescribeMacro{\cdate}
503 | % \DescribeMacro{\edate}
504 | % 默认为当前时间, 也可以自己指定.
505 | % \begin{latex}
506 | % \shusetup{
507 | % cdate={中文日期},
508 | % edate={English Date}
509 | % }
510 | % % 等价:
511 | % \cdate{中文日期}
512 | % \edate{English Date}
513 | % \end{latex}
514 | %
515 | % \subsubsection{摘要}
516 | % \myentry{摘要正文}
517 | % \DescribeEnv{cabstract}
518 | % \DescribeEnv{eabstract}
519 | % 摘要正文只能用环境命令的形式, 不支持 \cs{shusetup}.
520 | %
521 | % \begin{latex}
522 | % \begin{cabstract}
523 | % 摘要请写在这里.
524 | % \end{cabstract}
525 | %
526 | % \begin{eabstract}
527 | % Here comes the abstract in English.
528 | % \end{eabstract}
529 | % \end{latex}
530 | %
531 | % \myentry{关键词}
532 | % \DescribeMacro{\ckeywords}
533 | % \DescribeMacro{\ekeywords}
534 | % 关键词用英文逗号分割写入相应的命令中, 模板会解析各关键词并生成符合不同论文
535 | % 格式要求的关键词格式.
536 | % \begin{latex}
537 | % \shusetup{
538 | % ckeywords={关键词 1, 关键词 2},
539 | % ekeywords={keyword 1, keyword 2}
540 | % }
541 | % % 等价:
542 | % \ckeywords{关键词 1, 关键词 2}
543 | % \ekeywords{keyword 1, keyword 2}
544 | % \end{latex}
545 | %
546 | % \myentry{生成封面}
547 | % \DescribeMacro{\makefirstpage}
548 | % \DescribeMacro{\makecover}
549 | % 命令 \cs{makefirstpage} 用以生成带有学校 logo 的封面. 如果不需要此页可以
550 | % 将 \cs{makefirstpage} 注释掉. 命令 \cs{makecover} 用以生成答辩委员会签名
551 | % 页、原创性声明和授权说明页、中文标题页、英文标题页以及摘要等.
552 | %
553 | % \subsubsection{符号对照表}
554 | % \DescribeEnv{denotation}
555 | % 主要符号表环境, 跟 \env{description} 类似, 使用方法参见示例文件. 带一个可
556 | % 选参数, 用来指定符号列的宽度 (默认为 2.5cm).
557 | % \begin{latex}
558 | % \begin{denotation}
559 | % \item[E] 能量
560 | % \item[m] 质量
561 | % \item[c] 光速
562 | % \end{denotation}
563 | % \end{latex}
564 | %
565 | % 如果默认符号列的宽度不满意, 可以通过参数来调整:
566 | % \begin{latex}
567 | % \begin{denotation}[1.5cm] % 设置为 1.5cm
568 | % \item[E] 能量
569 | % \item[m] 质量
570 | % \item[c] 光速
571 | % \end{denotation}
572 | % \end{latex}
573 | %
574 | % \subsection{目录和索引表}
575 | % 目录、插图、表格等索引命令分别如下, 将其插入到期望的位置即可 (带星号的命令表
576 | % 示对应的索引表不会出现在目录中):
577 | %
578 | % \DescribeMacro{\tableofcontents}
579 | % \DescribeMacro{\listoffigures}
580 | % \DescribeMacro{\listoffigures*}
581 | % \DescribeMacro{\listoftables}
582 | % \DescribeMacro{\listoftables*}
583 | % \begin{longtable}{ll}
584 | % \toprule
585 | % {\heiti 用途} & {\heiti 命令} \\\midrule
586 | % 目录 & \cs{tableofcontents} \\\midrule
587 | % 插图索引 & \cs{listoffigures} \\
588 | % & \cs{listoffigures*} \\\midrule
589 | % 表格索引 & \cs{listoftables} \\
590 | % & \cs{listoftables*} \\\bottomrule
591 | % \end{longtable}
592 | %
593 | % \LaTeX\ 默认支持插图和表格索引, 是通过 \cs{caption} 命令完成的, 因此它们必须出
594 | % 现在浮动环境中, 否则不被计数.
595 | %
596 | % 如果不想让某个表格或者图片出现在索引里面, 那么请使用命令 \cs{caption*}, 这个
597 | % 命令不会给表格编号, 也就是出来的只有标题文字而没有``表~xx'',``图~xx'', 否则
598 | % 索引里面序号不连续就显得不伦不类, 这也是 \LaTeX\ 里星号命令默认的规则.
599 | %
600 | %
601 | % \subsection{封底部分}
602 | % \subsubsection{致谢}
603 | % \DescribeEnv{acknowledgement}
604 | % 把致谢做成一个环境更好一些, 直接往里面写感谢的话就可以了.
605 | % \begin{latex}
606 | % \begin{acknowledgement}
607 | % 这里填写致谢内容...
608 | % \end{acknowledgement}
609 | % \end{latex}
610 | %
611 | %
612 | % \subsubsection{附录}
613 | % \DescribeEnv{appendix}
614 | % 所有的附录都插到这里来.
615 | % \begin{latex}
616 | % \begin{appendix}
617 | % \input{data/appendix}
618 | % \end{appendix}
619 | % \end{latex}
620 | %
621 | % \subsubsection{作者在攻读学位期间发表的论文}
622 | %
623 | % \DescribeEnv{publications}
624 | % 用 \env{enumerate} 环境进行罗列发表的论文.
625 | %
626 | % \subsection{自定义}
627 | % \label{sec:othercmd}
628 | %
629 | % \subsubsection{数学环境}
630 | % \label{sec:math}
631 | % \shuthesis\ 定义了常用的数学环境:
632 | %
633 | % \begin{center}
634 | % \begin{tabular}{*{7}{l}}\toprule
635 | % axiom & theorem & definition & proposition & lemma & conjecture &\\
636 | % 公理 & 定理 & 定义 & 命题 & 引理 & 猜想 &\\\midrule
637 | % proof & corollary & example & exercise & assumption & remark & problem \\
638 | % 证明 & 推论 & 例子& 练习 & 假设 & 注释 & 问题\\\bottomrule
639 | % \end{tabular}
640 | % \end{center}
641 | % 比如:
642 | % \begin{latex}
643 | % \begin{theorem}
644 | % 一元五次方程没有一般代数解.
645 | % \end{theorem}
646 | % \end{latex}
647 | % 产生 (自动编号):
648 | % \medskip
649 | %
650 | % \noindent\framebox[\linewidth][l]{{\heiti 定理~1.1~~} % {一元五次方程没有一般代数解.}}
651 | %
652 | % \subsubsection{引用方式}
653 | %
654 | % \DescribeMacro{\cite}
655 | % \shuthesis\ 推荐使用 \BibTeX 来生成参考文献, 即将参考文献写进一个 \texttt{.bib} 文件里, 通过
656 | % \texttt{shuthesis.bst} 生成符合要求的参考文献. 如:
657 | % \begin{latex}
658 | % @book{algebra2000,
659 | % title = {代数学引论},
660 | % author = {聂灵沼 and 丁石孙},
661 | % publisher = {高等教育出版社},
662 | % year = {2000},
663 | % }
664 | % \end{latex}
665 | % \note[注意:]{如果不使用 \texttt{shuthesis.bst} 制作参考文献, 请删除 \file{main.tex}
666 | % 中以 \cs{bibliography} 开头的两行, 以避免可能的编译错误.}
667 | %
668 | % \subsubsection{列表环境}
669 | % \DescribeEnv{itemize}
670 | % \DescribeEnv{enumerate}
671 | % \DescribeEnv{description}
672 | % 为了适合中文习惯, 模板将这三个常用的列表环境用 \pkg{enumitem} 进行了纵向间距压
673 | % 缩. 一方面清除了多余空间, 另一方面用户可以自己指定列表环境的样式 (如标签符号,
674 | % 缩进等). 细节请参看 \pkg{enumitem} 文档, 此处不再赘述.
675 | %
676 | %
677 | % \subsection{其它}
678 | % 模板的配置文件 \file{shuthesis.cfg} 中定义了很多固定词汇, 一般无须修改. 如果有特殊需求,
679 | % 推荐在导言区使用 \cs{renewcommand}.
680 | %
681 | %
682 | %
683 | %
684 | %
685 | % \StopEventually{\PrintChanges\PrintIndex}
686 | % \clearpage
687 | %
688 | % \section{实现细节}
689 | %
690 | % \subsection{基本信息}
691 | % \begin{macrocode}
692 | %\NeedsTeXFormat{LaTeX2e}[1999/12/01]
693 | %\ProvidesClass{shuthesis}
694 | %\ProvidesFile{shuthesis.cfg}
695 | %[2017/05/05 v2.0 Shanghai University Thesis Template]
696 | % \end{macrocode}
697 | %
698 | % \subsection{定义选项}
699 | % \label{sec:defoption}
700 | % \begin{macrocode}
701 | %<*cls>
702 | \hyphenation{Shu-Thesis}
703 | \def\shuthesis{\textsc{ShuThesis}}
704 | \def\version{2.0}
705 | \RequirePackage{kvoptions}
706 | \SetupKeyvalOptions{
707 | family=shu,
708 | prefix=shu@,
709 | setkeys=\kvsetkeys}
710 | % \end{macrocode}
711 | %
712 | % 用 \pkg{kvoptions} 的 key=value 方式来设置论文类型.
713 | % \begin{macrocode}
714 | \newif\ifshu@master
715 | \newif\ifshu@doctor
716 | \define@key{shu}{type}{%
717 | \shu@masterfalse
718 | \shu@doctorfalse
719 | \expandafter\csname shu@#1true\endcsname}
720 | \def\shu@deprecated@type@option{%
721 | \kvsetkeys{shu}{type=\CurrentOption} % for compatability.
722 | \ClassError{shuthesis}{Option '\CurrentOption' is deprecated, \MessageBreak
723 | please use 'type=\CurrentOption' instead}{}}
724 | \DeclareVoidOption{master}{\shu@deprecated@type@option}
725 | \DeclareVoidOption{doctor}{\shu@deprecated@type@option}
726 | % \end{macrocode}
727 | %
728 | % 论文是否保密.
729 | % \begin{macrocode}
730 | \DeclareBoolOption{secret}
731 | % \end{macrocode}
732 | %
733 | % 章节标题中的英文是否用 Arial 字体 (默认打开).
734 | % \begin{macrocode}
735 | \DeclareBoolOption{arialtitle}
736 | % \end{macrocode}
737 | %
738 | % \option{raggedbottom} 选项 (默认打开).
739 | %
740 | % \begin{macrocode}
741 | \DeclareBoolOption{raggedbottom}
742 | % \end{macrocode}
743 | %
744 | % 在脚注标记中使用 \pkg{pifont} 的带圈数字 (默认关闭).
745 | % \begin{macrocode}
746 | \DeclareBoolOption{pifootnote}
747 | % \end{macrocode}
748 | %
749 | % 超链接是否使用彩色 (默认使用蓝色).
750 | % \begin{macrocode}
751 | \DeclareBoolOption{nocolor}
752 | % \end{macrocode}
753 | %
754 | % 将选项传递给 \pkg{ctexbook}.
755 | % \begin{macrocode}
756 | \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}}
757 | % \end{macrocode}
758 | %
759 | % 打开默认选项.
760 | % \begin{macrocode}
761 | \kvsetkeys{shu}{raggedbottom,arialtitle}
762 | % \end{macrocode}
763 | %
764 | % 解析用户传递过来的选项, 并加载 \pkg{ctexbook}.
765 | % \begin{macrocode}
766 | \ProcessKeyvalOptions*
767 | % \end{macrocode}
768 | %
769 | % \changes{v2.0}{2017/05/05}{从 v2.0 开始将使用 UTF-8 编码, 同时支持 PDF\LaTeX\
770 | % 和 \XeLaTeX\ 方式编译.}
771 | % \changes{v2.0}{2017/05/05}{使用 \pkg{ctex} 宏包默认中文字体配置, 支持不同引擎.}
772 | %
773 | % 使用 \pkg{ctexbook} 类, 优于调用 \pkg{ctex} 宏包.
774 | % \begin{macrocode}
775 | \LoadClass[a4paper,UTF8,zihao=-4,scheme=plain]{ctexbook}
776 | % \end{macrocode}
777 | %
778 | % 使用 \XeTeX\ 引擎时, \pkg{fontspec} 宏包会被 \pkg{xeCJK} 自动调用. 传递
779 | % 给 \pkg{fontspec} 宏包 \option{no-math} 选项, 避免部分数学符号字体自动调
780 | % 整为 CMR. 其他引擎下没有这个问题, 这一行会被无视.
781 | % \begin{macrocode}
782 | \PassOptionsToPackage{no-math}{fontspec}
783 | % \end{macrocode}
784 | %
785 | % 将 \texttt{AutoFakeBold} 选项传递给 \pkg{xeCJK} 以实现字体加粗的效果 (主要用
786 | % 在封面上的字体). 事实上, 这种加粗是伪加粗, 编译出来的效果并不好看. 所以 \shuthesis\
787 | % 并没有用 \texttt{AutoFakeBold} 选项.
788 | % \begin{macrocode}
789 | %\PassOptionsToPackage{AutoFakeBold}{xeCJK}
790 | % \end{macrocode}
791 | %
792 | % 而是使用方正小标宋、方正兰亭黑和汉仪中楷字体作为宋体、黑体和楷书的加粗形式, 更加美观.
793 | % \changes{v2.0}{2017/05/05}{使用方正小标宋和方正兰亭黑字体.}
794 | % \begin{macrocode}
795 | \RequirePackage{ifxetex}
796 | \ifxetex
797 | \setCJKfamilyfont{LanTingHei}{FZLanTing.ttf}
798 | \newcommand{\LanTingHei}{\CJKfamily{LanTingHei}}
799 | \setCJKfamilyfont{XBSong}{FZXBsong.ttf}
800 | \newcommand{\XBSong}{\CJKfamily{XBSong}}
801 | \setCJKfamilyfont{HanYikai}{HanYikaishu.ttf}
802 | \newcommand{\HanYikai}{\CJKfamily{HanYikai}}
803 | \else\fi
804 | % \end{macrocode}
805 | %
806 | % 用户至少要提供一个选项, 指定论文类型.
807 | % \begin{macrocode}
808 | \ifshu@master\relax\else
809 | \ifshu@doctor\relax\else
810 | \ClassError{shuthesis}%
811 | {Please specify thesis type in option: \MessageBreak
812 | type=[master|doctor]}{}
813 | \fi
814 | \fi
815 | % \end{macrocode}
816 | %
817 | %
818 | % \subsection{装载宏包}
819 | % \label{sec:loadpackage}
820 | %
821 | % 引用的宏包和相应的定义.
822 | % \begin{macrocode}
823 | \RequirePackage{etoolbox}
824 | \RequirePackage{xparse}
825 | % \end{macrocode}
826 | %
827 | % \AmSTeX\ 宏包, 用来排出更加漂亮的公式.
828 | % \begin{macrocode}
829 | \RequirePackage{amsmath}
830 | \RequirePackage{amssymb}
831 | \RequirePackage{amsfonts}
832 | % \end{macrocode}
833 | %
834 | % 不同于 \cs{mathcal} 和 \cs{mathfrak} 之类的英文花体字体.
835 | % \begin{macrocode}
836 | \RequirePackage{mathrsfs}
837 | % \end{macrocode}
838 | %
839 | % 处理数学公式中的黑斜体的宏包.
840 | % \begin{macrocode}
841 | \RequirePackage{bm}
842 | % \end{macrocode}
843 | %
844 | % \pkg{mathtools} 宏包是 \AmSTeX\ 宏包的补充, 它提供了许多有用的命令, 比如 \texttt{dcases}
845 | % 等环境, 详见 \pkg{mathtools} 的宏包说明文档. 另外, \pkg{ntheorem} 宏包会影响 \pkg{mathtools},
846 | % 因此需要在 \pkg{ntheorem} 之前调用 \pkg{mathtools} 宏包.
847 | % \begin{macrocode}
848 | \RequirePackage{mathtools}
849 | % \end{macrocode}
850 | %
851 | % \pkg{newtx} 设置 Times New Roman, Helvetica.
852 | %
853 | % \begin{macrocode}
854 | \RequirePackage[defaultsups]{newtxtext}
855 | % \RequirePackage{newtxmath}
856 | % \end{macrocode}
857 | %
858 | % \pkg{newtx} 的 Mono 字体虽然很好看, 但在论文中不常见. 学校虽未要求 Mono 字
859 | % 体, 还是选择常见的 Courier 字体. 由于比较新的实现 \TeX\ Gyre Cursor 会修
860 | % 改 \cs{bfdefault}, 导致中文加粗出问题, 所以选用标准 \pkg{courier}.
861 | % \begin{macrocode}
862 | \RequirePackage{courier}
863 | % \end{macrocode}
864 | %
865 | % 图形支持宏包.
866 | % \begin{macrocode}
867 | \RequirePackage{graphicx}
868 | \RequirePackage[labelformat=simple]{subcaption}
869 | % \end{macrocode}
870 | %
871 | % 提供更加灵活的列表定制.
872 | % \begin{macrocode}
873 | \RequirePackage[shortlabels]{enumitem}
874 | \RequirePackage{environ}
875 | % \end{macrocode}
876 | %
877 | % 禁止 \LaTeX 自动调整多余的页面底部空白, 并保持脚注仍然在底部.
878 | % 脚注按页编号.
879 | % \begin{macrocode}
880 | \ifshu@raggedbottom
881 | \RequirePackage[bottom,perpage,hang]{footmisc}
882 | \raggedbottom
883 | \else
884 | \RequirePackage[perpage,hang]{footmisc}
885 | \fi
886 | % \end{macrocode}
887 | %
888 | % \begin{macrocode}
889 | \ifshu@pifootnote
890 | \RequirePackage{pifont}
891 | \fi
892 | % \end{macrocode}
893 | %
894 | % 利用 \pkg{CJKfntef} 实现汉字的下划线和盒子内两段对齐, 并可以避免
895 | % \cs{makebox}\oarg{width}\oarg{s} 可能产生的 underful boxes.
896 | % \begin{macrocode}
897 | \RequirePackage{CJKfntef}
898 | % \end{macrocode}
899 | %
900 | % 定理类环境宏包, 其中 \pkg{amsmath} 选项用来兼容 \AmSTeX\ 的宏包
901 | % \begin{macrocode}
902 | \RequirePackage[amsmath,thmmarks,hyperref]{ntheorem}
903 | % \end{macrocode}
904 | %
905 | % 表格控制
906 | % \begin{macrocode}
907 | \RequirePackage{array}
908 | \RequirePackage{longtable}
909 | \RequirePackage{makecell}
910 | \RequirePackage{tabu}
911 | % \end{macrocode}
912 | %
913 | % 使用三线表: \cs{toprule}, \cs{midrule}, \cs{bottomrule}.
914 | % \begin{macrocode}
915 | \RequirePackage{booktabs}
916 | % \end{macrocode}
917 | %
918 | % 定制灵活的文字下划线格式.
919 | % \begin{macrocode}
920 | \RequirePackage{ulem}
921 | % \end{macrocode}
922 | %
923 | % 参考文献引用宏包.
924 | % \begin{macrocode}
925 | \RequirePackage[numbers,sort&compress]{natbib}
926 | % \end{macrocode}
927 | %
928 | % 删除默认模板 (\file{book.cls}) 在章之间引入的垂直间隔. 要放在 \pkg{hyperref}
929 | % 之前.
930 | % \begin{macrocode}
931 | \patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{} % lof
932 | \patchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{10\p@}}}{}{}{} % lot
933 | % \end{macrocode}
934 | %
935 | % 生成有书签的 pdf 及其开关, 请结合 gbk2uni 避免书签乱码.
936 | % \begin{macrocode}
937 | \RequirePackage{hyperref}
938 | \ifxetex
939 | \hypersetup{%
940 | CJKbookmarks=true}
941 | \else
942 | \hypersetup{%
943 | unicode=true,
944 | CJKbookmarks=false}
945 | \fi
946 | \hypersetup{%
947 | linktoc=all,
948 | bookmarksnumbered=true,
949 | bookmarksopen=true,
950 | bookmarksopenlevel=2,
951 | breaklinks=true,
952 | colorlinks=true,
953 | plainpages=false}
954 | \ifshu@nocolor
955 | \hypersetup{%
956 | citecolor=black,
957 | linkcolor=black,
958 | urlcolor=black}
959 | \else
960 | \hypersetup{%
961 | citecolor=blue,
962 | linkcolor=blue,
963 | urlcolor=blue}
964 | \fi
965 | % \end{macrocode}
966 | %
967 | % dvips 模式下网址断字有问题, 请手工加载 \pkg{breakurl} 宏包解决之.
968 | %
969 | % 设置 url 样式, 与上下文一致
970 | % \begin{macrocode}
971 | \urlstyle{same}
972 | % \end{macrocode}
973 | %
974 | %
975 | % \subsection{页面设置}
976 | % \label{sec:layout}
977 | % 本来这部分应该是最容易设置的, 但根据格式规定出来的结果跟学校的 WORD 样例相差很
978 | % 大, 所以只能微调.
979 | %
980 | % \begin{macrocode}
981 | \RequirePackage{geometry}
982 | \geometry{
983 | a4paper,
984 | ignoreall,
985 | nomarginpar}
986 | \geometry{
987 | left=28mm,
988 | right=28mm,
989 | headheight=8mm,
990 | headsep=7mm,
991 | top=30mm,
992 | bottom=26mm,
993 | footskip=7mm}
994 | % \end{macrocode}
995 | %
996 | % 利用 \pkg{fancyhdr} 设置页眉页脚.
997 | % \begin{macrocode}
998 | \RequirePackage{fancyhdr}
999 | % \end{macrocode}
1000 | %
1001 | %
1002 | % \subsection{交叉引用}
1003 | % \label{sec:ref}
1004 | % \begin{macro}{\ref}
1005 | % \begin{macro}{\autoref}
1006 | % 交叉引用是 \LaTeX\ 中一种常用的自动化工具, 它的使用可以分成两个部分: 定义标签和
1007 | % 引用标签. \shuthesis\ 提供两种引用方式: \cs{ref}, \cs{autoref}. 命令 \cs{ref}
1008 | % 是 \LaTeX\ 自带的命令, 用法比较简单, 可定制性差. \cs{autoref} 由宏包 \pkg{hyperref}
1009 | % 提供, 功能强大, 定制性也比较好.
1010 | % \begin{macrocode}
1011 | \def\theoremautorefname{定理}
1012 | \def\lemmaautorefname{引理}
1013 | \def\definitionautorefname{定义}
1014 | \def\corollaryautorefname{推论}
1015 | \def\propositionautorefname{命题}
1016 | %
1017 | % \end{macrocode}
1018 | % \end{macro}
1019 | % \end{macro}
1020 | %
1021 | %
1022 | % \subsection{主文档格式}
1023 | % \label{sec:mainbody}
1024 | % \subsubsection{Three matters}
1025 | % \begin{macro}{\cleardoublepage}
1026 | % 对于 \textsl{openright} 选项, 必须保证章首页右开, 且如果前章末页无内容须
1027 | % 清空其页眉页脚.
1028 | % \begin{macrocode}
1029 | %<*cls>
1030 | \let\shu@cleardoublepage\cleardoublepage
1031 | \newcommand{\shu@clearemptydoublepage}{%
1032 | \clearpage{\pagestyle{shu@empty}\shu@cleardoublepage}}
1033 | \let\cleardoublepage\shu@clearemptydoublepage
1034 | % \end{macrocode}
1035 | % \end{macro}
1036 | %
1037 | % \begin{macro}{\frontmatter}
1038 | % \begin{macro}{\mainmatter}
1039 | % \begin{macro}{\backmatter}
1040 | % 重新定义 \cs{frontmatter}, \cs{mainmatter} 和 \cs{backmatter}.
1041 | % \begin{macrocode}
1042 | \renewcommand\frontmatter{%
1043 | \if@openright\cleardoublepage\else\clearpage\fi
1044 | \@mainmatterfalse
1045 | \pagenumbering{Roman}
1046 | \pagestyle{shu@empty}}
1047 | \renewcommand\mainmatter{%
1048 | \if@openright\cleardoublepage\else\clearpage\fi
1049 | \@mainmattertrue
1050 | \pagenumbering{arabic}
1051 | \pagestyle{shu@headings}}
1052 | \renewcommand\backmatter{%
1053 | \if@openright\cleardoublepage\else\clearpage\fi
1054 | \@mainmattertrue}
1055 | %
1056 | % \end{macrocode}
1057 | % \end{macro}
1058 | % \end{macro}
1059 | % \end{macro}
1060 | %
1061 | %
1062 | % \subsubsection{字体}
1063 | % \label{sec:font}
1064 | % \begin{macro}{\normalsize}
1065 | % 正文小四号 (12bp) 字, 行距为固定值 20 bp. 设置文字与公式的垂直距离.
1066 | % \begin{macrocode}
1067 | %<*cls>
1068 | \renewcommand\normalsize{%
1069 | \@setfontsize\normalsize{12bp}{20bp}%
1070 | \abovedisplayskip=13bp \@plus 2bp \@minus 2bp
1071 | \abovedisplayshortskip=13bp \@plus 2bp \@minus 2bp
1072 | \belowdisplayskip=\abovedisplayskip
1073 | \belowdisplayshortskip=\abovedisplayshortskip}
1074 | % \end{macrocode}
1075 | % \end{macro}
1076 | %
1077 | % WORD 中的字号对应该关系如下 (1bp = 72.27/72 pt):
1078 | % \begin{center}
1079 | % \begin{tabular}{llll}
1080 | % \toprule
1081 | % 初号 & 42bp & 14.82mm & 42.1575pt \\
1082 | % 小初 & 36bp & 12.70mm & 36.135 pt \\
1083 | % 一号 & 26bp & 9.17mm & 26.0975pt \\
1084 | % 小一 & 24bp & 8.47mm & 24.09pt \\
1085 | % 二号 & 22bp & 7.76mm & 22.0825pt \\
1086 | % 小二 & 18bp & 6.35mm & 18.0675pt \\
1087 | % 三号 & 16bp & 5.64mm & 16.06pt \\
1088 | % 小三 & 15bp & 5.29mm & 15.05625pt \\
1089 | % 四号 & 14bp & 4.94mm & 14.0525pt \\
1090 | % 小四 & 12bp & 4.23mm & 12.045pt \\
1091 | % 五号 & 10.5bp & 3.70mm & 10.59375pt \\
1092 | % 小五 & 9bp & 3.18mm & 9.03375pt \\
1093 | % 六号 & 7.5bp & 2.56mm & \\
1094 | % 小六 & 6.5bp & 2.29mm & \\
1095 | % 七号 & 5.5bp & 1.94mm & \\
1096 | % 八号 & 5bp & 1.76mm & \\\bottomrule
1097 | % \end{tabular}
1098 | % \end{center}
1099 | %
1100 | % \begin{macro}{\shu@def@fontsize}
1101 | % 根据习惯定义字号. 用法: \cs{shu@def@fontsize}\marg{字号名称}\marg{磅数}.
1102 | % 所有字号定义时为单倍行距, 并提供选项指定行距倍数.
1103 | % \begin{macrocode}
1104 | \def\shu@def@fontsize#1#2{%
1105 | \expandafter\newcommand\csname #1\endcsname[1][1.3]{%
1106 | \fontsize{#2}{##1\dimexpr #2}\selectfont}}
1107 | % \end{macrocode}
1108 | % \end{macro}
1109 | %
1110 | % \begin{macro}{\chuhao}
1111 | % \begin{macro}{\xiaochu}
1112 | % \begin{macro}{\yihao}
1113 | % \begin{macro}{\xiaoyi}
1114 | % \begin{macro}{\erhao}
1115 | % \begin{macro}{\xiaoer}
1116 | % \begin{macro}{\sanhao}
1117 | % \begin{macro}{\xiaosan}
1118 | % \begin{macro}{\sihao}
1119 | % \begin{macro}{\banxiaosi}
1120 | % \begin{macro}{\xiaosi}
1121 | % \begin{macro}{\dawu}
1122 | % \begin{macro}{...}
1123 | % 一组字号定义, 也可以使用 \texttt{ctex} 宏包的 \cs{zihao} 替代.
1124 | % \begin{macrocode}
1125 | \shu@def@fontsize{maxsize}{57bp}
1126 | \shu@def@fontsize{chuhao}{42bp}
1127 | \shu@def@fontsize{xiaochu}{36bp}
1128 | \shu@def@fontsize{yihao}{26bp}
1129 | \shu@def@fontsize{xiaoyi}{24bp}
1130 | \shu@def@fontsize{erhao}{22bp}
1131 | \shu@def@fontsize{xiaoer}{18bp}
1132 | \shu@def@fontsize{sanhao}{16bp}
1133 | \shu@def@fontsize{xiaosan}{15bp}
1134 | \shu@def@fontsize{sihao}{14bp}
1135 | \shu@def@fontsize{banxiaosi}{13bp}
1136 | \shu@def@fontsize{xiaosi}{12bp}
1137 | \shu@def@fontsize{dawu}{11bp}
1138 | \shu@def@fontsize{wuhao}{10.5bp}
1139 | \shu@def@fontsize{xiaowu}{9bp}
1140 | \shu@def@fontsize{liuhao}{7.5bp}
1141 | \shu@def@fontsize{xiaoliu}{6.5bp}
1142 | \shu@def@fontsize{qihao}{5.5bp}
1143 | \shu@def@fontsize{bahao}{5bp}
1144 | %
1145 | % \end{macrocode}
1146 | % \end{macro}
1147 | % \end{macro}
1148 | % \end{macro}
1149 | % \end{macro}
1150 | % \end{macro}
1151 | % \end{macro}
1152 | % \end{macro}
1153 | % \end{macro}
1154 | % \end{macro}
1155 | % \end{macro}
1156 | % \end{macro}
1157 | % \end{macro}
1158 | % \end{macro}
1159 | %
1160 | %
1161 | % \subsubsection{页眉页脚}
1162 | % \label{sec:headerfooter}
1163 | % 设置页眉和页脚.
1164 | % \begin{macro}{\ps@shu@empty}
1165 | % \begin{macro}{\ps@shu@plain}
1166 | % \begin{macro}{\ps@shu@headings}
1167 | %
1168 | % 定义三种页眉页脚格式:
1169 | % \begin{itemize}
1170 | % \item \texttt{shu@empty}: 页眉页脚都没有.
1171 | % \item \texttt{shu@plain}: 只显示页脚的页码. \cs{chapter} 自动调用
1172 | % \cs{thispagestyle\{shu@plain\}}.
1173 | % \item \texttt{shu@headings}: 页眉页脚同时显示.
1174 | % \end{itemize}
1175 | % \begin{macrocode}
1176 | %<*cls>
1177 | \fancypagestyle{shu@empty}{%
1178 | \fancyhf{}
1179 | \renewcommand{\headrulewidth}{0pt}
1180 | \renewcommand{\footrulewidth}{0pt}}
1181 | \fancypagestyle{shu@plain}{%
1182 | \fancyhead{}
1183 | \fancyfoot[C]{\xiaowu\thepage}
1184 | \renewcommand{\headrulewidth}{0pt}
1185 | \renewcommand{\footrulewidth}{0pt}}
1186 | \fancypagestyle{shu@headings}{%
1187 | \fancyhead{}
1188 | \fancyhead[CO]{\wuhao\kaishu\leftmark}
1189 | \fancyhead[CE]{\wuhao\kaishu 上海大学\shu@cdegree 学位论文}
1190 | \fancyfoot{}
1191 | \fancyfoot[C]{\wuhao\thepage}
1192 | \renewcommand{\headrulewidth}{0.4pt}
1193 | \renewcommand{\footrulewidth}{0pt}}
1194 | %
1195 | % \end{macrocode}
1196 | % \end{macro}
1197 | % \end{macro}
1198 | % \end{macro}
1199 | %
1200 | %
1201 | % \subsubsection{段落}
1202 | % \label{sec:paragraph}
1203 | % 全文首行缩进 2 字符.
1204 | % \begin{macrocode}
1205 | %<*cls>
1206 | \ctexset{%
1207 | space=auto,
1208 | autoindent=true}
1209 | % \end{macrocode}
1210 | %
1211 | % 利用 \pkg{enumitem} 命令调整默认列表环境间的距离, 以符合中文习惯.
1212 | % \begin{macrocode}
1213 | \setlist{nosep}
1214 | %
1215 | % \end{macrocode}
1216 | %
1217 | %
1218 | % \subsubsection{脚注}
1219 | % \label{sec:footnote}
1220 | % 脚注符合中文习惯, 数字带圈.
1221 | % \begin{macro}{\shu@textcircled}
1222 | % 生成带圈的脚注数字, 最多处理到 10.
1223 | % \begin{macrocode}
1224 | %<*cls>
1225 | \def\shu@textcircled#1{%
1226 | \ifnum\value{#1} >9
1227 | \ClassError{shuthesis}%
1228 | {Too many footnotes in this page.}{Keep footnote less than 10.}
1229 | \fi
1230 | \ifshu@pifootnote%
1231 | \ding{\the\numexpr\value{#1}+171\relax}%
1232 | \else%
1233 | \textcircled{\xiaoliu\arabic{#1}}%
1234 | \fi}
1235 | \renewcommand{\thefootnote}{\shu@textcircled{footnote}}
1236 | \renewcommand{\thempfootnote}{\shu@textcircled{mpfootnote}}
1237 | % \end{macrocode}
1238 | % \end{macro}
1239 | %
1240 | % 定义脚注分割线, 字号 (宋体小五), 以及悬挂缩进 (1.5字符).
1241 | % \begin{macrocode}
1242 | \def\footnoterule{\vskip-3\p@\hrule\@width0.3\textwidth\@height0.4\p@\vskip2.6\p@}
1243 | \let\shu@footnotesize\footnotesize
1244 | \renewcommand\footnotesize{\shu@footnotesize\xiaowu[1.5]}
1245 | \footnotemargin1.5em\relax
1246 | % \end{macrocode}
1247 | %
1248 | % \cs{@makefnmark} 默认是上标样式, 而在脚注部分要求为正文大小. 利用 \cs{patchcmd}
1249 | % 动态调整 \cs{@makefnmark} 的定义.
1250 | % \begin{macrocode}
1251 | \let\shu@makefnmark\@makefnmark
1252 | \def\shu@@makefnmark{\hbox{{\normalfont\@thefnmark}}}
1253 | \pretocmd{\@makefntext}{\let\@makefnmark\shu@@makefnmark}{}{}
1254 | \apptocmd{\@makefntext}{\let\@makefnmark\shu@makefnmark}{}{}
1255 | %
1256 | % \end{macrocode}
1257 | %
1258 | %
1259 | % \subsubsection{数学相关}
1260 | % \label{sec:equation}
1261 | % 允许太长的公式断行、分页等.
1262 | % \begin{macrocode}
1263 | %\allowdisplaybreaks[4]
1264 | % \end{macrocode}
1265 | %
1266 | % 公式随着章的不同而编号.
1267 | % \begin{macrocode}
1268 | %\numberwithin{equation}{chapter}
1269 | % \end{macrocode}
1270 | %
1271 | % 定义定理类环境, 包括定义、定理、引理以及推论等.
1272 | % \begin{macrocode}
1273 | %<*cfg>
1274 | \theoremheaderfont{\normalfont\bfseries}
1275 | \theoremstyle{plain}
1276 | \theoremsymbol{}
1277 | \theoremseparator{}
1278 | \newtheorem{assumption}{假设}[chapter]
1279 | \newtheorem{proposition}{命题}[chapter]
1280 | \newtheorem{lemma}{引理}[chapter]
1281 | \newtheorem{theorem}{定理}[chapter]
1282 | \newtheorem{axiom}{公理}[chapter]
1283 | \newtheorem{corollary}{推论}[chapter]
1284 | \newtheorem{exercise}{练习}[chapter]
1285 | \newtheorem{example}{例}[chapter]
1286 | \newtheorem{problem}{问题}[chapter]
1287 | \newtheorem{conjecture}{猜想}[chapter]
1288 | \theorembodyfont{\normalfont}
1289 | \newtheorem{definition}{定义}[chapter]
1290 | \newtheorem{remark}{注释}[chapter]
1291 | \theoremsymbol{\ensuremath{\square}}
1292 | \newtheorem*{proof}{证明:}
1293 | %
1294 | % \end{macrocode}
1295 | %
1296 | % \subsubsection{浮动对象以及表格}
1297 | % \label{sec:float}
1298 | % 设置浮动对象和文字之间的距离
1299 | % \begin{macrocode}
1300 | %<*cls>
1301 | \setlength{\floatsep}{20bp \@plus4pt \@minus1pt}
1302 | \setlength{\intextsep}{20bp \@plus4pt \@minus2pt}
1303 | \setlength{\textfloatsep}{20bp \@plus4pt \@minus2pt}
1304 | \setlength{\@fptop}{0bp \@plus1.0fil}
1305 | \setlength{\@fpsep}{12bp \@plus2.0fil}
1306 | \setlength{\@fpbot}{0bp \@plus1.0fil}
1307 | % \end{macrocode}
1308 | %
1309 | % 下面这组命令使浮动对象的缺省值稍微宽松一点, 从而防止幅度对象占据过多的文本页面,
1310 | % 也可以防止在很大空白的浮动页上放置很小的图形.
1311 | % \begin{macrocode}
1312 | \renewcommand{\textfraction}{0.15}
1313 | \renewcommand{\topfraction}{0.85}
1314 | \renewcommand{\bottomfraction}{0.65}
1315 | \renewcommand{\floatpagefraction}{0.60}
1316 | % \end{macrocode}
1317 | %
1318 | % 定制浮动图形和表格标题样式
1319 | % \begin{itemize}
1320 | % \item 图表标题字体为 11pt, 这里写作大五号
1321 | % \item 去掉图表号后面的冒号. 图序与图名文字之间空一个汉字符宽度。
1322 | % \item 图:caption 在下, 段前空 6 磅, 段后空 12 磅
1323 | % \item 表:caption 在上, 段前空 12 磅, 段后空 6 磅
1324 | % \end{itemize}
1325 | %
1326 | % \begin{macrocode}
1327 | \let\old@tabular\@tabular
1328 | \def\shu@tabular{\dawu[1.5]\old@tabular}
1329 | \DeclareCaptionLabelFormat{shu}{{\dawu[1.5]\heiti #1~\rmfamily #2}}
1330 | \DeclareCaptionLabelSeparator{shu}{\hspace{1em}}
1331 | \DeclareCaptionFont{shu}{\dawu[1.5]}
1332 | \captionsetup{labelformat=shu,labelsep=shu,font=shu}
1333 | \captionsetup[table]{position=top,belowskip={12bp-\intextsep},aboveskip=6bp}
1334 | \captionsetup[figure]{position=bottom,belowskip={12bp-\intextsep},aboveskip=6bp}
1335 | \captionsetup[sub]{font=shu,skip=6bp}
1336 | \renewcommand{\thesubfigure}{(\alph{subfigure})}
1337 | \renewcommand{\thesubtable}{(\alph{subtable})}
1338 | %\renewcommand{\p@subfigure}{:}
1339 | % \end{macrocode}
1340 | %
1341 | % 我们采用 \pkg{longtable} 来处理跨页的表格. 同样我们需要设置其默认字体为五号.
1342 | %
1343 | % \begin{macrocode}
1344 | \let\shu@LT@array\LT@array
1345 | \def\LT@array{\dawu[1.5]\shu@LT@array} % set default font size
1346 | %
1347 | % \end{macrocode}
1348 | %
1349 | %
1350 | % \subsubsection{章节标题}
1351 | % \label{sec:theor}
1352 | % \begin{macrocode}
1353 | %<*cfg>
1354 | \ctexset{%
1355 | chapter/name={第,章},
1356 | appendixname=附录,
1357 | contentsname={目\hspace{\ccwd}录},
1358 | listfigurename={插图索引},
1359 | listtablename={表格索引},
1360 | figurename={图},
1361 | tablename={表},
1362 | bibname={参考文献},
1363 | indexname={索引},
1364 | }
1365 | \newcommand\equationname{公式}
1366 | \newcommand{\cabstractname}{摘\hspace{\ccwd}要}
1367 | \newcommand{\eabstractname}{ABSTRACT}
1368 | \let\CJK@todaysave=\today
1369 | \def\CJK@todaysmall{\the\year 年 \the\month 月}
1370 | \def\CJK@todaybig{\zhdigits{\the\year}年\zhnumber{\the\month}月}
1371 | \def\CJK@today{\CJK@todaysmall}
1372 | \renewcommand\today{\CJK@today}
1373 | \newcommand\CJKtoday[1][1]{%
1374 | \ifcase#1\def\CJK@today{\CJK@todaysave}
1375 | \or\def\CJK@today{\CJK@todaysmall}
1376 | \or\def\CJK@today{\CJK@todaybig}
1377 | \fi}
1378 | %
1379 | % \end{macrocode}
1380 | %
1381 | % 如果章节题目中的英文要使用 arial, 那么就加上 \cs{sffamily}.
1382 | % \begin{macrocode}
1383 | %<*cls>
1384 | \def\shu@title@font{%
1385 | \ifshu@arialtitle\sffamily\else\relax\fi}
1386 | % \end{macrocode}
1387 | %
1388 | % \pkg{fancyhdr} 定义页眉页脚很方便, 但是有一个非常隐蔽的坑. 通过 \pkg{fancyhdr}
1389 | % 定义的样式在第一次被调用时会修改 \cs{chaptermark}, 这会导致页眉信息错误 (多余
1390 | % 章号并且英文大写). 这是因为在原始的 \file{book.cls} 中定义如下 (大意):
1391 | % \begin{latex}
1392 | % \newcommand\chaptername{Chapter}
1393 | % \newcommand\@chapapp{\chaptername}
1394 | % \def\chaptermark#1{
1395 | % \markboth{\MakeUppercase{\@chapapp\ \thechapter}}{}}
1396 | % \end{latex}
1397 | % 很显然这个 \cs{\@chapapp} 不适合中文, 因此我们使用 \cs{CTEXthechapter}
1398 | % (如, ``第 x 章"), 同时会将 \cs{MakeUppercase} 去掉. 也就是说我们会做如下动作:
1399 | % \begin{latex}
1400 | % \renewcommand{\chaptermark}[1]{\@mkboth{\CTEXthechapter\hskip\ccwd#1}{}}
1401 | % \end{latex}
1402 | % 但是, \pkg{fancyhdr} 不知何故在 \cs{ps@fancy} 中对 \cs{chaptermark} 进行重定义,
1403 | % 而这个 \cs{ps@fancy} 会在 \cs{fancypagestyle} 中使用, 如下:
1404 | % \begin{latex}
1405 | % \newcommand{\fancypagestyle}[2]{%
1406 | % \@namedef{ps@#1}{\let\fancy@gbl\relax#2\relax\ps@fancy}}
1407 | % \end{latex}
1408 | % 这样的话, \cs{ps@fancy} 会在 \pkg{fancyhdr} 定义的任何样式首次样被激活时调用, 从
1409 | % 而覆盖我们的 \cs{chaptermark} 定义 (后续样式再激活不会重复覆盖). 所以我们采用如下
1410 | % 方法解决:
1411 | % \begin{macrocode}
1412 | \AtBeginDocument{%
1413 | \pagestyle{shu@empty}
1414 | \renewcommand{\chaptermark}[1]{\@mkboth{\CTEXthechapter\hskip\ccwd#1}{}}}
1415 | % \end{macrocode}
1416 | %
1417 | % 各级标题格式设置.
1418 | % \begin{description}
1419 | % \item[chapter] 章序号与章名之间空一个汉字符 黑体小二号字, 居中书写, 单倍行距,
1420 | % 段前空 24 磅, 段后空 18 磅.
1421 | %
1422 | % \item[section] 一级节标题, 例如: \fbox{3.1 本文主要结论以及证明}. 节标题序号
1423 | % 与标题名之间空一个汉字符. 采用黑体三号 (16pt) 字居左书写, 行距为固定值 20 磅,
1424 | % 段前空 24 磅, 段后空 6 磅.
1425 | %
1426 | % \item[subsection] 二级节标题, 例如: \fbox{3.1.1 主要结论}. 采用黑体小四号 (12pt)
1427 | % 字居左书写, 行距为固定值 20 磅, 段前空 12 磅, 段后空 6 磅.
1428 | %
1429 | % \item[subsubsection] 三级节标题, 例如: \fbox{3.1.2.1 主要结论的证明}. 采用黑体
1430 | % 小四号字居左书写, 行距为固定值 20 磅, 段前空 12 磅, 段后空 6 磅.
1431 | % \end{description}
1432 | %
1433 | % \begin{macrocode}
1434 | \newcommand\shu@chapter@titleformat[1]{%
1435 | \ifthenelse%
1436 | {\equal{#1}{\eabstractname}}%
1437 | {\bfseries #1}%
1438 | {#1}%
1439 | }
1440 | \ctexset{%
1441 | chapter={
1442 | afterindent=true,
1443 | pagestyle={shu@headings},
1444 | beforeskip={9bp},
1445 | aftername=\hskip\ccwd,
1446 | afterskip={24bp},
1447 | format={\centering\shu@title@font\heiti\xiaoer[1]},
1448 | nameformat=\relax,
1449 | number=\chinese{chapter},
1450 | numberformat=\relax,
1451 | titleformat=\shu@chapter@titleformat,
1452 | },
1453 | section={
1454 | afterindent=true,
1455 | beforeskip={24bp\@plus 1ex \@minus .2ex},
1456 | afterskip={6bp\@plus .2ex},
1457 | format={\shu@title@font\heiti\sanhao[1.4]},
1458 | },
1459 | subsection={
1460 | afterindent=true,
1461 | beforeskip={16bp\@plus 1ex \@minus .2ex},
1462 | afterskip={6bp \@plus .2ex},
1463 | format={\shu@title@font\heiti\sihao[1.5]},
1464 | },
1465 | subsubsection={
1466 | afterindent=true,
1467 | beforeskip={16bp\@plus 1ex \@minus .2ex},
1468 | afterskip={6bp \@plus .2ex},
1469 | format={\csname shu@title@font\endcsname\heiti\sihao[1.6]},
1470 | },
1471 | paragraph/afterindent=true,
1472 | subparagraph/afterindent=true}
1473 | % \end{macrocode}
1474 | %
1475 | % \begin{macro}{\shu@chapter*}
1476 | % \cs{shu@chapter*}\oarg{tocline}\marg{title}\oarg{header}: tocline 是出现在
1477 | % 目录中的条目, 如果为空则此 chapter 不出现在目录中, 如果省略表示目录出现 title;
1478 | % title 是章标题; header 是页眉出现的标题, 如果忽略则取 title.
1479 | % \begin{macrocode}
1480 | \newcounter{shu@bookmark}
1481 | \NewDocumentCommand\shu@chapter{s o m o}{
1482 | \IfBooleanF{#1}{%
1483 | \ClassError{shuthesis}{You have to use the star form: \string\shu@chapter*}{}
1484 | }%
1485 | \if@openright\cleardoublepage\else\clearpage\fi\phantomsection%
1486 | \IfValueTF{#2}{%
1487 | \ifthenelse{\equal{#2}{}}{%
1488 | \addtocounter{shu@bookmark}\@ne
1489 | \pdfbookmark[0]{#3}{shuchapter.\theshu@bookmark}
1490 | }{%
1491 | \addcontentsline{toc}{chapter}{#3}
1492 | }
1493 | }{%
1494 | \addcontentsline{toc}{chapter}{#3}
1495 | }%
1496 | \chapter*{#3}%
1497 | \IfValueTF{#4}{%
1498 | \ifthenelse{\equal{#4}{}}
1499 | {\@mkboth{}{}}
1500 | {\@mkboth{#4}{#4}}
1501 | }{%
1502 | \@mkboth{#3}{#3}
1503 | }
1504 | }
1505 | %
1506 | % \end{macrocode}
1507 | % \end{macro}
1508 | %
1509 | %
1510 | % \subsubsection{目录}
1511 | % \label{sec:toc}
1512 | % 最多 4 层, 即: x.x.x.x, 对应的命令和层序号分别是:
1513 | % \cs{chapter}(0), \cs{section}(1), \cs{subsection}(2), \cs{subsubsection}(3).
1514 | % \begin{macrocode}
1515 | %<*cls>
1516 | \setcounter{secnumdepth}{3}
1517 | \setcounter{tocdepth}{2}
1518 | % \end{macrocode}
1519 | %
1520 | % \begin{macro}{\tableofcontents}
1521 | % 调整目录样式.
1522 | % \begin{macrocode}
1523 | \def\@pnumwidth{2em}
1524 | \def\@tocrmarg{\@pnumwidth}
1525 | \def\@dotsep{1}
1526 | \patchcmd{\@dottedtocline}{#4}{\csname shu@toc@font\endcsname #4}{}{}
1527 | \patchcmd{\@dottedtocline}{\hb@xt@\@pnumwidth}{\hbox}{}{}
1528 | \renewcommand*\l@chapter[2]{%
1529 | \ifnum \c@tocdepth >\m@ne
1530 | \addpenalty{-\@highpenalty}%
1531 | \vskip 4bp \@plus\p@
1532 | \setlength\@tempdima{3.7em}%
1533 | \begingroup
1534 | \parindent \z@ \rightskip \@pnumwidth
1535 | \parfillskip -\@pnumwidth
1536 | \leavevmode
1537 | \advance\leftskip\@tempdima
1538 | \hskip -\leftskip
1539 | % numberline is called here, and it uses \@tempdima
1540 | {\csname shu@toc@font\endcsname\heiti #1}
1541 | \leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill
1542 | \nobreak{\normalfont\normalcolor #2}\par
1543 | \penalty\@highpenalty
1544 | \endgroup
1545 | \fi}
1546 | %
1547 | % \end{macrocode}
1548 | % \end{macro}
1549 | %
1550 | %
1551 | % \subsubsection{封面和封底}
1552 | % \label{sec:cover}
1553 | % \begin{macro}{\shu@def@term}
1554 | % 定义封面的一些替换命令.
1555 | % \begin{macrocode}
1556 | %<*cls>
1557 | \def\shu@def@term#1{%
1558 | \define@key{shu}{#1}{\csname #1\endcsname{##1}}
1559 | \expandafter\gdef\csname #1\endcsname##1{%
1560 | \expandafter\gdef\csname shu@#1\endcsname{##1}}
1561 | \csname #1\endcsname{}}
1562 | % \end{macrocode}
1563 | % \end{macro}
1564 | %
1565 | % \begin{macro}{\secretlevel}
1566 | % \begin{macro}{\secretyear}
1567 | % 定义密级参数.
1568 | % \begin{macrocode}
1569 | \shu@def@term{secretlevel}
1570 | \shu@def@term{secretyear}
1571 | % \end{macrocode}
1572 | % \end{macro}
1573 | % \end{macro}
1574 | %
1575 | % \begin{macro}{\id}
1576 | % \begin{macro}{\catalognumber}
1577 | %
1578 | % 学号、中图分类号.
1579 | % \begin{macrocode}
1580 | \shu@def@term{id}
1581 | \shu@def@term{catalognumber}
1582 | % \end{macrocode}
1583 | % \end{macro}
1584 | % \end{macro}
1585 | %
1586 | % \begin{macro}{\cauthor}
1587 | % \begin{macro}{\eauthor}
1588 | % 作者姓名.
1589 | % \begin{macrocode}
1590 | \shu@def@term{cauthor}
1591 | \shu@def@term{eauthor}
1592 | % \end{macrocode}
1593 | % \end{macro}
1594 | % \end{macro}
1595 | %
1596 | % \begin{macro}{\csupervisor}
1597 | % \begin{macro}{\esupervisor}
1598 | % 导师姓名.
1599 | % \begin{macrocode}
1600 | \shu@def@term{csupervisor}
1601 | \shu@def@term{esupervisor}
1602 | % \end{macrocode}
1603 | % \end{macro}
1604 | % \end{macro}
1605 | %
1606 | % \begin{macro}{\ctitle}
1607 | % \begin{macro}{\etitle}
1608 | % 论文中英文题目.
1609 | % \begin{macrocode}
1610 | \shu@def@term{ctitle}
1611 | \shu@def@term{etitle}
1612 | % \end{macrocode}
1613 | % \end{macro}
1614 | % \end{macro}
1615 | %
1616 | % \begin{macro}{\cdepartment}
1617 | % \begin{macro}{\edepartment}
1618 | % 院系名称.
1619 | % \begin{macrocode}
1620 | \shu@def@term{cdepartment}
1621 | \shu@def@term{edepartment}
1622 | % \end{macrocode}
1623 | % \end{macro}
1624 | % \end{macro}
1625 | %
1626 | % \begin{macro}{\cmajor}
1627 | % \begin{macro}{\emajor}
1628 | % 所学专业名称.
1629 | % \begin{macrocode}
1630 | \shu@def@term{cmajor}
1631 | \shu@def@term{emajor}
1632 | % \end{macrocode}
1633 | % \end{macro}
1634 | % \end{macro}
1635 | %
1636 | % \begin{macro}{\cdisciplines}
1637 | % \begin{macro}{\edisciplines}
1638 | % 学科分类.
1639 | % \begin{macrocode}
1640 | \shu@def@term{cdisciplines}
1641 | \shu@def@term{edisciplines}
1642 | % \end{macrocode}
1643 | % \end{macro}
1644 | % \end{macro}
1645 | %
1646 | % \begin{macro}{\cdate}
1647 | % \begin{macro}{\edate}
1648 | % \begin{macro}{\coverdate}
1649 | % 论文成文日期.
1650 | % \begin{macrocode}
1651 | \shu@def@term{cdate}
1652 | \shu@def@term{edate}
1653 | \shu@def@term{coverdate}
1654 | % \end{macrocode}
1655 | % \end{macro}
1656 | % \end{macro}
1657 | % \end{macro}
1658 | %
1659 | % \begin{environment}{cabstract}
1660 | % \begin{environment}{eabstract}
1661 | %
1662 | % 摘要以环境的形式出现.
1663 | % \begin{macrocode}
1664 | \newcommand{\shu@@cabstract}[1]{\long\gdef\shu@cabstract{#1}}
1665 | \newenvironment{cabstract}{\Collect@Body\shu@@cabstract}{}
1666 | \newcommand{\shu@@eabstract}[1]{\long\gdef\shu@eabstract{#1}}
1667 | \newenvironment{eabstract}{\Collect@Body\shu@@eabstract}{}
1668 | % \end{macrocode}
1669 | % \end{environment}
1670 | % \end{environment}
1671 | %
1672 | % \begin{macro}{\shu@parse@keywords}
1673 | %
1674 | % 不同论文格式关键词之间的分割不太相同, 我们用 \cs{ckeywords} 和
1675 | % \cs{ekeywords} 来收集关键词列表, 然后用本命令来生成符合要求的格式.
1676 | % \begin{macrocode}
1677 | \def\shu@parse@keywords#1{
1678 | \define@key{shu}{#1}{\csname #1\endcsname{##1}}
1679 | \expandafter\gdef\csname shu@#1\endcsname{}
1680 | \expandafter\gdef\csname #1\endcsname##1{
1681 | \@for\reserved@a:=##1\do{
1682 | \expandafter\ifx\csname shu@#1\endcsname\@empty\else
1683 | \expandafter\g@addto@macro\csname shu@#1\endcsname{%
1684 | \ignorespaces\csname shu@keywords@separator\endcsname}
1685 | \fi
1686 | \expandafter\expandafter\expandafter\g@addto@macro%
1687 | \expandafter\csname shu@#1\expandafter\endcsname\expandafter{\reserved@a}
1688 | }
1689 | }
1690 | }
1691 | % \end{macrocode}
1692 | % \end{macro}
1693 | %
1694 | % \begin{macro}{\ckeywords}
1695 | % \begin{macro}{\ekeywords}
1696 | %
1697 | % 利用 \cs{shu@parse@keywords} 来定义, 内部通过 \cs{shu@ckeywords} 和
1698 | % \cs{shu@ekeywords} 来引用.
1699 | % \begin{macrocode}
1700 | \shu@parse@keywords{ckeywords}
1701 | \shu@parse@keywords{ekeywords}
1702 | %
1703 | % \end{macrocode}
1704 | % \end{macro}
1705 | % \end{macro}
1706 | %
1707 | % \begin{macro}{\shusetup}
1708 | %
1709 | % 封面和封底有一大堆信息需要设置, 为了简化操作界面, 提供一个 \cs{shusetup} 命令
1710 | % 支持 key/value 的方式来设置. key 就是前面各个设置项的名字.
1711 | %
1712 | % \note[说明:]{只能设置普通项, 不支持环境项, 如 \texttt{cabstract} 和
1713 | % \texttt{eabstract}.}
1714 | %
1715 | % \begin{macrocode}
1716 | %\def\shusetup{\kvsetkeys{shu}}
1717 | % \end{macrocode}
1718 | % \end{macro}
1719 | %
1720 | % 定义封面用到的部分文字.
1721 | % \begin{macrocode}
1722 | %<*cfg>
1723 | \def\shu@keywords@separator{;}
1724 | \def\shu@secretyear{\the\year}
1725 | \def\shu@secret@content{%
1726 | \unskip~$\bigstar$ %
1727 | \shu@secretyear~年}
1728 | \def\shu@cdegree{\ifshu@doctor 博士\else 硕士\fi}
1729 | \def\shu@edegree{\ifshu@doctor Doctor\else Master\fi}
1730 | \cdate{\CJK@todaybig}
1731 | \edate{\ifcase \month \or January\or February\or March\or April\or May%
1732 | \or June\or July \or August\or September\or October\or November
1733 | \or December\fi\unskip,\ \ \the\year}
1734 | \newcommand{\shu@ckeywords@title}{关键词:}
1735 | %
1736 | % \end{macrocode}
1737 | %
1738 | %
1739 | % \myentry{封面第一页}
1740 | % \begin{macro}{\shu@first@page}
1741 | % \begin{macrocode}
1742 | %<*cls>
1743 | \def\shu@first@page{\renewcommand{\ULthickness}{1.8pt}%
1744 | {\noindent\ifxetex\XBSong\else\bfseries\songti\fi%
1745 | 中图分类号:{\bfseries\shu@catalognumber}\hfill 单位代号:{\bfseries 10280\hphantom{000}}\\
1746 | 密\hphantom{空白空}级:\expandafter\ifshu@secret\shu@secret@content\else%
1747 | \shu@secretlevel\fi\hfill 学\hphantom{空白}号:{\bfseries\shu@id}}
1748 | \par\vskip1mm
1749 | \noindent\uline{\hspace{105mm}}\par\vskip2mm
1750 | \ifshu@nocolor
1751 | \raisebox{1ex}[0pt][0pt]{
1752 | \includegraphics[height=3cm,width=9.8cm]{shublack.pdf}}\hskip5mm
1753 | \includegraphics[height=3.3cm,width=2.7cm]{shulogoblack.pdf}
1754 | \else
1755 | \raisebox{1ex}[0pt][0pt]{
1756 | \includegraphics[height=3cm,width=9.8cm]{shu.pdf}}\hskip5mm
1757 | \includegraphics[height=3.3cm,width=2.7cm]{shulogo.pdf}\fi\par\vskip5mm
1758 | \hskip3mm{\maxsize\ifxetex\LanTingHei\else\bfseries\heiti\fi\shu@cdegree 学位论文}
1759 | \par\vskip-1mm
1760 | \noindent\uline{\hskip143mm}\par\vskip1mm
1761 | {\zihao{-1}\bfseries
1762 | \centerline{SHANGHAI~~UNIVERSITY}
1763 | \centerline{\MakeUppercase{\shu@edegree}'S~~DISSERTATION}}
1764 | \begin{center}
1765 | \tabulinesep=_5mm^5mm
1766 | \arrayrulewidth=1pt
1767 | \begin{tabu} to 0.9\textwidth{|X[1,c,m]|X[11,c,m]|}
1768 | \hline
1769 | \zihao{-2}\ifxetex\HanYikai\else\bfseries\kaishu\fi\makecell{题\\ 目} &
1770 | \erhao[1.4]\bfseries\ifxetex\LanTingHei\else\heiti\fi\tabulinesep=_1.5mm^1.5mm
1771 | \begin{tabu}{X[c,m]}
1772 | \shu@ctitle
1773 | \end{tabu}\\\hline
1774 | \end{tabu}
1775 | \end{center}
1776 | \vfill\renewcommand{\ULthickness}{1pt}
1777 | \begin{center}
1778 | {\heiti\xiaoer[1.9]
1779 | \begin{tabular}{cl}
1780 | 作\hphantom{空白}者 & \uline{\kaishu\makebox[55mm]{\shu@cauthor}}\\
1781 | 学科专业 & \uline{\kaishu\makebox[55mm]{\shu@cmajor}}\\
1782 | 导\hphantom{空白}师 & \uline{\kaishu\makebox[55mm]{\shu@csupervisor}}\\
1783 | 完成日期 & \uline{\kaishu\makebox[55mm]{\shu@coverdate}}\\
1784 | \end{tabular}}
1785 | \end{center}
1786 | \if@openright\cleardoublepage\else\clearpage\fi}
1787 | % \end{macrocode}
1788 | % \end{macro}
1789 | %
1790 | % 论文封面第一页.
1791 | % \begin{macrocode}
1792 | \newcommand{\makefirstpage}{
1793 | \newgeometry{left=3.5cm,right=3.5cm,top=3cm,bottom=3.5cm}
1794 | \shu@first@page
1795 | \restoregeometry}
1796 | %
1797 | % \end{macrocode}
1798 | %
1799 | % \myentry{答辩委员签名}
1800 | % \begin{macro}{\shu@committee}
1801 | % \begin{macrocode}
1802 | %<*cls>
1803 | \newcommand{\shu@committee}{
1804 | \noindent\centerline{\zihao{2} 上海大学} \par
1805 | \vskip1.5cm
1806 | \erhao[1.5] 本论文经答辩委员会全体委员审查,
1807 | 确认符合上海大学博士学位论文质量要求。\par
1808 | \vskip3.9cm
1809 | \zihao{-2} 答辩委员会签名:\par
1810 | \vskip1cm
1811 | 主席:\par
1812 | \vskip1cm
1813 | 委员:\par
1814 | \vskip6cm
1815 | 导\hphantom{空白}师:\par
1816 | \vskip1cm
1817 | 答辩日期:
1818 | \if@openright\cleardoublepage\else\clearpage\fi
1819 | }
1820 | %
1821 | % \end{macrocode}
1822 | % \end{macro}
1823 | %
1824 | % \myentry{原创性声明}
1825 | % \begin{macro}{\shu@authordeclare}
1826 | % \begin{macrocode}
1827 | %<*cls>
1828 | \newcommand{\shu@authordeclare}{%
1829 | \begin{center}
1830 | \zihao{2}\ifxetex\XBSong\else\bfseries\songti\fi 原创性声明
1831 | \end{center}
1832 | \par\vskip1cm\sihao[1.7]
1833 | 本人声明:所呈交的论文是本人在导师指导下进行的研究工作。
1834 | 除了文中特别加以标注和致谢的地方外,论文中不包含其他人已发表或撰写过
1835 | 的研究成果。参与同一工作的其他同志对本研究所做的任何贡献均已在论文中
1836 | 作了明确的说明并表示了谢意。
1837 | \vskip2.3cm
1838 | \hfill 签名: \underline{\hskip3cm}
1839 | 日期: \underline{\hskip3cm}\\
1840 | \vskip2.5cm
1841 | \begin{center}
1842 | \zihao{2}\ifxetex\XBSong\else\bfseries\songti\fi 本论文使用授权说明
1843 | \end{center}
1844 | \par\vskip1.1cm
1845 | 本人完全了解上海大学有关保留、使用学位论文的规定。即:学校有权保留论文
1846 | 及送交论文复印件,允许论文被查阅和借阅;学校可以公布论文的全部或部分内容。\par
1847 | ({\ifxetex\XBSong\else\bfseries\songti\fi 保密的论文在解密后应遵守此规定})
1848 | \vskip1.5cm
1849 | \noindent\hfill 签名: \underline{\hskip2.7cm}
1850 | 导师签名: \underline{\hskip2.7cm}
1851 | 日期: \underline{\hskip2.7cm}\hfill
1852 | \if@openright\cleardoublepage\else\clearpage\fi}
1853 | %
1854 | % \end{macrocode}
1855 | % \end{macro}
1856 | %
1857 | % \myentry{中文题页}
1858 | % \begin{macro}{\shu@cncover}
1859 | % \begin{macrocode}
1860 | %<*cls>
1861 | \newcommand{\shu@cncover}{%
1862 | \vspace*{1.3cm}
1863 | \centerline{\zihao{2} 上海大学\shu@cdisciplines\shu@cdegree 学位论文}
1864 | \vskip3.5cm
1865 | \begin{center}\yihao[1.5]{\bfseries{\shu@ctitle}}\end{center}
1866 | \vskip3.5cm
1867 | \begin{center}\xiaoer[1.8]
1868 | \begin{tabular}{cl}
1869 | 作\hphantom{空白}者: & \kaishu\shu@cauthor\\
1870 | 导\hphantom{空白}师: & \kaishu\shu@csupervisor\\
1871 | 学科专业: & \kaishu\shu@cmajor\\
1872 | \end{tabular}
1873 | \end{center}
1874 | \vskip3.5cm
1875 | \begin{center}
1876 | \sanhao[1.6]\shu@cdepartment\\
1877 | 上海大学\\
1878 | \shu@cdate
1879 | \end{center}
1880 | \if@openright\cleardoublepage\else\clearpage\fi}
1881 | %
1882 | % \end{macrocode}
1883 | % \end{macro}
1884 | %
1885 | % \myentry{英文题页}
1886 | % \begin{macro}{\shu@engcover}
1887 | % \begin{macrocode}
1888 | %<*cls>
1889 | \newcommand{\shu@engcover}{%
1890 | \vspace*{.5cm}
1891 | \begin{center}
1892 | \sanhao[1.6] A Dissertation Submitted to Shanghai University
1893 | for the \\ Degree of \shu@edegree~in \shu@edisciplines\par
1894 | \vskip3cm
1895 | \begin{center}\zihao{1}{\bfseries{\shu@etitle}}\end{center}
1896 | \vskip4cm
1897 | \begin{tabular}{rl}
1898 | Candidate: & \shu@eauthor\\
1899 | Supervisor: & \shu@esupervisor\\
1900 | Major: & \shu@emajor\\
1901 | \end{tabular}
1902 | \vskip4cm
1903 | \bfseries\shu@edepartment\\
1904 | Shanghai University\\
1905 | \shu@edate
1906 | \end{center}
1907 | \if@openright\cleardoublepage\else\clearpage\fi}
1908 | % \end{macrocode}
1909 | % \end{macro}
1910 | %
1911 | % \begin{macro}{\makecover}
1912 | % 生成封面总命令
1913 | % \begin{macrocode}
1914 | \def\makecover{\shu@setup@pdfinfo\shu@makecover}
1915 | \def\shu@setup@pdfinfo{
1916 | \hypersetup{
1917 | pdftitle={\shu@ctitle},
1918 | pdfauthor={\shu@cauthor},
1919 | pdfsubject={\shu@cdegree},
1920 | pdfkeywords={\shu@ckeywords},
1921 | pdfcreator={\shuthesis-v\version}}}
1922 | \newcommand{\shu@makecover}{
1923 | \phantomsection
1924 | \pdfbookmark[-1]{\shu@ctitle}{ctitle}
1925 | \normalsize
1926 | % \end{macrocode}
1927 | %
1928 | % 答辩委员签名
1929 | % \begin{macrocode}
1930 | \shu@committee
1931 | % \end{macrocode}
1932 | %
1933 | % 原创性声明
1934 | % \begin{macrocode}
1935 | \shu@authordeclare
1936 | % \end{macrocode}
1937 | %
1938 | % 中文题页
1939 | % \begin{macrocode}
1940 | \shu@cncover
1941 | % \end{macrocode}
1942 | %
1943 | % 英文题页
1944 | % \begin{macrocode}
1945 | \shu@engcover
1946 | % \end{macrocode}
1947 | %
1948 | % 中英文摘要
1949 | % \begin{macrocode}
1950 | \normalsize
1951 | \shu@makeabstract
1952 | \let\@tabular\shu@tabular
1953 | \if@openright\cleardoublepage\else\clearpage\fi}
1954 | %
1955 | % \end{macrocode}
1956 | % \end{macro}
1957 | %
1958 | %
1959 | % \subsubsection{摘要}
1960 | % \label{sec:abstractformat}
1961 | %
1962 | % \begin{macro}{\shu@put@keywords}
1963 | %
1964 | % 排版关键字.
1965 | % \begin{macrocode}
1966 | %<*cls>
1967 | \newbox\shu@kw
1968 | \newcommand\shu@put@keywords[2]{%
1969 | \begingroup
1970 | \setbox\shu@kw=\hbox{#1}
1971 | \noindent\hangindent\wd\shu@kw\hangafter1%
1972 | \box\shu@kw#2\par
1973 | \endgroup}
1974 | % \end{macrocode}
1975 | % \end{macro}
1976 | %
1977 | % \begin{macro}{\shu@makeabstract}
1978 | %
1979 | % 中文摘要部分的标题为\textbf{摘要}, 用黑体小二号字.
1980 | % \begin{macrocode}
1981 | \newcommand{\shu@makeabstract}{%
1982 | \shu@chapter*[]{\cabstractname}
1983 | \pagestyle{shu@headings}
1984 | \pagenumbering{Roman}
1985 | % \end{macrocode}
1986 | %
1987 | % 摘要内容用小四号字书写, 两端对齐, 汉字用宋体, 外文字用 Times New Roman 体.
1988 | % \begin{macrocode}
1989 | \shu@cabstract
1990 | % \end{macrocode}
1991 | %
1992 | % 每个关键词之间空两个汉字符宽度, 且为悬挂缩进.
1993 | % \begin{macrocode}
1994 | \vskip12bp
1995 | \shu@put@keywords{\heiti\shu@ckeywords@title\enskip}{\shu@ckeywords}
1996 | % \end{macrocode}
1997 | %
1998 | % 英文摘要部分的标题为 \textbf{Abstract}, 用 Arial 体小二号字.
1999 | % \begin{macrocode}
2000 | \shu@chapter*[]{\eabstractname}
2001 | % \end{macrocode}
2002 | %
2003 | % 摘要内容用小四号 Times New Roman.
2004 | % \begin{macrocode}
2005 | \shu@eabstract
2006 | % \end{macrocode}
2007 | %
2008 | % 每个关键词之间空四个英文字符宽度.
2009 | % \begin{macrocode}
2010 | \vskip12bp
2011 | \shu@put@keywords{%
2012 | \textbf{Keywords}:\enskip}{\shu@ekeywords}}
2013 | %
2014 | % \end{macrocode}
2015 | % \end{macro}
2016 | %
2017 | %
2018 | % \subsubsection{主要符号表}
2019 | % \label{sec:denotationfmt}
2020 | % \begin{environment}{denotation}
2021 | %
2022 | % 主要符号对照表.
2023 | % \begin{macrocode}
2024 | %\newcommand{\shu@denotation@name}{主要符号对照表}
2025 | %<*cls>
2026 | \newenvironment{denotation}[1][2.5cm]{%
2027 | \shu@chapter*[]{\shu@denotation@name} % no tocline
2028 | \vskip-30bp\xiaosi[1.6]\begin{shu@denotation}[labelwidth=#1]
2029 | }{%
2030 | \end{shu@denotation}
2031 | }
2032 | \newlist{shu@denotation}{description}{1}
2033 | \setlist[shu@denotation]{%
2034 | nosep,
2035 | font=\normalfont,
2036 | align=left,
2037 | leftmargin=5cm,
2038 | rightmargin=2.5cm,
2039 | labelindent=0pt,
2040 | labelwidth=2.5cm,
2041 | labelsep*=0.5cm,
2042 | itemindent=0pt,
2043 | }
2044 | %
2045 | % \end{macrocode}
2046 | % \end{environment}
2047 | %
2048 | %
2049 | % \subsubsection{致谢}
2050 | % \label{sec:ackanddeclare}
2051 | % \begin{macrocode}
2052 | %<*cls>
2053 | \newenvironment{acknowledgement}{\shu@chapter*[致谢]{致\quad 谢}}{}
2054 | %
2055 | % \end{macrocode}
2056 | %
2057 | %
2058 | % \subsubsection{图表索引}
2059 | % \label{sec:threeindex}
2060 | % \begin{macro}{\listoffigures}
2061 | % \begin{macro}{\listoffigures*}
2062 | % \begin{macro}{\listoftables}
2063 | % \begin{macro}{\listoftables*}
2064 | % 定义图表以及公式目录样式.
2065 | %
2066 | % \begin{macrocode}
2067 | %<*cls>
2068 | \def\shu@starttoc#1{% #1: float type, prepend type name in \listof*** entry.
2069 | \let\oldnumberline\numberline
2070 | \def\numberline##1{\oldnumberline{\csname #1name\endcsname\hskip.4em ##1}}
2071 | \@starttoc{\csname ext@#1\endcsname}
2072 | \let\numberline\oldnumberline}
2073 | \def\shu@listof#1{% #1: float type
2074 | \@ifstar
2075 | {\shu@chapter*[]{\csname list#1name\endcsname}\shu@starttoc{#1}}
2076 | {\shu@chapter*{\csname list#1name\endcsname}\shu@starttoc{#1}}}
2077 | \renewcommand\listoffigures{\shu@listof{figure}}
2078 | \renewcommand*\l@figure{\addvspace{6bp}\@dottedtocline{1}{0em}{4em}}
2079 | \renewcommand\listoftables{\shu@listof{table}}
2080 | \let\l@table\l@figure
2081 | %
2082 | % \end{macrocode}
2083 | % \end{macro}
2084 | % \end{macro}
2085 | % \end{macro}
2086 | % \end{macro}
2087 | %
2088 | %
2089 | % \subsection{参考文献}
2090 | % \label{sec:ref}
2091 | %
2092 | % 参考文献的设置依赖于 \pkg{natbib} 宏包, 参考文献的正文部分用五号字.
2093 | % 行距采用固定值 16 磅, 段前空 3 磅, 段后空 0 磅.
2094 | %
2095 | % \begin{environment}{thebibliography}
2096 | % 修改默认的 thebibliography 环境, 增加一些调整代码.
2097 | % \begin{macrocode}
2098 | %<*cls>
2099 | \renewenvironment{thebibliography}[1]{%
2100 | \shu@chapter*{\bibname}%
2101 | \wuhao[1.5]
2102 | \list{\@biblabel{\@arabic\c@enumiv}}%
2103 | {\renewcommand{\makelabel}[1]{##1\hfill}
2104 | \settowidth\labelwidth{1.1cm}
2105 | \setlength{\labelsep}{0em}
2106 | \setlength{\itemindent}{0pt}
2107 | \setlength{\leftmargin}{\labelwidth+\labelsep}
2108 | \addtolength{\itemsep}{-0.7em}
2109 | \usecounter{enumiv}%
2110 | \let\p@enumiv\@empty
2111 | \renewcommand\theenumiv{\@arabic\c@enumiv}}%
2112 | \sloppy\frenchspacing
2113 | \clubpenalty4000
2114 | \@clubpenalty \clubpenalty
2115 | \widowpenalty4000%
2116 | \interlinepenalty4000%
2117 | \sfcode`\.\@m}
2118 | {\def\@noitemerr
2119 | {\@latex@warning{Empty `thebibliography' environment}}%
2120 | \endlist\frenchspacing}
2121 | %
2122 | % \end{macrocode}
2123 | % \end{environment}
2124 | %
2125 | %
2126 | % \subsection{附录}
2127 | % \label{sec:appendix}
2128 | % \begin{environment}{appendix}
2129 | % \begin{macrocode}
2130 | %<*cls>
2131 | \let\shu@appendix\appendix
2132 | \renewenvironment{appendix}{%
2133 | \let\title\shu@appendix@title
2134 | \shu@appendix}{%
2135 | \let\title\@gobble}
2136 | %
2137 | % \end{macrocode}
2138 | % \end{environment}
2139 | %
2140 | %
2141 | % \subsection{科研成果}
2142 | % \begin{environment}{publications}
2143 | % 作者在攻读学位期间公开发表的论文和研究成果.
2144 | % \begin{macrocode}
2145 | %<*cfg>
2146 | \newcommand{\shu@publications@title}{作者在攻读\shu@cdegree 学位期间发表的论文与研究成果}
2147 | %
2148 | %<*cls>
2149 | \newenvironment{publications}[1][\shu@publications@title]{%
2150 | \shu@chapter*{#1}}{}
2151 | %
2152 | % \end{macrocode}
2153 | % \end{environment}
2154 | %
2155 | % \begin{macro}{\researchitem}
2156 | % 研究成果用 \cs{researchitem}\marg{类别} 开启, 包括 ``学术论文" 和 ``研究成果" 两个列表.
2157 | % \begin{macrocode}
2158 | %<*cls>
2159 | \newcommand{\researchitem}[1]{%
2160 | \vspace{32bp}{\sihao\heiti\centerline{#1}}\par\vspace{14bp}}
2161 | %
2162 | % \end{macrocode}
2163 | % \end{macro}
2164 | %
2165 | %
2166 | % \subsection{其它}
2167 | % \label{sec:other}
2168 | % 在模板文档结束时即装入配置文件, 这样用户就能在导言区进行相应的修改.
2169 | % \begin{macrocode}
2170 | %<*cls>
2171 | \AtEndOfClass{\input{shuthesis.cfg}}
2172 | \AtEndOfClass{\sloppy}
2173 | %
2174 | % \end{macrocode}
2175 | %
2176 | %
2177 | % \iffalse
2178 | % \begin{macrocode}
2179 | %<*dtx-style>
2180 | \ProvidesPackage{dtx-style}
2181 | \RequirePackage{hypdoc}
2182 | \RequirePackage[UTF8,scheme=chinese]{ctex}
2183 | \RequirePackage{newpxtext}
2184 | \RequirePackage{newpxmath}
2185 | \RequirePackage[
2186 | top=2.5cm,
2187 | bottom=2.5cm,
2188 | left=4cm,
2189 | right=2cm,
2190 | headsep=3mm]{geometry}
2191 | \RequirePackage{hyperref}
2192 | \hypersetup{%
2193 | linktoc=all,
2194 | bookmarksnumbered=true,
2195 | bookmarksopen=true,
2196 | bookmarksopenlevel=1,
2197 | breaklinks=true,
2198 | colorlinks=true,
2199 | citecolor=blue,
2200 | linkcolor=blue,
2201 | urlcolor=blue,
2202 | plainpages=false,
2203 | pdfborder=0 0 0}
2204 | \RequirePackage{array,longtable,booktabs,makecell}
2205 | \RequirePackage{listings}
2206 | \RequirePackage{fancyhdr}
2207 | \RequirePackage{xcolor}
2208 | \RequirePackage{enumitem}
2209 | \RequirePackage{etoolbox}
2210 | \RequirePackage{metalogo}
2211 |
2212 | \definecolor{medpurple}{RGB}{170,0,255}
2213 | \definecolor{lightpurple}{RGB}{223,63,250}
2214 | \colorlet{shu@macro}{blue!60!black}
2215 | \colorlet{shu@env}{blue!70!black}
2216 | \colorlet{shu@option}{purple}
2217 | \patchcmd{\PrintMacroName}{\MacroFont}{\MacroFont\bfseries\color{shu@macro}}{}{}
2218 | \patchcmd{\PrintDescribeMacro}{\MacroFont}{\MacroFont\bfseries\color{shu@macro}}{}{}
2219 | \patchcmd{\PrintDescribeEnv}{\MacroFont}{\MacroFont\bfseries\color{shu@env}}{}{}
2220 | \patchcmd{\PrintEnvName}{\MacroFont}{\MacroFont\bfseries\color{shu@env}}{}{}
2221 |
2222 | \def\DescribeOption{%
2223 | \leavevmode\@bsphack\begingroup\MakePrivateLetters%
2224 | \Describe@Option}
2225 | \def\Describe@Option#1{\endgroup
2226 | \marginpar{\raggedleft\PrintDescribeOption{#1}}%
2227 | \shu@special@index{option}{#1}\@esphack\ignorespaces}
2228 | \def\PrintDescribeOption#1{\strut \MacroFont\bfseries\sffamily\color{shu@option} #1\ }
2229 | \def\shu@special@index#1#2{\@bsphack
2230 | \begingroup
2231 | \HD@target
2232 | \let\HDorg@encapchar\encapchar
2233 | \edef\encapchar usage{%
2234 | \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}%
2235 | }%
2236 | \index{#2\actualchar{\string\ttfamily\space#2}
2237 | (#1)\encapchar usage}%
2238 | \index{#1:\levelchar#2\actualchar
2239 | {\string\ttfamily\space#2}\encapchar usage}%
2240 | \endgroup
2241 | \@esphack}
2242 |
2243 | \lstdefinestyle{lstStyleBase}{%
2244 | basicstyle=\small\ttfamily,
2245 | aboveskip=\medskipamount,
2246 | belowskip=\medskipamount,
2247 | lineskip=0pt,
2248 | boxpos=c,
2249 | showlines=false,
2250 | extendedchars=true,
2251 | upquote=true,
2252 | tabsize=2,
2253 | showtabs=false,
2254 | showspaces=false,
2255 | showstringspaces=false,
2256 | numbers=none,
2257 | linewidth=\linewidth,
2258 | xleftmargin=4pt,
2259 | xrightmargin=0pt,
2260 | resetmargins=false,
2261 | breaklines=true,
2262 | breakatwhitespace=false,
2263 | breakindent=0pt,
2264 | breakautoindent=true,
2265 | columns=flexible,
2266 | keepspaces=true,
2267 | gobble=2,
2268 | framesep=3pt,
2269 | rulesep=1pt,
2270 | framerule=1pt,
2271 | backgroundcolor=\color{gray!5},
2272 | stringstyle=\color{green!40!black!100},
2273 | keywordstyle=\bfseries\color{blue!50!black},
2274 | commentstyle=\slshape\color{black!60}}
2275 |
2276 | \lstdefinestyle{lstStyleShell}{%
2277 | style=lstStyleBase,
2278 | frame=l,
2279 | rulecolor=\color{lightpurple},
2280 | language=bash}
2281 |
2282 | \lstdefinestyle{lstStyleLaTeX}{%
2283 | style=lstStyleBase,
2284 | frame=l,
2285 | rulecolor=\color{lightpurple},
2286 | language=[LaTeX]TeX}
2287 |
2288 | \lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{}
2289 | \lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{}
2290 |
2291 | \setlist{nosep}
2292 |
2293 | \DeclareDocumentCommand{\option}{m}{\textsf{#1}}
2294 | \DeclareDocumentCommand{\env}{m}{\texttt{#1}}
2295 | \DeclareDocumentCommand{\pkg}{s m}{%
2296 | \texttt{#2}\IfBooleanF#1{\shu@special@index{package}{#2}}}
2297 | \DeclareDocumentCommand{\file}{s m}{%
2298 | \texttt{#2}\IfBooleanF#1{\shu@special@index{file}{#2}}}
2299 | \newcommand{\myentry}[1]{%
2300 | \marginpar{\raggedleft\color{purple}\bfseries\strut #1}}
2301 | \newcommand{\note}[2][Note]{{%
2302 | \color{medpurple}{\bfseries #1}\emph{#2}}}
2303 |
2304 | \def\shuthesis{\textsc{Shu}\-\textsc{Thesis}}
2305 | %
2306 | % \end{macrocode}
2307 | % \fi
2308 | %
2309 | % \Finale
2310 | %
2311 | \endinput
2312 | % \iffalse
2313 | % Local Variables:
2314 | % mode: doctex
2315 | % TeX-master: t
2316 | % End:
2317 | % \fi
--------------------------------------------------------------------------------
/shuthesis.ins:
--------------------------------------------------------------------------------
1 | %%
2 | %% Copyright (C) 2017 by Lele Liu
3 | %%
4 | %% This file is part of the ThuThesis package project.
5 | %% ---------------------------------------------------
6 | %%
7 | %% This file may be distributed and/or modified under the
8 | %% conditions of the LaTeX Project Public License, either version 1.3a
9 | %% of this license or (at your option) any later version.
10 | %% The latest version of this license is in:
11 | %%
12 | %% http://www.latex-project.org/lppl.txt
13 | %%
14 | %% and version 1.3a or later is part of all distributions of LaTeX
15 | %% version 2004/10/01 or later.
16 | %%
17 |
18 | \input docstrip
19 |
20 | \askforoverwritefalse
21 | %\askonceonly
22 | \showprogress
23 | \keepsilent
24 |
25 | \usedir{tex/latex/shuthesis}
26 |
27 | \preamble
28 |
29 | This is a generated file.
30 |
31 | Copyright (C) 2017-\the\year by Lele Liu
32 |
33 | This file may be distributed and/or modified under the
34 | conditions of the LaTeX Project Public License, either version 1.3a
35 | of this license or (at your option) any later version.
36 | The latest version of this license is in:
37 |
38 | http://www.latex-project.org/lppl.txt
39 |
40 | and version 1.3a or later is part of all distributions of LaTeX
41 | version 2004/10/01 or later.
42 |
43 | To produce the documentation run the original source files ending with `.dtx'
44 | through LaTeX.
45 |
46 | \endpreamble
47 |
48 | \declarepreamble\cfgpreamble
49 |
50 | This is a generated file.
51 |
52 | Copyright (C) 2017-\the\year by Lele Liu
53 |
54 | This file may be distributed and/or modified under the
55 | conditions of the LaTeX Project Public License, either version 1.3a
56 | of this license or (at your option) any later version.
57 | The latest version of this license is in:
58 |
59 | http://www.latex-project.org/lppl.txt
60 |
61 | and version 1.3a or later is part of all distributions of LaTeX
62 | version 2004/10/01 or later.
63 |
64 | This is the configuration file of the shuthesis package with LaTeX2e.
65 |
66 | \endpreamble
67 |
68 | \generate{\file{\jobname.cls}{\from{\jobname.dtx}{cls}}
69 | \usepreamble\cfgpreamble
70 | \file{\jobname.cfg}{\from{\jobname.dtx}{cfg}}
71 | \usepreamble\defaultpreamble\usepostamble\defaultpostamble
72 | \file{dtx-style.sty}{\from{\jobname.dtx}{dtx-style}}}
73 |
74 | \ifToplevel{%
75 | \Msg{***********************************************************}
76 | \Msg{*}
77 | \Msg{* To finish the installation you have to move the following}
78 | \Msg{* files into a directory searched by TeX:}
79 | \Msg{*}
80 | \Msg{* The recommended directory is TEXMF/tex/latex/shuthesis}
81 | \Msg{*}
82 | \Msg{* \space\space shuthesis.cls}
83 | \Msg{* \space\space shuthesis.cfg}
84 | \Msg{*}
85 | \Msg{* To produce the documentation run the files ending with}
86 | \Msg{* `.dtx' through LaTeX.}
87 | \Msg{*}
88 | \Msg{* Happy TeXing!}
89 | \Msg{***********************************************************}}
90 |
91 | \endbatchfile
92 |
--------------------------------------------------------------------------------
/shuthesis.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahhylau/shuthesis/b5437e3b745e8fc2282691f8ec26f38bfe1de1ad/shuthesis.pdf
--------------------------------------------------------------------------------
/shuthesis.sty:
--------------------------------------------------------------------------------
1 | \ProvidesPackage{shuthesis}[2017/05/04]
2 |
3 | % 表格中支持跨行
4 | \RequirePackage{multirow}
5 |
6 | % 固定宽度的表格
7 | \RequirePackage{tabularx}
8 |
9 | % 表格中的反斜线
10 | \RequirePackage{diagbox}
11 |
12 | % 确定浮动对象的位置,可以使用 H,强制将浮动对象放到这里(可能效果很差)
13 | \RequirePackage{float}
14 |
15 | % 给自定义的宏后面自动加空白
16 | % \RequirePackage{xspace}
17 |
18 | % 借用 ltxdoc 里面的几个命令。
19 | \def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}}
20 | \def\cmd@to@cs#1#2{\char\number`#2\relax}
21 | \DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
22 | \providecommand\pkg[1]{{\sffamily#1}}
23 |
24 | \endinput
25 |
--------------------------------------------------------------------------------