summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hithesis/hithesis.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-08-28 23:41:38 +0000
committerKarl Berry <karl@freefriends.org>2017-08-28 23:41:38 +0000
commitc0f658f5498ff551dec3709ab78a6c5a3d866752 (patch)
tree832b7d4b9c3c0d1aac20bc8d1c2f9f6b77ade4fb /Master/texmf-dist/tex/latex/hithesis/hithesis.sty
parent562cf4801c5cc3c04317bbdaafc94eec984c0d94 (diff)
hithesis (27aug17)
git-svn-id: svn://tug.org/texlive/trunk@45155 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/hithesis/hithesis.sty')
-rw-r--r--Master/texmf-dist/tex/latex/hithesis/hithesis.sty90
1 files changed, 90 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/hithesis/hithesis.sty b/Master/texmf-dist/tex/latex/hithesis/hithesis.sty
new file mode 100644
index 00000000000..11c154a8795
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/hithesis/hithesis.sty
@@ -0,0 +1,90 @@
+\ProvidesPackage{hithesis}[2017/08/25 1.0.0 Harbin Institute of Technology
+Thesis Template Extension]
+% 此文件声明不在规范中要求的格式所使用的宏包。
+% (所以,格式基本上是自由发挥的。)
+
+% 处理数学公式中的黑斜体的宏包
+\RequirePackage{bm}
+% 不同于 \mathcal \mathfrak 之类的英文花体字体
+\RequirePackage{mathrsfs}
+% 支持彩色
+\RequirePackage{color}
+% 图形和表格的控制旋转
+\RequirePackage{rotating}
+
+% 算法的宏包,注意宏包兼容性,先后顺序为float、hyperref、algorithm(2e),否则无法
+% 生成算法列表。我工算法混乱问题详见hithesis文档。各个实验室设置具体方法详见
+% hithesis文档或者示例中给出的地址。
+\RequirePackage[boxed,linesnumbered,algochapter]{algorithm2e}
+\newcommand{\algoenname}{Algo.} %算法英文标题
+\newfloatlist[chapter]{algoen}{aen}{\listalgoenname}{\algoenname}
+\newfixedcaption{\algoencaption}{algoen}
+\renewcommand{\thealgoen}{\thechapter-\arabic{algocf}}
+\renewcommand{\@cftmakeaentitle}{\chapter*{\listalgoenname\@mkboth{\bfseries\listalgoenname}{\bfseries\listalgoenname}}
+}
+\renewcommand{\algorithmcfname}{算法}
+\setlength\AlCapSkip{1.2ex}
+\SetAlgoSkip{1pt}
+\renewcommand{\algocf@captiontext}[2]{\wuhao#1\algocf@typo ~ \AlCapFnt{}#2} % text of caption
+\expandafter\ifx\csname algocf@within\endcsname\relax% if \algocf@within doesn't exist
+\renewcommand\thealgocf{\@arabic\c@algocf} % and the way it is printed
+\else% else
+\renewcommand\thealgocf{\csname the\algocf@within\endcsname-\@arabic\c@algocf}
+\fi
+\renewcommand{\algocf@makecaption}[2]{%中英文双标题一定多于一行,因此去掉单行时的判断,并将\parbox中标题设置为居中
+ \addtolength{\hsize}{\algomargin}%
+ \sbox\@tempboxa{\algocf@captiontext{#1}{#2}}%
+ \hskip .5\algomargin%
+ \parbox[t]{\hsize}{\centering\algocf@captiontext{#1}{#2}}%
+ \addtolength{\hsize}{-\algomargin}%
+}
+\newcommand{\AlgoBiCaption}[2]{%直接取出自定义的中英文标题条目加入到真正的\caption 中
+ \caption[#1]{\protect\setlength{\baselineskip}{1.5em}#1 \protect \\ Algo. \thealgocf~~ #2} % \algoencaption{#2}
+ \addcontentsline{aen}{algoen}{\protect\numberline{\thealgoen}{#2}}
+}
+
+% 排版源码所使用的环境可以有两种。listings和minted
+\RequirePackage{listings}
+\lstset{
+% basicstyle=\small\ttfamily,
+columns=flexible,
+breaklines=true
+}
+
+% 或者使用minted 包。如果使用该包,需要在编译时加-shell-escape选项,且需要安装
+% pygmentatize 工具对代码进行高亮。
+% \RequirePackage{minted}
+%
+
+% 术语宏包,用来处理首次全写,之后缩写的问题
+\RequirePackage{glossaries}
+\makeglossaries
+% 添加术语举例
+% \newacronym{dual}{DLP}{对偶规划(Dual linear programming, DLP)}
+
+% tikz做图宏宏包
+\usepackage{tikz}
+% 此处可以定义一些tikz全局样式
+% \tikzstyle{nodestyle}= [circle, fill=gray!60]
+% \tikzstyle{edgestyle}= [-latex]
+
+
+% 最后定义一些常见的数学公式样式。格式和内容分离,是LaTeX的巨大优势
+% 例如如下定义:
+\newcommand{\theVector}[1]{\bm{#1}}
+\newcommand{\theMatrix}[1]{\mathbb{#1}}
+\newcommand{\theSet}[1]{\mathcal{#1}}
+\newcommand{\theDirected}[1]{{\overrightarrow{#1}}}
+\newcommand{\theUndirected}[1]{{\overline{#1}}}
+\newcommand{\theNetwork}[1]{\mathscr{#1}}
+\newcommand{\theNode}[1]{{\text{#1}}}
+\newcommand{\theDirectedEdge}[2]{{\overrightarrow{{#1}{#2}}}}
+\newcommand{\theUndirectedEdge}[2]{{\overline{{#1}{#2}}}}
+% 如果想要修改论文中所有的表示网络的数学符号的样式,不必在正文中处处修改,只需要
+% 在这里修改就可以了。
+
+% 定义命令
+\def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}}
+\def\cmd@to@cs#1#2{\char\number`#2\relax}
+\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
+\endinput