diff options
author | Karl Berry <karl@freefriends.org> | 2020-03-05 22:08:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-03-05 22:08:01 +0000 |
commit | 938d0017220d59681ce920e3593cb9cdef66341e (patch) | |
tree | b7c4df418e1f6e77520b0cc3fb3529b0a003d498 | |
parent | f768bb28c0a5e33e07be0c1a35fef697528091c7 (diff) |
hitszthesis (5mar20)
git-svn-id: svn://tug.org/texlive/trunk@54111 c570f23f-e606-0410-a88d-b1316a301751
16 files changed, 427 insertions, 298 deletions
diff --git a/Master/texmf-dist/doc/latex/hitszthesis/README.md b/Master/texmf-dist/doc/latex/hitszthesis/README.md index 69d04a94f38..021551d0fdc 100644 --- a/Master/texmf-dist/doc/latex/hitszthesis/README.md +++ b/Master/texmf-dist/doc/latex/hitszthesis/README.md @@ -1,27 +1,37 @@ <!-- Author : Jingxuan Yang--> <!-- Program Email: yanglatex2e@gmail.com --> +![CTAN Version](https://img.shields.io/ctan/v/hitszthesis.svg) +![Github Version](https://img.shields.io/github/release/YangLaTeX/hitszthesis.svg) +![Repo Size](https://img.shields.io/github/repo-size/YangLaTeX/hitszthesis.svg) +![License](https://img.shields.io/ctan/l/hitszthesis.svg) + [Github](https://github.com/YangLaTeX/hitszthesis) | [Download](https://github.com/YangLaTeX/hitszthesis/releases) | [Wiki](https://github.com/YangLaTeX/hitszthesis/wiki) | [CTAN](https://www.ctan.org/pkg/hitszthesis) # Introduction to hitszthesis -HITSZThesis is a **bachelor dissertation** LaTeX template for **Harbin Institute of Technology, ShenZhen** (HITSZ). Current version is 2.1, updated on 2020/2/23. +HITSZThesis is a **bachelor dissertation** LaTeX template for **Harbin Institute of Technology, ShenZhen** (HITSZ). Current version is 2.3, updated on 2020/03/05. # Documentation + Download and unzip the template. Specific usage documentation and examples can be found in the files below. At present, these documents are **only available in Chinese**: + * Template usage (hitszthesis.pdf) * Template example (main.pdf) # Downloads + * Published version: [CTAN](https://www.ctan.org/pkg/hitszthesis) * Developer version: [GitHub](https://github.com/YangLaTeX/hitszthesis) # Updates ## Automatic + Get the most up-to-date published version with your TeX distribution from [CTAN](https://www.ctan.org/pkg/hitszthesis). ## Manual + Download the package from [GitHub](https://github.com/YangLaTeX/hitszthesis) to the root directory of your thesis, then execute the command (Windows users `Shift + right click` white area in the file window and click "Open command line window here" from the popup menu): ```shell @@ -31,40 +41,44 @@ xetex hitszthesis.ins You'll get `hitszthesis.cls` along with other template files. # Reporting Issues + Please follow the procedure below: * QQ group: 1039392552 -* Check the [FAQ](https://github.com/YangLaTeX/hitszthesis/wiki/FAQ) * [GitHub Issues](https://github.com/YangLaTeX/hitszthesis/issues) # Makefile Usage -```shell -make [{all|thesis|spine|doc|clean|cleanall|distclean}] +To use Makefile, you should have GNU `make` tool installed. + +```bash +make cls # generate class hitszthesis.cls +make doc # generate template documentation hitszthesis.pdf; +make thesis # generate thesis main.pdf; +make spine # generate book spine for printing spine.pdf; +make all # generate thesis and spine, same as `make thesis && make spine`; +make wordcount # count word in thesis main.pdf +make clean # delete all examples' files (excluding main.pdf); +make cleanall # delete all examples' files and all pdf file; +make dev # make doc all clean +make pub # make doc all cleanall ``` -## Targets -* `make thesis` generate thesis main.pdf; -* `make spine` generate book spine for printing spine.pdf; -* `make doc` generate template documentation hitszthesis.pdf; -* `make all` generate thesis and spine, same as `make thesis && make spine`; -* `make wordcount` count word in thesis main.pdf -* `make clean` delete all examples' files (excluding main.pdf); -* `make cleanall` delete all examples' files and all pdf file; -* `make distclean` delete all examples' and templates' files and PDFs. +# compile.bat Usage -# Compile.bat Usage +compile.bat is designed for windows platform. ```bash -Compile.bat cls # generate class hitszthesis.cls -Compile.bat doc # generate template documentation hitszthesis.pdf -Compile.bat thesis # generate thesis main.pdf -Compile.bat spine # generate book spine for printing spine.pdf -Compile.bat all # generate thesis and spine, same as `make thesis && make spine` -Compile.bat wordcount # count word in thesis main.pdf -Compile.bat clean # delete all examples' files (excluding main.pdf) -Compile.bat cleanall # delete all examples' files and all pdf file +compile.bat cls # generate class hitszthesis.cls +compile.bat doc # generate template documentation hitszthesis.pdf +compile.bat thesis # generate thesis main.pdf +compile.bat spine # generate book spine for printing spine.pdf +compile.bat all # generate thesis and spine, same as `make thesis && make spine` +compile.bat wordcount # count word in thesis main.pdf +compile.bat clean # delete all examples' files (excluding main.pdf) +compile.bat cleanall # delete all examples' files and all pdf file ``` # License + This material is subject to the [LATEX Project Public License 1.3c](https://ctan.org/license/lppl1.3) or any later version. diff --git a/Master/texmf-dist/doc/latex/hitszthesis/dtx-style.sty b/Master/texmf-dist/doc/latex/hitszthesis/dtx-style.sty index 35e9ac93302..e91f12a780d 100644 --- a/Master/texmf-dist/doc/latex/hitszthesis/dtx-style.sty +++ b/Master/texmf-dist/doc/latex/hitszthesis/dtx-style.sty @@ -23,7 +23,7 @@ %% \RequirePackage{ifxetex} \ifxetex\else - \ClassError{hitszthesis}{Please use XeLaTeX to compile the file}{} + \ClassError{hitszthesis}{Please use XeLaTeX to compile this file}{} \end{document} \fi \ProvidesPackage{dtx-style} @@ -135,7 +135,7 @@ \DeclareDocumentCommand{\file}{s m}{% \texttt{#2}\IfBooleanF#1{\hitsz@special@index{file}{#2}}} \newcommand{\myentry}[1]{% - \marginpar{\raggedleft\color{purple}\bfseries\strut #1}} + \marginpar{\raggedleft\color{purple}\bfseries\small\strut #1}} \newcommand{\note}[2][Note]{{% \color{magenta}{\bfseries #1}\emph{#2}}} diff --git a/Master/texmf-dist/doc/latex/hitszthesis/hitszthesis.pdf b/Master/texmf-dist/doc/latex/hitszthesis/hitszthesis.pdf Binary files differindex a9f862476d9..818a851e77c 100644 --- a/Master/texmf-dist/doc/latex/hitszthesis/hitszthesis.pdf +++ b/Master/texmf-dist/doc/latex/hitszthesis/hitszthesis.pdf diff --git a/Master/texmf-dist/doc/latex/hitszthesis/main.pdf b/Master/texmf-dist/doc/latex/hitszthesis/main.pdf Binary files differindex 8429fe8d7fe..a56890a9e12 100644 --- a/Master/texmf-dist/doc/latex/hitszthesis/main.pdf +++ b/Master/texmf-dist/doc/latex/hitszthesis/main.pdf diff --git a/Master/texmf-dist/doc/latex/hitszthesis/main.tex b/Master/texmf-dist/doc/latex/hitszthesis/main.tex index ec89f2b7f26..afe154b4d67 100644 --- a/Master/texmf-dist/doc/latex/hitszthesis/main.tex +++ b/Master/texmf-dist/doc/latex/hitszthesis/main.tex @@ -3,38 +3,39 @@ % !TEX program = XeLaTeX %%============================================= % 模板名称:HITSZThesis -% 模板版本:V2.1 +% 模板版本:V2.3 % 模板作者:杨敬轩(Jingxuan Yang) % 联系作者:yangjingxuan@stu.hit.edu.cn & yanglatex2e@gmail.com -% 模板交流:QQ群:1039392552,加群请备注LaTeX、HITSZThesis相关说明 +% 模板交流:QQ群:1039392552,加群请备注LaTeX、hitszthesis相关说明 % 模板适用:哈尔滨工业大学(深圳)本科毕业设计(论文) % 模板编译:XeLaTeX,编译两次,两次,两次!!! -% GNU make 工具:make thesis -% 更多编译细节详见说明文档:hitszthesis.pdf -% 更新时间:02/23/2020 +% GNU make 工具:make thesis +% compile.bat 批处理脚本:compile.bat thesis +% 更多编译细节详见说明文档:hitszthesis.pdf +% 更新时间:2020/03/05 % 模板帮助:请**务必务必务必**阅读 hitszthesis.pdf 说明文档,文档查看方法: -% cmd 命令行:texdoc hitszthesis -% 推荐前往模板的GitHub仓库获取最新文件,地址: -% https://github.com/YangLaTeX/hitszthesis +% cmd 命令行:texdoc hitszthesis +% 推荐前往模板的GitHub仓库获取最新文件,地址: +% https://github.com/YangLaTeX/hitszthesis %%============================================= % 设置文档类别为<hitszthesis> \documentclass{hitszthesis} % 模板提供以下选项 -% 1. 封面标题单行或多行显示: +% 1. covertitle,封面标题单行或多行显示: %% onerow(默认,单行),tworow(两行) -% 2. 封面第二页下划线内容居中或居左显示: +% 2. infoalign,封面第二页下划线内容居中或居左显示: %% infocenter(默认,居中),infoleft(居左) -% 3. 正文数学字体选项: -%% newtxmath(默认,凑合),mtpro2(非常推荐) -%% 将 newtxmath 设置为默认数学字体仅为了避免同学未安装mtpro2字体 -%% 会产生的编译错误 -%% !mtpro2为非免费字体,CTAN禁止提供下载链接,需自行下载该字体 - -% 示例:两行,居左,mtpro2字体,将<\documentclass{hitszthesis}>注释, -% 且将下面语句取消注释 -%\documentclass[tworow, infoleft, mtpro2]{hitszthesis} +% 3. mathfont,正文数学字体选项: +%% newtxmath(默认),XITS(可选),mtpro2lite(lite版,免费), +%% mtpro2(完全版,需购买授权) +%% mtpro2字体官网:https://www.pctex.com/mtpro2.html +% 4. boldcaption,图表题注是否加粗布尔选项,默认为false(否) + +% 示例:两行,居左,mtpro2字体,图表题注加粗, +% 将<\documentclass{hitszthesis}>注释,且将下面语句取消注释 +%\documentclass[tworow, infoleft, mtpro2, boldcaption=true]{hitszthesis} % 自定义设置与额外加载的宏包请写在 \file{hitszthesis.sty} 里 % 预设该文件为空 diff --git a/Master/texmf-dist/doc/latex/hitszthesis/spine.pdf b/Master/texmf-dist/doc/latex/hitszthesis/spine.pdf Binary files differindex 2a5b78f4eb8..378022907c7 100644 --- a/Master/texmf-dist/doc/latex/hitszthesis/spine.pdf +++ b/Master/texmf-dist/doc/latex/hitszthesis/spine.pdf diff --git a/Master/texmf-dist/doc/latex/hitszthesis/spine.tex b/Master/texmf-dist/doc/latex/hitszthesis/spine.tex index 737e622dccf..47272769fab 100644 --- a/Master/texmf-dist/doc/latex/hitszthesis/spine.tex +++ b/Master/texmf-dist/doc/latex/hitszthesis/spine.tex @@ -1,10 +1,7 @@ \documentclass{hitszthesis} -% 论文标题 -\thesistitle{基于神经网络的机器人智能抓取研究} - -% 姓名 -\authorname{杨敬轩} +% 填写封面信息 +\input{tex/information} \begin{document} diff --git a/Master/texmf-dist/doc/latex/hitszthesis/tex/appendix01.tex b/Master/texmf-dist/doc/latex/hitszthesis/tex/appendix01.tex index 3951a0b2d39..c59fa1ee19b 100644 --- a/Master/texmf-dist/doc/latex/hitszthesis/tex/appendix01.tex +++ b/Master/texmf-dist/doc/latex/hitszthesis/tex/appendix01.tex @@ -1,15 +1,7 @@ % !TEX root = ../main.tex -% 注意:由于模板的一些限制,附录部分章节需要手动编号 -% 附录的章节均需要使用带星号的版本 -\chapter*{附录A\hskip.5em 外文资料翻译} -\addcontentsline{toc}{chapter}{附录A\hskip.5em 外文资料翻译} -% 设置章节编号为1,即A -\setcounter{chapter}{1} -% 重置所有计数器 -\setcounter{equation}{0} -\setcounter{figure}{0} -\setcounter{table}{0} +% 附录已经设置为目录只包含章标题,章节写法与正文完全相同 +\chapter{外文资料翻译} 题目:基于驾驶员—车辆—道路交互的驾驶安全场 @@ -17,7 +9,7 @@ 摘要:车辆驾驶安全受许多因素的影响,包括驾驶员、车辆和道路环境,它们之间的相互作用非常复杂。现有的评估驾驶安全性的方法仅考虑有限的因素及其相互作用,基于运动学和动力学的车辆驾驶安全辅助系统难以适应日益复杂的交通环境。在本文中,我们提出了一个新的概念——驾驶安全场。驾驶安全场利用场论来表示由驾驶员、车辆、道路状况和其他交通因素引起的风险因素。本文构建了一个统一的驾驶安全场模型,包括以下三个部分:(1)势能场,由道路上的静止物体构成,例如停止的车辆;(2)动能场,由道路上的移动物体构成,例如车辆和行人;(3)行为场,由驾驶员的个人特征构成。 -\section*{A.1\hskip.5em 求和算子} +\section{求和算子} \textbf{求和算子} 是用以表达多个数求和运算的一个缩略符号,它在统计学和计量经济学分析中扮演着重要作用。如果 $\{x_i: i=1, 2, \cdots, n\}$ 表示 $n$ 个数的一个序列,那么我们就把这 $n$ 个数的和写为\equref{eq:1}: \begin{equation} diff --git a/Master/texmf-dist/doc/latex/hitszthesis/tex/appendix02.tex b/Master/texmf-dist/doc/latex/hitszthesis/tex/appendix02.tex index e3b918caa71..cac3b135bfd 100644 --- a/Master/texmf-dist/doc/latex/hitszthesis/tex/appendix02.tex +++ b/Master/texmf-dist/doc/latex/hitszthesis/tex/appendix02.tex @@ -1,17 +1,10 @@ % !TEX root = ../main.tex -\chapter*{附录B\hskip.5em 其他附录文本} -\addcontentsline{toc}{chapter}{附录B\hskip.5em 其他附录文本} -% 设置章节编号为1,即A -\setcounter{chapter}{2} -% 重置所有计数器 -\setcounter{equation}{0} -\setcounter{figure}{0} -\setcounter{table}{0} +\chapter{其他附录文本} \lipsum[2] -\section*{B.1\hskip.5em 求和算子} +\section{求和算子} \textbf{求和算子} 是用以表达多个数求和运算的一个缩略符号,它在统计学和计量经济学分析中扮演着重要作用。如果 $\{x_i: i=1, 2, \cdots, n\}$ 表示 $n$ 个数的一个序列,那么我们就把这 $n$ 个数的和写为\equref{eq:2}: \begin{equation} diff --git a/Master/texmf-dist/doc/latex/hitszthesis/tex/chapter03.tex b/Master/texmf-dist/doc/latex/hitszthesis/tex/chapter03.tex index ba66e82f4d1..8bd06139172 100644 --- a/Master/texmf-dist/doc/latex/hitszthesis/tex/chapter03.tex +++ b/Master/texmf-dist/doc/latex/hitszthesis/tex/chapter03.tex @@ -34,23 +34,6 @@ \right. \end{equation} -如果需要对公式的子公式进行编号,则使用\lstinline{subnumcases}环境: -\begin{lstlisting} -\begin{subnumcases}{\label{w} w\equiv} - 0 & $c = d = 0$\label{wzero}\\ - \sqrt{|c|}\,\sqrt{\frac{1 + \sqrt{1+(d/c)^2}}{2}} & $|c| \geq |d|$ \\ - \sqrt{|d|}\,\sqrt{\frac{|c/d| + \sqrt{1+(c/d)^2}}{2}} & $|c| < |d|$ -\end{subnumcases} -\end{lstlisting} -上述代码输出如下: -\begin{subnumcases}{\label{w} w\equiv} -0 & $c = d = 0$\label{wzero}\\ -\sqrt{|c|}\,\sqrt{\frac{1 + \sqrt{1+(d/c)^2}}{2}} & $|c| \geq |d|$ \\ -\sqrt{|d|}\,\sqrt{\frac{|c/d| + \sqrt{1+(c/d)^2}}{2}} & $|c| < |d|$ -\end{subnumcases} - -\equref{w}中,\lstinline{label:w}为整个公式的编号,\lstinline{label:wzero}为子公式的编号。 - % 条标题 \subsection{一类连续复值 Hopf\/ield 神经网络} @@ -107,7 +90,10 @@ y_l(k) = \csign_K\left(\sum\limits_{j=1}^n w_{lj}\cdot x_j(k)\right) 异步方式:网络中的神经元状态等概率地依\equref{eqiter}进行更新,一次只更新一个神经元状态; 同步方式:网络的每次迭代中,所有神经元状态同时被更新,即依照下式更新:\begin{equation} -{\mathbf{ X}}(k+1)=\mathbf{ Y}(k)=\csign[\mathbf{ W }\cdot\mathbf{ X }(k)] +% 若使用XITS字体: +% <\mathbfup> 与 <\mathbf> 的效果相同,都是直立加粗 +% 斜体加粗使用 <\mathbfit> +{\mathbf{ X}}(k+1)=\mathbf{ Y}(k)=\csign[\mathbf{ W }\cdot\mathbf{ X }(k)] \end{equation} 其中$\mathbf{ X}(k)$为神经元状态$x(k)$组成的列向量,$\mathbf{ W}=(w_{kj})$为整个网络的连接权矩阵。 @@ -316,4 +302,29 @@ L=\frac{1}{N}\left(\Big|\theta'-\theta_0\Big|+\sum\limits_i^n\lambda\omega_i^2\r % 证明环境 \begin{proof} 以下是一段无意义文字:\lipsum[5] -\end{proof}
\ No newline at end of file +\end{proof} + +如果需要对公式的子公式进行编号,则使用\lstinline{subeqnarray}环境: +\begin{lstlisting} +\begin{subeqnarray} +\label{eqw} +\slabel{eq0} +x & = & a \times b \\ +\slabel{eq1} +& = & z + t\\ +\slabel{eq2} +& = & z + t +\end{subeqnarray} +\end{lstlisting} +上述代码输出如下: +\begin{subeqnarray} +\label{eqw} +\slabel{eq0} +x & = & a \times b \\ +\slabel{eq1} +& = & z + t\\ +\slabel{eq2} +& = & z + t +\end{subeqnarray} + +\equref{eqw}中,\lstinline{eqw}为整个公式的标签,\lstinline{slabel}为子公式的标签。
\ No newline at end of file diff --git a/Master/texmf-dist/source/latex/hitszthesis/Makefile b/Master/texmf-dist/source/latex/hitszthesis/Makefile index 7f8b55e6a8e..ca045485ce5 100644 --- a/Master/texmf-dist/source/latex/hitszthesis/Makefile +++ b/Master/texmf-dist/source/latex/hitszthesis/Makefile @@ -1,4 +1,4 @@ -# Makefile for HITSZThesis +# Makefile for hitszthesis PACKAGE = hitszthesis THESIS = main @@ -22,7 +22,9 @@ thesis: $(THESIS).pdf all: thesis spine -all-dev: doc all +dev: doc all clean + +pub: doc all cleanall cls: $(CLSFILE) @@ -62,16 +64,14 @@ test: wordcount : $(THESIS).tex @texcount $< -inc -chinese - + clean: $(LATEXMK) -c $(PACKAGE).dtx $(THESIS) $(SPINE) - -@$(RM) *~ main-survey.* cleanall: clean - -@$(RM) $(PACKAGE).pdf $(THESIS).pdf $(SPINE).pdf + -@$(RM) $(CLSFILE) distclean: cleanall - -@$(RM) $(CLSFILE) -@$(RM) -r dist check: FORCE_MAKE diff --git a/Master/texmf-dist/source/latex/hitszthesis/Compile.bat b/Master/texmf-dist/source/latex/hitszthesis/compile.bat index 230b133a565..e9fcd5fb9ec 100755 --- a/Master/texmf-dist/source/latex/hitszthesis/Compile.bat +++ b/Master/texmf-dist/source/latex/hitszthesis/compile.bat @@ -12,7 +12,7 @@ if %flag%x == x ( if %flag%x == thesisx (
call :cleanall
- call :thesis
+ call :thesis
if ERRORLEVEL 1 (
echo Error! Please check the 'main.log' for more details...
pause
@@ -72,7 +72,7 @@ goto :EOF :thesis
echo Compile...
- latexmk -xelatex -quiet -file-line-error -halt-on-error -interaction=nonstopmode main >nul 2>nul
+ latexmk -xelatex -file-line-error -halt-on-error -interaction=nonstopmode main >nul 2>nul
goto :EOF
:cls
@@ -82,7 +82,7 @@ goto :EOF :spine
echo Compile spine.tex file...
- latexmk -xelatex -quiet -file-line-error -halt-on-error -interaction=nonstopmode spine >nul 2>nul
+ latexmk -xelatex -file-line-error -halt-on-error -interaction=nonstopmode spine >nul 2>nul
goto :EOF
:all
@@ -93,6 +93,7 @@ goto :EOF :doc
echo Compile documentation...
+ xetex %PACKAGE%.ins
latexmk -xelatex -file-line-error -halt-on-error -interaction=nonstopmode %PACKAGE%.dtx >nul 2>nul
goto :EOF
diff --git a/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.dtx b/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.dtx index 7ae72e10e24..eebbca7b507 100644 --- a/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.dtx +++ b/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.dtx @@ -3,20 +3,20 @@ % Copyright (C) 2019-2020 by Jingxuan Yang <yanglatex2e@gmail.com> % % This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 +% conditions of the LaTeX Project Public License, either version 1.3c % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX +% and version 1.3c or later is part of all distributions of LaTeX % version 2005/12/01 or later. % -% This work has the LPPL maintenance status `maintained'. +% This work has the LPPL1.3c maintenance status `maintained'. % % \fi % % \iffalse %<*driver> -\ProvidesFile{hitszthesis.dtx}[2020/02/23 v2.1 A Bachelor Thesis Template for Harbin Institute of Technology, ShenZhen (HITSZ) ] +\ProvidesFile{hitszthesis.dtx}[2020/03/05 v2.3 A Bachelor Thesis Template for Harbin Institute of Technology, ShenZhen (HITSZ) ] \documentclass{ltxdoc} \usepackage{dtx-style} @@ -78,7 +78,7 @@ % % \def\abstractname{\Large 摘要} % \begin{abstract}\normalsize\vskip0.5cm -% \hitszthesis 宏包旨在建立一个规格严格、功夫到家的哈尔滨工业大学(深圳)学位论文模板,目前只包含本科毕业设计(论文)模板。模板的构建基于 \pkg{hitszthesis.dtx} 与 \pkg{hitszthesis.ins},在使用本模板之前,请仔细阅读\file{hitszthesis.pdf}(本文件)、\file{main.tex}(撰写示例)及\file{main.pdf}(撰写效果)。 +% \hitszthesis 宏包旨在建立一个{\bfseries 规格严格、功夫到家}的哈尔滨工业大学(深圳)学位论文模板,目前只包含本科毕业设计(论文)模板。模板的构建基于 \pkg{hitszthesis.dtx} 与 \pkg{hitszthesis.ins},在使用本模板之前,请仔细阅读\file{hitszthesis.pdf}(本文件)、\file{main.tex}(撰写示例)及\file{main.pdf}(撰写效果)。 % \end{abstract} % % \vskip1.5cm @@ -86,7 +86,7 @@ % \begin{abstract} % \normalsize\noindent % \begin{enumerate} -% \item 本模板的发布遵守 \href{http://www.latex-project.org/lppl.txt}{\LaTeX\ Project Public License},使用前请认真阅读协议内 +% \item 本模板的发布遵守 \href{http://www.latex-project.org/lppl.txt}{\LaTeX\ Project Public License 1.3c}以及其后的最新版本,使用前请认真阅读协议内 % 容。 % \item 本模板为作者根据哈尔滨工业大学(深圳)教务处颁发的《本科毕业设计(论文)撰写规范》、《书写范例》 % 编写而成,旨在供哈尔滨工业大学(深圳)本科毕业生撰写学位论文使用。 @@ -94,7 +94,7 @@ % 权第三方模板为官方模板,所以此模板仅为写作指南的参考实现,不保证格式审查老师 % 不提意见。任何由于使用本模板而引起的论文格式审查问题均与本模板作者无关。 % \item 任何个人或组织以本模板为基础进行修改、扩展而生成的新的专用模板,请严格遵 -% 守 \href{http://www.latex-project.org/lppl.txt}{\LaTeX\ Project Public License} 协议。由于违犯协议而引起的任何纠纷争端均与 +% 守 \href{http://www.latex-project.org/lppl.txt}{\LaTeX\ Project Public License 1.3c} 协议以及其后的最新版本。由于违犯协议而引起的任何纠纷争端均与 % 本模板作者无关。 % \end{enumerate} % \end{abstract} @@ -126,7 +126,8 @@ % \section{安装} % \label{sec:installation} % -% \hitszthesis\ 已经上传CTAN,将包含在2020年主要的 \TeX\ 发行版中。% 安装方法:打开命令行,输入以下命令即可 +% \hitszthesis\ 已经上传CTAN,已包含在TeXLive与MiKTeX发行版中。 +% 安装方法:打开命令行,输入以下命令即可 % \begin{shell} % $ tlmgr install hitszthesis % \end{shell} @@ -163,7 +164,7 @@ % tex/ & 示例文档正文各部分路径\\ % hitszthesis.sty & 为示例文档加载其它宏包\\\midrule % Makefile & GNU make 使用 Makefile\\ -% Compile.bat & Windows 编译用脚本文件\\ +% compile.bat & Windows 编译用脚本文件\\ % latexmkrc & latexmk 配置文件 \\ % README.md & Readme\\ % \textbf{hitszthesis.pdf} & 用户手册(本文档)\\\bottomrule @@ -232,10 +233,10 @@ % 链来进行生成,它会自动运行多次工具直到交叉引用都被解决。下面给出了一个用 % \texttt{latexmk} 调用 \texttt{xelatex} 生成最终文档的示例: % \begin{shell} -% $ latexmk main.tex # 生成论文 main.pdf -% $ latexmk spine.tex # 生成书脊 spine.pdf +% $ latexmk main.tex # 生成论文 main.pdf +% $ latexmk spine.tex # 生成书脊 spine.pdf % $ latexmk hitszthesis.dtx # 生成说明文档 hitszthesis.pdf -% $ latexmk -c # 清理编译生成的辅助文件 +% $ latexmk -c # 清理编译生成的辅助文件 % \end{shell} % % \subsubsection{GNU make} @@ -252,10 +253,10 @@ % $ make doc # 生成说明文档 hitszthesis.pdf % $ make thesis # 生成示例文档 main.pdf % $ make spine # 生成书脊 spine.pdf -% $ make all # 生成示例文档 main.pdf 以及书脊 spine.pdf +% $ make all # 生成示例文档 main.pdf 以及书脊 spine.pdf % $ make wordcount # 统计论文字数 -% $ make clean # 清理辅助文件 -% $ make cleanall # 删除所有 pdf 文件和所有辅助文件 +% $ make clean # 清理辅助文件 +% $ make cleanall # 删除所有 pdf 文件和所有辅助文件 % \end{shell} % % \hitszthesis\ 的 \file{Makefile} 默认用 \texttt{latexmk} 调用\texttt{xelatex} 编 @@ -263,20 +264,20 @@ % 改 \file{Makefile} 开头的参数或通过命令行传递参数(请参看 \file{README.md}), % 进一步还可以修改 \file{latexmkrc} 进行定制。 % -% \changes{v2.1}{2020/02/23}{Add \file{Compile.bat}, add wordcount function, regulate writing style of \file{main.tex} to use \file{input}} -% \subsubsection{Compile.bat} +% \subsubsection{compile.bat} % \label{sec:bat} -% 针对windows系统,本模板提供了 \file{Compile.bat} 脚本文件, +% \changes{v2.1}{2020/02/23}{Add \file{compile.bat}, add wordcount function, regulate writing style of \file{main.tex} to use \file{input}} +% 针对windows系统,本模板提供了 \file{compile.bat} 脚本文件, % 可以双击直接编译,也可以在命令提示符窗口中使用脚本提供的额外功能: % \begin{shell} -% $ Compile.bat cls # 生成 hitszthesis.cls -% $ Compile.bat doc # 生成说明文档 hitszthesis.pdf -% $ Compile.bat thesis # 生成示例文档 main.pdf -% $ Compile.bat spine # 生成书脊 spine.pdf -% $ Compile.bat all # 生成示例文档 main.pdf 以及书脊 spine.pdf -% $ Compile.bat wordcount # 统计论文字数 -% $ Compile.bat clean # 删除编译所产生的辅助文件 -% $ Compile.bat cleanall # 删除所有 pdf 文件和所有辅助文件 +% $ compile.bat cls # 生成 hitszthesis.cls +% $ compile.bat doc # 生成说明文档 hitszthesis.pdf +% $ compile.bat thesis # 生成示例文档 main.pdf +% $ compile.bat spine # 生成书脊 spine.pdf +% $ compile.bat all # 生成示例文档 main.pdf 以及书脊 spine.pdf +% $ compile.bat wordcount # 统计论文字数 +% $ compile.bat clean # 删除编译所产生的辅助文件 +% $ compile.bat cleanall # 删除所有 pdf 文件和所有辅助文件 % \end{shell} % \subsection{升级} % \label{sec:updgrade} @@ -306,8 +307,8 @@ % 按照优先级推荐提问的位置如下: % % \begin{itemize} -% \item Github Issues: \href{http://github.com/YangLaTeX/hitszthesis/issues}{http://github.com/YangLaTeX/hitszthesis/issues} % \item QQ group: 1039392552 +% \item Github Issues: \href{http://github.com/YangLaTeX/hitszthesis/issues}{http://github.com/YangLaTeX/hitszthesis/issues} % \item Email: \href{mailto:yanglatex2e@gmail.com}{yanglatex2e@gmail.com}, \href{mailto:yangjingxuan@stu.hit.edu.cn}{yangjingxuan@stu.hit.edu.cn} % \end{itemize} % @@ -326,8 +327,8 @@ % \label{sec:option} % % \DescribeOption{covertitle} -% 选择论文类型,当前支持:\option{onerow},\option{tworow},其中 -% \option{onerow}为默认选项。 +% 选择论文封面第一页标题行数,当前支持:\option{onerow}, +% \option{tworow},其中\option{onerow}为默认选项。 % \begin{latex} % % 封面标题两行 % \documentclass[covertitle=tworow]{hitszthesis} @@ -341,10 +342,21 @@ % \end{latex} % % \DescribeOption{mathfont} -% 论文使用的数学字体。可选:\option{newtxmath},\option{mtpro2},其中\option{newtxmath}为默认选项。推荐使用\option{mtpro2}字体,但是此字体需要额外下载安装。 +% 论文使用的数学字体。可选:\option{newtxmath},\option{SITX},\option{mtpro2},\option{mtpro2lite},其中\option{newtxmath}为默认选项,\option{mtpro2lite}字体可以\href{https://www.pctex.com/mtpro2.html}{免费使用},但是\option{mtpro2}完全版需要\href{https://www.pctex.com/mtpro2.html}{购买授权},\option{SITX}字体为可选备用选项。 % \begin{latex} % % 论文采用mtpro2数学字体 % \documentclass[mathfont=mtpro2]{hitszthesis} +% % 论文采用mtpro2 lite数学字体 +% \documentclass[mathfont=mtpro2lite]{hitszthesis} +% % 论文采用SITX数学字体 +% \documentclass[mathfont=SITX]{hitszthesis} +% \end{latex} +% +% \DescribeOption{boldcaption} +% 论文中图表的题注是否加粗选项,这是一个布尔选项,默认为否。 +% \begin{latex} +% % 论文题注加粗 +% \documentclass[boldcaption=true]{hitszthesis} % \end{latex} % % \subsection{引用方式} @@ -595,7 +607,7 @@ % \begin{macrocode} %<cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<cls>\ProvidesClass{hitszthesis} -%<cls>[2020/02/23 v2.1 A Bachelor Thesis Template for Harbin Institute of Technology, ShenZhen +%<cls>[2020/03/05 v2.3 A Bachelor Thesis Template for Harbin Institute of Technology, ShenZhen %<cls> (HITSZ)] % \end{macrocode} % @@ -603,7 +615,7 @@ % \begin{macrocode} \RequirePackage{ifxetex} \ifxetex\else - \ClassError{hitszthesis}{Please use XeLaTeX to compile the file}{} + \ClassError{hitszthesis}{Please use XeLaTeX to compile this file}{} \end{document} \fi % \end{macrocode} @@ -646,14 +658,25 @@ \DeclareVoidOption{tworow}{\ykv{covertitle = tworow}} % \end{macrocode} % -% 数学字体选择 +% 数学字体选择,添加XITS数学字体 +%(https://github.com/alif-type/xits),该字体来源于 +% Scientific and Technical Information Exchange(XTIS)字体 +% \changes{v2.3}{2020/03/05}{Add math font option XITS} % \begin{macrocode} \DeclareStringOption[newtxmath]{mathfont} -\DeclareVoidOption{newtxmath}{\ykv{mathfont = newtxmath}} +\DeclareVoidOption{XITS}{\ykv{mathfont = XITS}} \DeclareVoidOption{mtpro2}{\ykv{mathfont = mtpro2}} +\DeclareVoidOption{mtpro2lite}{\ykv{mathfont = mtpro2lite}} +\DeclareVoidOption{newtxmath}{\ykv{mathfont = newtxmath}} % \end{macrocode} % -% 默认选项 +% 题注是否加粗选项,默认不加粗 +% \changes{v2.3}{2020/03/05}{Add boldcaption option to control the caption font} +% \begin{macrocode} +\DeclareBoolOption[false]{boldcaption} +% \end{macrocode} +% +% 将其他选项传递给|book|文档类 % \begin{macrocode} \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{book}} % \end{macrocode} @@ -674,34 +697,106 @@ \RequirePackage{etex} % \end{macrocode} % -% 加载支持中文的 \pkg{ctex} 宏包 -% \begin{macrocode} -\RequirePackage[UTF8,space=auto,scheme=plain]{ctex} +% 加载支持中文的 \pkg{ctex} 宏包,并设置章节标题格式 +% \changes{v2.2}{2020/03/04}{Use \pkg{ctex} to set chinese titile and toc} +% \begin{macrocode} +\RequirePackage[UTF8,scheme=chinese,zihao=-4,heading=true]{ctex} +\ctexset{% + space = auto, + chapter={ + afterindent=true, + number=\arabic{chapter}, + beforeskip={28.34658bp},%一个空行 1.57481 × 18 + afterskip={24.74658bp},%0.8应该不计算间距 0.8 × 18 + 0.57481×18 + aftername=\enspace, + format={\centering\heiti\xiaoer[1.57481]},%\center 会影响之后全局 + nameformat=\relax, + numberformat=\relax, + fixskip=true, % 添加这一行去除默认间距 + %hang=true, + }, + section={ + afterindent=true, + beforeskip={12bp},%上下空0.5行 + afterskip={13.5bp}, + format={\heiti\fontsize{15bp}{21bp}\selectfont}, + aftername=\enspace, + fixskip=true, + break={}, + }, + subsection={ + afterindent=true, + beforeskip={10bp}, + afterskip={11bp}, + format={\heiti\fontsize{14bp}{18bp}\selectfont}, + aftername=\enspace, + fixskip=true, + break={}, + }, + subsubsection={ + afterindent=true, + beforeskip={9bp}, + afterskip={9bp}, + format={\heiti\normalsize}, + aftername=\enspace, + fixskip=true, + break={}, + }, + paragraph/afterindent=true, + subparagraph/afterindent=true +} % \end{macrocode} % % 正文和数学字体设置 % \begin{macrocode} \RequirePackage{amsmath} -\RequirePackage[T1]{fontenc} -\RequirePackage{newtxtext} -\ifdefstring{\hitsz@mathfont}{mtpro2}{ -\RequirePackage[mtphrb,mtpcal,zswash,uprightGreek]{mtpro2} +\ifdefstring{\hitsz@mathfont}{XITS}{ + \setmainfont{Times New Roman} + \setsansfont{Arial} + \setmonofont[Scale=MatchLowercase]{Consolas} + \RequirePackage{unicode-math} + \unimathsetup{ + math-style = ISO, + bold-style = ISO, + nabla = upright, + partial = upright, + } + \IfFontExistsTF{XITSMath-Regular.otf}{ + \setmathfont[ + Extension = .otf, + BoldFont = XITSMath-Bold, + StylisticSet = 8, + ]{XITSMath-Regular} + \setmathfont[range={cal,bfcal},StylisticSet=1]{XITSMath-Regular.otf} + }{ + \setmathfont[ + Extension = .otf, + BoldFont = *bold, + StylisticSet = 8, + ]{xits-math} + \setmathfont[range={cal,bfcal},StylisticSet=1]{xits-math.otf} + } + \AtBeginDocument{\renewcommand{\mathbf}{\mathbfup} + \newcommand\square{\mdlgwhtsquare} + } }{\relax} -\ifdefstring{\hitsz@mathfont}{newtxmath}{ -\RequirePackage{newtxmath} +\ifdefstring{\hitsz@mathfont}{mtpro2}{% + \RequirePackage{newtxtext} % newtxtext宏包必须加在数学字体宏包之前 + \RequirePackage[mtphrb,mtpcal,zswash,uprightGreek]{mtpro2} +}{\relax} +\ifdefstring{\hitsz@mathfont}{mtpro2lite}{% + \RequirePackage{newtxtext} + \RequirePackage[lite,subscriptcorrection,slantedGreek,nofontinfo]{mtpro2} +}{\relax} +\ifdefstring{\hitsz@mathfont}{newtxmath}{% + \RequirePackage{newtxtext} + \RequirePackage{newtxmath} \let\openbox\relax }{\relax} -\renewcommand{\rmdefault}{ptm} -\RequirePackage[scaled=0.92]{helvet} \RequirePackage{type1cm} \RequirePackage{lipsum} % \end{macrocode} % -% 使字体设置生效,排除其他干扰,不一定起作用,但为防万一需要保留 -% \begin{macrocode} -\RequirePackage{mathdesign} -% \end{macrocode} -% % \begin{macro}{\kai} % \begin{macro}{\song} % 设置中文加粗字体 @@ -836,8 +931,9 @@ % \end{macrocode} % % 子公式编号 +% \changes{v2.2}{2020/03/05}{Use \pkg{subeqnarray} rather than \pkg{cases} to write sub equations} % \begin{macrocode} -\RequirePackage{cases} +\RequirePackage{subeqnarray} % \end{macrocode} % % 书写单位 @@ -851,13 +947,10 @@ \includepdfset{fitpaper=true} % \end{macrocode} % -% \begin{macro}{\ttdefault} % 排版代码 % \begin{macrocode} \RequirePackage{listings} -\renewcommand{\ttdefault}{cmtt} % \end{macrocode} -% \end{macro} % % \begin{macro}{\lstdefinestyle} % 定义 |ystyle| 样式 @@ -1110,27 +1203,11 @@ % \begin{macro}{\keywordsname} % \begin{macro}{\keywordsenname} % \begin{macro}{\contentsname} -% \begin{macro}{\figurename} -% \begin{macro}{\tablename} -% \begin{macro}{\partname} -% \begin{macro}{\bibname} -% \begin{macro}{\appendixname} % \begin{macro}{\indexname} % \begin{macro}{\notename} % \begin{macro}{\proofname} % \begin{macro}{\problemname} % \begin{macro}{\definitionname} -% \begin{macro}{\theoremname} -% \begin{macro}{\axiomname} -% \begin{macro}{\postulatename} -% \begin{macro}{\lemmaname} -% \begin{macro}{\propositionname} -% \begin{macro}{\corollaryname} -% \begin{macro}{\examplename} -% \begin{macro}{\exercisename} -% \begin{macro}{\remarkname} -% \begin{macro}{\assumptionname} -% \begin{macro}{\conclusionname} % 中文标题名称设置 % \begin{macrocode} \renewcommand\listfigurename{插图目录} @@ -1139,27 +1216,11 @@ \newcommand{\keywordsname}{关键词} \newcommand{\keywordsenname}{Keywords} \renewcommand{\contentsname}{目\quad 录} -\renewcommand{\figurename}{图} -\renewcommand{\tablename}{表} -\renewcommand{\partname}{部分} -\renewcommand{\bibname}{参考文献} -\renewcommand{\appendixname}{附录~\thechapter} \renewcommand{\indexname}{索\quad 引} \newcommand{\notename}{笔记} \renewcommand*{\proofname}{证明} \newcommand{\problemname}{问题} \newcommand{\definitionname}{定义} -\newcommand{\theoremname}{定理} -\newcommand{\axiomname}{公理} -\newcommand{\postulatename}{公设} -\newcommand{\lemmaname}{引理} -\newcommand{\propositionname}{命题} -\newcommand{\corollaryname}{推论} -\newcommand{\examplename}{例} -\newcommand{\exercisename}{练习} -\newcommand{\remarkname}{注} -\newcommand{\assumptionname}{假设} -\newcommand{\conclusionname}{结论} % \end{macrocode} % \end{macro} % \end{macro} @@ -1172,11 +1233,32 @@ % \end{macro} % \end{macro} % \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} +% +% \begin{macro}{\theoremname} +% \begin{macro}{\axiomname} +% \begin{macro}{\postulatename} +% \begin{macro}{\lemmaname} +% \begin{macro}{\propositionname} +% \begin{macro}{\corollaryname} +% \begin{macro}{\examplename} +% \begin{macro}{\exercisename} +% \begin{macro}{\remarkname} +% \begin{macro}{\assumptionname} +% \begin{macro}{\conclusionname} +% 继续设置 +% \begin{macrocode} +\newcommand{\theoremname}{定理} +\newcommand{\axiomname}{公理} +\newcommand{\postulatename}{公设} +\newcommand{\lemmaname}{引理} +\newcommand{\propositionname}{命题} +\newcommand{\corollaryname}{推论} +\newcommand{\examplename}{例} +\newcommand{\exercisename}{练习} +\newcommand{\remarkname}{注} +\newcommand{\assumptionname}{假设} +\newcommand{\conclusionname}{结论} +% \end{macrocode} % \end{macro} % \end{macro} % \end{macro} @@ -1293,7 +1375,7 @@ bottom=30mm, headheight = 2.17cm, headsep = 1mm, - footskip = 0cm, + footskip = 5mm, } % \end{macrocode} % \end{macro} @@ -1332,49 +1414,9 @@ % \end{macrocode} % % \begin{macro}{\setcounter} -% \begin{macro}{\chaptername} -% 更改章节编号样式 +% 更改章节编号深度 % \begin{macrocode} \setcounter{secnumdepth}{3} -\renewcommand{\chaptername}{第 \thechapter\;章} -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\titleformat} -% 设置章节标题样式 -% \begin{macrocode} -\titleformat{\chapter}[hang]{\centering\heiti} -{\filcenter\xiaoer\enspace\heiti{% -\IfAppendix{\appendixname}{\chaptername}\enspace}}{1pt}{\xiaoer} -% \end{macrocode} -% -% 设置节标题样式 -% \begin{macrocode} -\titleformat{\section}[hang]{\heiti} -{\xiaosan\heiti{\thesection}\enspace}{1pt}{\xiaosan\heiti\filright} -% \end{macrocode} -% -% 设置条标题样式 -% \begin{macrocode} -\titleformat{\subsection}[hang]{\heiti} -{\sihao\heiti\thesubsection\enspace}{1pt}{\sihao\heiti\filright} -% \end{macrocode} -% -% 设置四级标题样式 -% \begin{macrocode} -\titleformat{\subsubsection}[hang]{\heiti} -{\xiaosi\heiti\thesubsubsection\enspace}{1pt}{\xiaosi\heiti\filright} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\titlespacing} -% 设置标题与上下文间距 -% \begin{macrocode} -\titlespacing{\chapter}{0pt}{0bp}{14.4bp} -\titlespacing{\section}{0pt}{7.5bp}{7.5bp} -\titlespacing{\subsection}{0pt}{7bp}{7bp} -\titlespacing{\subsubsection}{0pt}{6bp}{6bp} % \end{macrocode} % \end{macro} % @@ -1382,6 +1424,9 @@ % 图表标题设置,字号为small,分割符为空格 % \begin{macrocode} \RequirePackage[font=small,labelsep=quad]{caption} +\ifhitsz@boldcaption + \renewcommand\captionfont{\small\song\bfseries} +\fi % \end{macrocode} % % 标题与图表的间距为3pt @@ -1542,7 +1587,7 @@ % \begin{macrocode} \newenvironment{proof}{ \par\noindent\textbf{\proofname\;} -}{\hfill$\Box$\quad\par} +}{\hfill$\square$\quad\par} % \end{macrocode} % \end{environment} % @@ -1646,7 +1691,7 @@ \end{center} % 日期 \vspace{2.6cm} - {\xiaosi[0]\song\textbf{2020年7月}} + {\xiaosi[0]\song\textbf{2020年6月}} \end{center} %%---------------------------- %% 第二页 @@ -1814,6 +1859,7 @@ {\settowidth\labelwidth{\@biblabel{#1}}% \leftmargin\labelwidth \advance\leftmargin\labelsep + \addtolength{\itemsep}{-1.5ex} \@openbib@code \usecounter{enumiv}% \let\p@enumiv\@empty @@ -1834,7 +1880,6 @@ % 定义页眉页脚 % \begin{macrocode} \RequirePackage{fancyhdr} -\RequirePackage{lastpage} \pagestyle{fancy} % \end{macrocode} % @@ -1879,26 +1924,27 @@ % 1级目录格式 % \begin{macrocode} \titlecontents{chapter}[0pt]{\vspace{1mm}\heiti} -{第\thecontentslabel\,\,章\hskip.5em}{}{\titlerule*[0.5pc]{.}\contentspage} +{\thecontentslabel\hskip.5em}{}{\titlerule*[4pt]{.}\contentspage} % \end{macrocode} % % 2级目录格式 % \begin{macrocode} \titlecontents{section}[25pt]{\songti} -{\thecontentslabel\hskip.5em}{}{\titlerule*[0.5pc]{.}\contentspage} +{\thecontentslabel\hskip.5em}{}{\titlerule*[4pt]{.}\contentspage} % \end{macrocode} % % 3级目录格式 % \begin{macrocode} \titlecontents{subsection}[47pt]{\songti} -{\thecontentslabel\hskip.5em}{}{\titlerule*[0.5pc]{.}\contentspage} +{\thecontentslabel\hskip.5em}{}{\titlerule*[4pt]{.}\contentspage} % \end{macrocode} -% \end{macro} % -% 附录环境设置,暂时无用 +% 附录章节,节标题不计入目录中 +% \changes{v2.2}{2020/03/04}{Omit sections of appendix in toc} % \begin{macrocode} -\RequirePackage[title,titletoc]{appendix} +\g@addto@macro\appendix{\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}} % \end{macrocode} +% \end{macro} % % \begin{environment}{tabular} % 修改表格字号,注意 |tabular| 要放在 |table| 环境里 @@ -2215,10 +2261,10 @@ text centered, draw=black] % \begin{macro}{\vY} % 向量 % \begin{macrocode} -\newcommand\vx{\bf{x}} -\newcommand\vX{\bf{X}} -\newcommand\vy{\bf{y}} -\newcommand\vY{\bf{Y}} +\newcommand\vx{\mathbf{x}} +\newcommand\vX{\mathbf{X}} +\newcommand\vy{\mathbf{y}} +\newcommand\vY{\mathbf{Y}} % \end{macrocode} % \end{macro} % \end{macro} @@ -2290,6 +2336,15 @@ text centered, draw=black] % \subsection{其它} % \label{sec:other} % +% \changes{v2.2}{2020/03/02}{Deal with warnings about PDF string} +% 处理生成的PDF中某些\LaTeX{}命令无法识别的问题 +% \begin{macrocode} +\pdfstringdefDisableCommands{% + \def\quad{}% + \def\hskip#1{}% +} +% \end{macrocode} +% % 在模板文档结束时即装入配置文件,这样用户就能在导言区进行相应的修改。 % \begin{macrocode} \AtEndOfClass{\sloppy} @@ -2408,7 +2463,7 @@ text centered, draw=black] \DeclareDocumentCommand{\file}{s m}{% \texttt{#2}\IfBooleanF#1{\hitsz@special@index{file}{#2}}} \newcommand{\myentry}[1]{% - \marginpar{\raggedleft\color{purple}\bfseries\strut #1}} + \marginpar{\raggedleft\color{purple}\bfseries\small\strut #1}} \newcommand{\note}[2][Note]{{% \color{magenta}{\bfseries #1}\emph{#2}}} diff --git a/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.ins b/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.ins index f3303aab23f..a00405c62ff 100644 --- a/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.ins +++ b/Master/texmf-dist/source/latex/hitszthesis/hitszthesis.ins @@ -1,18 +1,18 @@ %% %% Copyright (C) 2019-2020 by Jingxuan Yang <yanglatex2e@gmail.com> %% -%% This file is part of the HITSZThesis package project. +%% This file is part of the hitszthesis package project. %% ------------------------------------------------------------------------------ %% %% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3 +%% conditions of the LaTeX Project Public License, either version 1.3c %% of this license or (at your option) any later version. %% The latest version of this license is in %% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of LaTeX +%% and version 1.3c or later is part of all distributions of LaTeX %% version 2005/12/01 or later. %% -%% This work has the LPPL maintenance status `maintained'. +%% This work has the LPPL1.3c maintenance status `maintained'. \input docstrip diff --git a/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls b/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls index c4c05b05394..35b4dea5b39 100644 --- a/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls +++ b/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls @@ -23,11 +23,11 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{hitszthesis} -[2020/02/23 v2.1 A Bachelor Thesis Template for Harbin Institute of Technology, ShenZhen +[2020/03/05 v2.3 A Bachelor Thesis Template for Harbin Institute of Technology, ShenZhen (HITSZ)] \RequirePackage{ifxetex} \ifxetex\else - \ClassError{hitszthesis}{Please use XeLaTeX to compile the file}{} + \ClassError{hitszthesis}{Please use XeLaTeX to compile this file}{} \end{document} \fi \RequirePackage{kvoptions} @@ -41,28 +41,106 @@ \DeclareVoidOption{onerow}{\ykv{covertitle = onerow}} \DeclareVoidOption{tworow}{\ykv{covertitle = tworow}} \DeclareStringOption[newtxmath]{mathfont} -\DeclareVoidOption{newtxmath}{\ykv{mathfont = newtxmath}} +\DeclareVoidOption{XITS}{\ykv{mathfont = XITS}} \DeclareVoidOption{mtpro2}{\ykv{mathfont = mtpro2}} +\DeclareVoidOption{mtpro2lite}{\ykv{mathfont = mtpro2lite}} +\DeclareVoidOption{newtxmath}{\ykv{mathfont = newtxmath}} +\DeclareBoolOption[false]{boldcaption} \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{book}} \ProcessKeyvalOptions*\relax \LoadClass[12pt,a4paper,openany,oneside]{book} \RequirePackage{etex} -\RequirePackage[UTF8,space=auto,scheme=plain]{ctex} +\RequirePackage[UTF8,scheme=chinese,zihao=-4,heading=true]{ctex} +\ctexset{% + space = auto, + chapter={ + afterindent=true, + number=\arabic{chapter}, + beforeskip={28.34658bp},%一个空行 1.57481 × 18 + afterskip={24.74658bp},%0.8应该不计算间距 0.8 × 18 + 0.57481×18 + aftername=\enspace, + format={\centering\heiti\xiaoer[1.57481]},%\center 会影响之后全局 + nameformat=\relax, + numberformat=\relax, + fixskip=true, % 添加这一行去除默认间距 + %hang=true, + }, + section={ + afterindent=true, + beforeskip={12bp},%上下空0.5行 + afterskip={13.5bp}, + format={\heiti\fontsize{15bp}{21bp}\selectfont}, + aftername=\enspace, + fixskip=true, + break={}, + }, + subsection={ + afterindent=true, + beforeskip={10bp}, + afterskip={11bp}, + format={\heiti\fontsize{14bp}{18bp}\selectfont}, + aftername=\enspace, + fixskip=true, + break={}, + }, + subsubsection={ + afterindent=true, + beforeskip={9bp}, + afterskip={9bp}, + format={\heiti\normalsize}, + aftername=\enspace, + fixskip=true, + break={}, + }, + paragraph/afterindent=true, + subparagraph/afterindent=true +} \RequirePackage{amsmath} -\RequirePackage[T1]{fontenc} -\RequirePackage{newtxtext} -\ifdefstring{\hitsz@mathfont}{mtpro2}{ -\RequirePackage[mtphrb,mtpcal,zswash,uprightGreek]{mtpro2} +\ifdefstring{\hitsz@mathfont}{XITS}{ + \setmainfont{Times New Roman} + \setsansfont{Arial} + \setmonofont[Scale=MatchLowercase]{Consolas} + \RequirePackage{unicode-math} + \unimathsetup{ + math-style = ISO, + bold-style = ISO, + nabla = upright, + partial = upright, + } + \IfFontExistsTF{XITSMath-Regular.otf}{ + \setmathfont[ + Extension = .otf, + BoldFont = XITSMath-Bold, + StylisticSet = 8, + ]{XITSMath-Regular} + \setmathfont[range={cal,bfcal},StylisticSet=1]{XITSMath-Regular.otf} + }{ + \setmathfont[ + Extension = .otf, + BoldFont = *bold, + StylisticSet = 8, + ]{xits-math} + \setmathfont[range={cal,bfcal},StylisticSet=1]{xits-math.otf} + } + \AtBeginDocument{\renewcommand{\mathbf}{\mathbfup} + \newcommand\square{\mdlgwhtsquare} + } +}{\relax} +\ifdefstring{\hitsz@mathfont}{mtpro2}{% + \RequirePackage{newtxtext} % newtxtext宏包必须加在数学字体宏包之前 + \RequirePackage[mtphrb,mtpcal,zswash,uprightGreek]{mtpro2} +}{\relax} +\ifdefstring{\hitsz@mathfont}{mtpro2lite}{% + \RequirePackage{newtxtext} + \RequirePackage[lite,subscriptcorrection,slantedGreek,nofontinfo]{mtpro2} }{\relax} -\ifdefstring{\hitsz@mathfont}{newtxmath}{ -\RequirePackage{newtxmath} +\ifdefstring{\hitsz@mathfont}{newtxmath}{% + \RequirePackage{newtxtext} + \RequirePackage{newtxmath} \let\openbox\relax }{\relax} -\renewcommand{\rmdefault}{ptm} -\RequirePackage[scaled=0.92]{helvet} \RequirePackage{type1cm} \RequirePackage{lipsum} -\RequirePackage{mathdesign} \setCJKfamilyfont{kai}[AutoFakeBold]{simkai.ttf} \newcommand*{\kai}{\CJKfamily{kai}} \setCJKfamilyfont{song}[AutoFakeBold]{SimSun} @@ -91,12 +169,11 @@ \RequirePackage{calc} \RequirePackage{tikz} \RequirePackage{bm} -\RequirePackage{cases} +\RequirePackage{subeqnarray} \RequirePackage{siunitx} \RequirePackage{pdfpages} \includepdfset{fitpaper=true} \RequirePackage{listings} -\renewcommand{\ttdefault}{cmtt} \lstdefinestyle{ystyle}{ basicstyle=% \ttfamily @@ -175,11 +252,6 @@ \newcommand{\keywordsname}{关键词} \newcommand{\keywordsenname}{Keywords} \renewcommand{\contentsname}{目\quad 录} -\renewcommand{\figurename}{图} -\renewcommand{\tablename}{表} -\renewcommand{\partname}{部分} -\renewcommand{\bibname}{参考文献} -\renewcommand{\appendixname}{附录~\thechapter} \renewcommand{\indexname}{索\quad 引} \newcommand{\notename}{笔记} \renewcommand*{\proofname}{证明} @@ -230,7 +302,7 @@ top=41mm, bottom=30mm, headheight = 2.17cm, headsep = 1mm, -footskip = 0cm, +footskip = 5mm, } \RequirePackage{hyperref} \hypersetup{ @@ -254,21 +326,10 @@ pdfborder={0 0 0}, \RequirePackage[pagestyles]{titlesec} \RequirePackage{apptools} \setcounter{secnumdepth}{3} -\renewcommand{\chaptername}{第 \thechapter\;章} -\titleformat{\chapter}[hang]{\centering\heiti} -{\filcenter\xiaoer\enspace\heiti{% -\IfAppendix{\appendixname}{\chaptername}\enspace}}{1pt}{\xiaoer} -\titleformat{\section}[hang]{\heiti} -{\xiaosan\heiti{\thesection}\enspace}{1pt}{\xiaosan\heiti\filright} -\titleformat{\subsection}[hang]{\heiti} -{\sihao\heiti\thesubsection\enspace}{1pt}{\sihao\heiti\filright} -\titleformat{\subsubsection}[hang]{\heiti} -{\xiaosi\heiti\thesubsubsection\enspace}{1pt}{\xiaosi\heiti\filright} -\titlespacing{\chapter}{0pt}{0bp}{14.4bp} -\titlespacing{\section}{0pt}{7.5bp}{7.5bp} -\titlespacing{\subsection}{0pt}{7bp}{7bp} -\titlespacing{\subsubsection}{0pt}{6bp}{6bp} \RequirePackage[font=small,labelsep=quad]{caption} +\ifhitsz@boldcaption + \renewcommand\captionfont{\small\song\bfseries} +\fi \captionsetup[table]{skip=3pt} \captionsetup[figure]{skip=10pt} \newcommand\figref[1]{图\ref{#1}} @@ -320,7 +381,7 @@ pdfborder={0 0 0}, \itshape}{\par} \newenvironment{proof}{ \par\noindent\textbf{\proofname\;} -}{\hfill$\Box$\quad\par} +}{\hfill$\square$\quad\par} \newenvironment{solution}{\medskip\par\noindent\textbf{\solutionname} \itshape}{\par} \newenvironment{remark}{\noindent\textbf{\remarkname}}{\par} \newenvironment{assumption}{\par\noindent\textbf{\assumptionname}}{\par} @@ -386,7 +447,7 @@ pdfborder={0 0 0}, \end{center} % 日期 \vspace{2.6cm} - {\xiaosi[0]\song\textbf{2020年7月}} + {\xiaosi[0]\song\textbf{2020年6月}} \end{center} %%---------------------------- %% 第二页 @@ -505,6 +566,7 @@ pdfborder={0 0 0}, {\settowidth\labelwidth{\@biblabel{#1}}% \leftmargin\labelwidth \advance\leftmargin\labelsep + \addtolength{\itemsep}{-1.5ex} \@openbib@code \usecounter{enumiv}% \let\p@enumiv\@empty @@ -518,7 +580,6 @@ pdfborder={0 0 0}, {\@latex@warning{Empty `thebibliography' environment}}% \endlist} \RequirePackage{fancyhdr} -\RequirePackage{lastpage} \pagestyle{fancy} \lhead{} \chead{\wuhao 哈尔滨工业大学(深圳)本科毕业设计(论文)} @@ -533,12 +594,12 @@ pdfborder={0 0 0}, {\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi% \makeheadrule}} \titlecontents{chapter}[0pt]{\vspace{1mm}\heiti} -{第\thecontentslabel\,\,章\hskip.5em}{}{\titlerule*[0.5pc]{.}\contentspage} +{\thecontentslabel\hskip.5em}{}{\titlerule*[4pt]{.}\contentspage} \titlecontents{section}[25pt]{\songti} -{\thecontentslabel\hskip.5em}{}{\titlerule*[0.5pc]{.}\contentspage} +{\thecontentslabel\hskip.5em}{}{\titlerule*[4pt]{.}\contentspage} \titlecontents{subsection}[47pt]{\songti} -{\thecontentslabel\hskip.5em}{}{\titlerule*[0.5pc]{.}\contentspage} -\RequirePackage[title,titletoc]{appendix} +{\thecontentslabel\hskip.5em}{}{\titlerule*[4pt]{.}\contentspage} +\g@addto@macro\appendix{\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}} \BeforeBeginEnvironment{tabular}{\wuhao} \AfterEndEnvironment{table}{\vspace{-1cm}} \newcounter{rowno} @@ -614,10 +675,10 @@ text centered, draw=black] \newcommand\mcc{\mathbb{C}} \newcommand\mrr{\mathbb{R}} \newcommand\mzz{\mathbb{Z}} -\newcommand\vx{\bf{x}} -\newcommand\vX{\bf{X}} -\newcommand\vy{\bf{y}} -\newcommand\vY{\bf{Y}} +\newcommand\vx{\mathbf{x}} +\newcommand\vX{\mathbf{X}} +\newcommand\vy{\mathbf{y}} +\newcommand\vY{\mathbf{Y}} \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\arccot}{arccot} \DeclareMathOperator{\arccosh}{arccosh} @@ -642,6 +703,10 @@ text centered, draw=black] \makebox[\textheight]{本科毕业设计(论文)\hfill \hitsztitle \hfill \hitszauthor} } } +\pdfstringdefDisableCommands{% + \def\quad{}% + \def\hskip#1{}% +} \AtEndOfClass{\sloppy} \endinput %% diff --git a/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty b/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty index 8b6c62e1fb9..392775978cb 100644 --- a/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty +++ b/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty @@ -2,16 +2,16 @@ % Copyright (C) 2019-2020 by Jingxuan Yang <yanglatex2e@gmail.com> % % This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 +% conditions of the LaTeX Project Public License, either version 1.3c % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX +% and version 1.3c or later is part of all distributions of LaTeX % version 2005/12/01 or later. % -% This work has the LPPL maintenance status `maintained'. +% This work has the LPPL1.3c maintenance status `maintained'. % -\ProvidesPackage{hitszthesis}[2020/02/23 v2.1 A Collection of Styles for Bachelor Thesis of Harbin Institute of Technology, ShenZhen] +\ProvidesPackage{hitszthesis}[2020/03/05 v2.2 A Collection of Styles for Bachelor Thesis of Harbin Institute of Technology, ShenZhen] % 将引入的宏包以及各种自定义命令都放在这里 % 在 \file{main.tex} 中使用 |\usepackage{hitszthesis}| 引入本文件 |