diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls | 1907 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty | 448 |
2 files changed, 1722 insertions, 633 deletions
diff --git a/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls b/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls index 35b4dea5b39..52c8f4018c0 100644 --- a/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls +++ b/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls @@ -10,269 +10,278 @@ %% %% 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 +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3a %% 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 -%% version 2005/12/01 or later. +%% The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3a or later is part of all distributions of LaTeX +%% version 2004/10/01 or later. %% %% To produce the documentation run the original source files ending with `.dtx' %% through LaTeX. %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{hitszthesis} -[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 this file}{} - \end{document} -\fi +[2020/03/10 3.0 Dissertation Template for Harbin Institute of Technology, ShenZhen (HITSZ)] +\RequirePackage{ifthen} \RequirePackage{kvoptions} -\RequirePackage{etoolbox} -\SetupKeyvalOptions{family=hitsz, prefix=hitsz@, setkeys=\kvsetkeys} -\newcommand{\ykv}[1]{\kvsetkeys{hitsz}{#1}} -\DeclareStringOption[infocenter]{infoalign} -\DeclareVoidOption{infocenter}{\ykv{infoalign = infocenter}} -\DeclareVoidOption{infoleft}{\ykv{infoalign = infoleft}} -\DeclareStringOption[onerow]{covertitle} -\DeclareVoidOption{onerow}{\ykv{covertitle = onerow}} -\DeclareVoidOption{tworow}{\ykv{covertitle = tworow}} -\DeclareStringOption[newtxmath]{mathfont} -\DeclareVoidOption{XITS}{\ykv{mathfont = XITS}} -\DeclareVoidOption{mtpro2}{\ykv{mathfont = mtpro2}} -\DeclareVoidOption{mtpro2lite}{\ykv{mathfont = mtpro2lite}} -\DeclareVoidOption{newtxmath}{\ykv{mathfont = newtxmath}} +\SetupKeyvalOptions{ + family=hitsz, + prefix=hitsz@, + setkeys=\kvsetkeys} +\newif\ifhitsz@bachelor +\newif\ifhitsz@master +\newif\ifhitsz@doctor +\define@key{hitsz}{type}{% + \hitsz@bachelorfalse + \hitsz@masterfalse + \hitsz@doctorfalse + \expandafter\csname hitsz@#1true\endcsname} +\newif\ifhitsz@shenzhen +\newif\ifhitsz@weihai +\newif\ifhitsz@harbin +\define@key{hitsz}{campus}{% + \hitsz@shenzhenfalse + \hitsz@weihaifalse + \hitsz@harbinfalse + \expandafter\csname hitsz@#1true\endcsname} +\ifhitsz@harbin + \relax +\else + \ifhitsz@weihai + \relax + \else + \hitsz@shenzhentrue + \fi +\fi +\DeclareBoolOption[false]{arialtoc} +\DeclareBoolOption[false]{arialtitle} +\DeclareBoolOption[false]{infoleft} +\DeclareBoolOption[false]{covertitletworow} \DeclareBoolOption[false]{boldcaption} -\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{book}} -\ProcessKeyvalOptions*\relax -\LoadClass[12pt,a4paper,openany,oneside]{book} +\DeclareBoolOption[true]{raggedbottom} +\DeclareBoolOption[false]{pifootnote} +\DeclareBoolOption[false]{glue} +\DeclareBoolOption[false]{tocfour} +\DeclareBoolOption[false]{tocblank} +\DeclareBoolOption[true]{chapterhang} +\DeclareBoolOption[true]{fulltime} +\DeclareBoolOption[false]{subtitle} +\DeclareBoolOption[false]{debug} +\DeclareBoolOption[false]{openright} +\DeclareBoolOption[false]{library} +\DeclareBoolOption[true]{capcenterlast} +\DeclareBoolOption[true]{subcapcenterlast} +\DeclareBoolOption[true]{absupper} +\DeclareBoolOption[true]{bsmainpagenumberline} +\DeclareBoolOption[true]{bsfrontpagenumberline} +\DeclareBoolOption[true]{bsheadrule} +\newif\ifhitsz@newtxmath +\newif\ifhitsz@mtprotwolite +\newif\ifhitsz@mtprotwo +\define@key{hitsz}{mathfont}{% + \hitsz@newtxmathfalse + \hitsz@mtprotwolitefalse + \hitsz@mtprotwofalse + \expandafter\csname hitsz@#1true\endcsname} +\ifhitsz@mtprotwolite + \relax +\else + \ifhitsz@mtprotwo + \relax + \else + \hitsz@newtxmathtrue + \fi +\fi +\DeclareBoolOption[false]{splitbibitem} +\DeclareStringOption{fontset} +\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}} +\ProcessKeyvalOptions* +\PassOptionsToPackage{no-math}{fontspec} +\ifhitsz@bachelor +\PassOptionsToClass{oneside}{book} +\fi +\ifhitsz@master +\PassOptionsToClass{oneside}{book} +\fi +\ifhitsz@doctor +\PassOptionsToClass{twoside}{book} +\fi +\ifthenelse% +{\equal{\hitsz@fontset}{}}% +{% + \PassOptionsToPackage{AutoFakeBold=2}{xeCJK} +}% +{% + \ifthenelse% + {\equal{\hitsz@fontset}{siyuan}}% + {\relax}% + {% + \PassOptionsToPackage{AutoFakeBold=2}{xeCJK} + }% + \PassOptionsToClass{fontset=\hitsz@fontset}{ctexbook} +}% \RequirePackage{etex} -\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 -} +\LoadClass[a4paper,openany,UTF8,zihao=-4,scheme=plain]{ctexbook} +\ifhitsz@bachelor\relax\else + \ifhitsz@master\relax\else + \ifhitsz@doctor\relax\else + \ClassError{hitszthesis}% + {Please specify thesis type in option: \MessageBreak + type=[bachelor | master | doctor]}{} + \fi + \fi +\fi +\RequirePackage{etoolbox} +\RequirePackage{ifxetex} +\ifxetex +\else + \ClassError{hitszthesis}% + {Please use: \MessageBreak + xelatex}{} +\fi +\RequirePackage{xparse} \RequirePackage{amsmath} -\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{newtxtext} +\RequirePackage[amsmath,thmmarks,hyperref]{ntheorem} +\RequirePackage{amssymb} +\RequirePackage[defaultsups]{newtxtext} +\ifhitsz@newtxmath \RequirePackage{newtxmath} -\let\openbox\relax -}{\relax} -\RequirePackage{type1cm} -\RequirePackage{lipsum} -\setCJKfamilyfont{kai}[AutoFakeBold]{simkai.ttf} -\newcommand*{\kai}{\CJKfamily{kai}} -\setCJKfamilyfont{song}[AutoFakeBold]{SimSun} -\newcommand*{\song}{\CJKfamily{song}} -\linespread{1.3} -\RequirePackage{multicol} -\RequirePackage{fancyvrb} -\RequirePackage{titletoc} -\RequirePackage{xcolor} +\else + \ifhitsz@mtprotwolite + \let\Bbbk\relax + \RequirePackage[lite,subscriptcorrection,slantedGreek,nofontinfo]{mtpro2} + \else + \ifhitsz@mtprotwo + \let\Bbbk\relax + \RequirePackage[mtphrb,mtpcal,zswash,uprightGreek]{mtpro2} + \fi + \fi +\fi \RequirePackage{graphicx} -\RequirePackage{array} +\RequirePackage{pdfpages} +\includepdfset{fitpaper=true} +\RequirePackage{enumitem} %使用enumitem宏包,改变列表项的格式 +\RequirePackage{environ} +\ifhitsz@raggedbottom + \RequirePackage[bottom,perpage,hang]{footmisc} + \raggedbottom +\else + \RequirePackage[perpage,hang]{footmisc} +\fi +\ifhitsz@pifootnote + \RequirePackage{pifont} +\fi +\RequirePackage{CJKfntef} \RequirePackage{longtable} \RequirePackage{booktabs} -\RequirePackage{multirow} -\RequirePackage{bigstrut} -\RequirePackage{bigdelim} -\RequirePackage{cprotect} -\RequirePackage{enumitem} -\RequirePackage{listings} -\RequirePackage{hyperref} -\RequirePackage{indentfirst} -\setlength\parindent{2em} -\RequirePackage{caption} -\RequirePackage{float} -\RequirePackage{ulem} -\RequirePackage{calc} -\RequirePackage{tikz} -\RequirePackage{bm} +\RequirePackage[sort&compress]{natbib} \RequirePackage{subeqnarray} -\RequirePackage{siunitx} -\RequirePackage{pdfpages} -\includepdfset{fitpaper=true} -\RequirePackage{listings} -\lstdefinestyle{ystyle}{ - basicstyle=% - \ttfamily - \lst@ifdisplaystyle\small\fi +\RequirePackage{hyperref} +\hypersetup{% + CJKbookmarks=true, + linktoc=all, + bookmarksnumbered=true, + bookmarksopen=true, + bookmarksopenlevel=3, + pdfcreator={XeLaTeX with hitszthesis class}, + breaklinks=true, + colorlinks=false, + plainpages=false, + pdfstartview=FitH, + pdfborder={0 0 0} } -\lstset{basicstyle = \ttfamily, style = ystyle, breaklines = true} -\definecolor{lightgrey}{rgb}{0.9,0.9,0.9} -\definecolor{frenchplum}{RGB}{190,20,83} -\definecolor{winered}{rgb}{0.5,0,0} -\lstset{language = [LaTeX]TeX, - texcsstyle = *\color{winered}, - numbers = none, - mathescape, - breaklines = true, - keywordstyle = \color{winered}, - commentstyle = \color{gray}, - emph = {hitszpaper,fontenc,fontspec,xeCJK,FiraMono,xunicode,newtxmath, - figure,fig,image,img,table,itemize,enumerate,newtxtext,newtxtt, - ctex, microtype,description,times,newtx,booktabs,tabular, - PDFLaTeX,XeLaTeX,type1cm,BibTeX,device,color,mode,lang, - amsthm,tcolorbox,titlestyle,cite,marginnote,ctex,listings,base, - subnumcases}, - emphstyle = {\color{frenchplum}}, - morekeywords = {DeclareSymbolFont,SetSymbolFont,toprule,midrule,bottomrule, - institute,version,includegraphics,setmainfont,setsansfont, - setmonofont,setCJKmainfont,setCJKsansfont,setCJKmonofont, - RequirePackage,figref, tabref,email,maketitle,keywords,definecolor, - extrainfo,logo,cover,subtitle,appendix,chapter,hypersetup, - mainmatter,frontmatter,tableofcontents, hitszpar,heiti,kaishu,lstset, - pagecolor,zhnumber,marginpar,part, equote,marginnote}, - frame = single, - tabsize = 2, - rulecolor = \color{black}, - framerule = 0.2pt, - columns = flexible, - % backgroundcolor = \color{lightgrey} +\urlstyle{same} +\ifhitsz@debug + \RequirePackage[showframe]{geometry} +\else + \RequirePackage{geometry} +\fi +\geometry{ + a4paper, % 210 * 297mm + hcentering, + ignoreall, + nomarginpar, } -\newcommand\hitsz@tokens@thesistitle{} -\newcommand\hitsz@tokens@keywords{} -\newcommand\hitsz@tokens@keywordsen{} -\newcommand*\hitsz@tokens@papercategory{} -\newcommand*\hitsz@tokens@schoolname{} -\newcommand*\hitsz@tokens@departname{} -\newcommand*\hitsz@tokens@dateinput{} -\newcommand*\hitsz@tokens@authorname{} -\newcommand*\hitsz@tokens@studentID{} -\newcommand*\hitsz@tokens@majorin{} -\newcommand*\hitsz@tokens@instructor{} -\newcommand*\hitsz@tokens@titleone{} -\newcommand*\hitsz@tokens@titletwo{} -\newcommand*\thesistitle[1]{% -\renewcommand{\hitsz@tokens@thesistitle}{#1}} -\newcommand*\papercategory[1]{% -\renewcommand{\hitsz@tokens@papercategory}{#1}} -\newcommand*\schoolname[1]{% -\renewcommand{\hitsz@tokens@schoolname}{#1}} -\newcommand*\departname[1]{% -\renewcommand{\hitsz@tokens@departname}{#1}} -\newcommand*\dateinput[1]{% -\renewcommand{\hitsz@tokens@dateinput}{#1}} -\newcommand*\authorname[1]{% -\renewcommand{\hitsz@tokens@authorname}{#1}} -\newcommand*\studentID[1]{% -\renewcommand{\hitsz@tokens@studentID}{#1}} -\newcommand*\majorin[1]{% -\renewcommand{\hitsz@tokens@majorin}{#1}} -\newcommand*\instructor[1]{% -\renewcommand{\hitsz@tokens@instructor}{#1}} -\newcommand*\titleone[1]{% -\renewcommand{\hitsz@tokens@titleone}{#1}} -\newcommand*\titletwo[1]{% -\renewcommand{\hitsz@tokens@titletwo}{#1}} -\renewcommand\listfigurename{插图目录} -\renewcommand\listtablename{附表目录} -\renewcommand\abstractname{摘\quad 要} -\newcommand{\keywordsname}{关键词} -\newcommand{\keywordsenname}{Keywords} -\renewcommand{\contentsname}{目\quad 录} -\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}{结论} -\newcommand{\solutionname}{解} -\newcommand{\propertyname}{性质} +\geometry{% 版芯高度 = textheight(224) + head(5) + headsep(3) + footskip(8) = 240 mm + text={150true mm,224true mm}, + top=37.5true mm, + left=30true mm, + head=5true mm, + headsep=3true mm, + footskip=0true mm, + foot=8true mm +} +\ifhitsz@debug% +\RequirePackage{layout} +\RequirePackage{layouts} +\RequirePackage{lineno} +\fi +\RequirePackage{fancyhdr} +\RequirePackage{tabularx} +\RequirePackage{varwidth} +\RequirePackage{changepage} +\RequirePackage{multicol} +\RequirePackage[below]{placeins}%允许上一个section的浮动图形出现在下一个section的开始部分,还提供\FloatBarrier命令,使所有未处理的浮动图形立即被处理 +\RequirePackage{flafter} % 使得所有浮动体不能被放置在其浮动环境之前,以免浮动体在引述它的文本之前出现. +\RequirePackage{multirow} %使用Multirow宏包,使得表格可以合并多个row格 +\ifhitsz@subcapcenterlast +\PassOptionsToPackage{centerlast}{subfigure} +\fi +\RequirePackage{subfigure}%支持子图 %centerlast 设置最后一行是否居中 +\RequirePackage[subfigure]{ccaption} %支持双语标题 +\RequirePackage[makeindex]{splitidx} +\newindex[]{china} +\newindex[]{english} +\RequirePackage{xltxtra} +\ifhitsz@library + \hitsz@openrightfalse +\else + \relax +\fi +\let\hitsz@cleardoublepage\cleardoublepage +\newcommand{\hitsz@clearemptydoublepage}{% + \clearpage{\pagestyle{hitsz@empty}\hitsz@cleardoublepage} +} +\let\cleardoublepage\hitsz@clearemptydoublepage +\renewcommand\frontmatter{% + \ifhitsz@openright\cleardoublepage\else\clearpage\fi + \@mainmatterfalse + \pagenumbering{Roman} + \pagestyle{hitsz@empty} +} +\renewcommand\mainmatter{% + \ifhitsz@tocblank% + \addtocontents{toc}{\vspace{\baselineskip}} + \addtocontents{toe}{\vspace{\baselineskip}} + \fi% + \ifhitsz@doctor% + \ifhitsz@library\clearpage\else\cleardoublepage\fi + \else% + \clearpage + \fi% + \@mainmattertrue + \pagenumbering{arabic} + \pagestyle{hitsz@headings} +} +\renewcommand\backmatter{% + \ifhitsz@openright\cleardoublepage\else\clearpage\fi + \@mainmattertrue} +\renewcommand\normalsize{% + \@setfontsize\normalsize{12bp}{ \ifhitsz@glue 20.50398bp \@plus 2.83465bp \@minus 0bp + \else 19.27374bp + \fi}% + \abovedisplayskip=8pt + \abovedisplayshortskip=8pt + \belowdisplayskip=\abovedisplayskip + \belowdisplayshortskip=\abovedisplayshortskip} \def\hitsz@def@fontsize#1#2{% \expandafter\newcommand\csname #1\endcsname[1][1.3]{% \fontsize{#2}{##1\dimexpr #2}\selectfont}} +\hitsz@def@fontsize{dachu}{58bp} \hitsz@def@fontsize{chuhao}{42bp} \hitsz@def@fontsize{xiaochu}{36bp} \hitsz@def@fontsize{yihao}{26bp} @@ -291,422 +300,1074 @@ \hitsz@def@fontsize{xiaoliu}{6.5bp} \hitsz@def@fontsize{qihao}{5.5bp} \hitsz@def@fontsize{bahao}{5bp} -\graphicspath{{./figure/}{./figures/}{./image/}{./images/} -{./graphics/}{./graphic/}{./pictures/}{./picture/}{./front/}} -\RequirePackage{geometry} -\geometry{ -a4paper, -left=30mm, -right=30mm, -top=41mm, -bottom=30mm, -headheight = 2.17cm, -headsep = 1mm, -footskip = 5mm, +\let\hitsz@headrule\headrule +\fancypagestyle{hitsz@empty}{% + \fancyhf{} + \let\headrule\hitsz@headrule% + \renewcommand{\headrulewidth}{0pt} + \renewcommand{\footrulewidth}{0pt} } -\RequirePackage{hyperref} -\hypersetup{ -breaklinks, -unicode, -linktoc=all, -bookmarksnumbered=true, -bookmarksopen=true, -pdfsubject={哈尔滨工业大学(深圳)本科毕业设计(论文)}, -pdftitle = {哈尔滨工业大学(深圳)本科毕业设计(论文)}, -pdfauthor = {杨敬轩}, -pdfkeywords={HITSZThesis, Dissertation}, -pdfcreator={XeLaTeX with hitszthesis class}, -colorlinks, -linkcolor=black, -citecolor=black, -plainpages=false, -pdfstartview=FitH, -pdfborder={0 0 0}, +\fancypagestyle{hitsz@headings}{% + \fancyhf{} + \ifhitsz@doctor + \fancyhead[CO]{\songti\xiaowu[0]\leftmark} + \ifhitsz@harbin + \fancyhead[CE]{\songti\xiaowu[0]\hitsz@cschoolname\hitsz@cdegree\hitsz@cthesisname} + \fi + \ifhitsz@shenzhen + \fancyhead[CE]{\songti\xiaowu[0]% + \hitsz@cschoolname\hitsz@cdegree\hitsz@cthesisname} + \fi + \ifhitsz@weihai + \fancyhead[CE]{\songti\xiaowu[0]% + \hitsz@cschoolname\hitsz@weihaicampus\hitsz@cdegree\hitsz@cthesisname} + \fi + \else + \ifhitsz@master + \ifhitsz@harbin + \fancyhead[C]{\songti\xiaowu[0]% + \hitsz@cschoolname\hitsz@cdegree\hitsz@cthesisname} + \fi + \ifhitsz@shenzhen + \fancyhead[C]{\songti\xiaowu[0]% + \hitsz@cschoolname\hitsz@cdegree\hitsz@cthesisname} + \fi + \ifhitsz@weihai + \fancyhead[C]{\songti\xiaowu[0]% + \hitsz@cschoolname\hitsz@weihaicampus\hitsz@cdegree\hitsz@cthesisname} + \fi + \fi + \fi + \ifhitsz@bachelor + \ifhitsz@harbin + \fancyhead[C]{\songti\xiaowu[0]% + \hitsz@cschoolname\hitsz@bachelor@cxuewei\hitsz@bachelor@cthesisname}% + \fi + \ifhitsz@shenzhen + \fancyhead[C]{\songti\xiaowu[0]% + \hitsz@cschoolname\hitsz@shenzhencampus\hitsz@bachelor@cxuewei\hitsz@bachelor@cthesisname}% + \fi + \ifhitsz@weihai + \fancyhead[C]{\songti\xiaowu[0]% + \hitsz@cschoolname\hitsz@weihaicampus\hitsz@bachelor@cxuewei\hitsz@bachelor@cthesisname}% + \fi + \fancyfoot[C]{\xiaowu% + \if@mainmatter% + \ifhitsz@bsmainpagenumberline-~\thepage~- + \else\thepage + \fi + \else% + \ifhitsz@bsfrontpagenumberline-~\thepage~- + \else\thepage + \fi + \fi + } + \ifhitsz@bsheadrule + \renewcommand{\headrule}{ + \vskip 1.190132pt + \hrule\@height2.276208pt\@width\headwidth + \vskip 0.75pt + \hrule\@height.75pt\@width\headwidth + } + \else + \renewcommand{\headrulewidth}{0pt} + \fi + \else% + \fancyfoot[C]{\xiaowu-~\thepage~-} + \renewcommand{\headrule}{% + \vskip 1.190132pt + \hrule\@height2.276208pt\@width\headwidth + \vskip 0.75pt + \hrule\@height.75pt\@width\headwidth + } + \fi + % 页眉中小五汉字,0行距时,占用9bt,页眉高度为14pt, + % 所以页眉中headrule四个距离之和要保持等于 14pt - 9bt = 4.96634pt + \renewcommand{\footrulewidth}{0pt} } -\RequirePackage[pagestyles]{titlesec} -\RequirePackage{apptools} -\setcounter{secnumdepth}{3} -\RequirePackage[font=small,labelsep=quad]{caption} -\ifhitsz@boldcaption - \renewcommand\captionfont{\small\song\bfseries} +\AtBeginDocument{%此处解决页眉经典bug + \pagestyle{hitsz@empty} + \renewcommand{\chaptermark}[1]{\@mkboth{\CTEXthechapter\enspace#1}{}}} +\ctexset{% + punct=quanjiao, + space=auto, + autoindent=true} +\setlist{nosep} +\def\hitsz@textcircled#1{% + \ifnum\value{#1} >9 + \ClassError{hitszszthesis}% + {Too many footnotes in this page.}{Keep footnote less than 10.} + \fi + \ifhitsz@pifootnote% + \ding{\the\numexpr\value{#1}+171\relax}% + \else% + \textcircled{\xiaoliu\arabic{#1}}% + \fi} +\renewcommand{\thefootnote}{\hitsz@textcircled{footnote}} +\renewcommand{\thempfootnote}{\hitsz@textcircled{mpfootnote}} +\def\footnoterule{\vskip-3\p@\hrule\@width0.3\textwidth\@height0.4\p@\vskip2.6\p@} +\let\hitsz@footnotesize\footnotesize +\renewcommand\footnotesize{\hitsz@footnotesize\xiaowu[1.5]} +\footnotemargin1.5em\relax +\let\hitsz@makefnmark\@makefnmark +\def\hitsz@@makefnmark{\hbox{{\normalfont\@thefnmark}}} +\pretocmd{\@makefntext}{\let\@makefnmark\hitsz@@makefnmark}{}{} +\apptocmd{\@makefntext}{\let\@makefnmark\hitsz@makefnmark}{}{} +\allowdisplaybreaks[4] +\predisplaypenalty=0 %公式之前可以换页,公式出现在页面顶部 +\postdisplaypenalty=0 +\renewcommand\theequation{\ifnum \c@chapter>\z@ \thechapter-\fi\@arabic\c@equation} +\def\make@df@tag{\@ifstar\hitsz@make@df@tag@@\make@df@tag@@@} +\def\hitsz@make@df@tag@@#1{\gdef\df@tag{\hitsz@maketag{#1}\def\@currentlabel{#1}}} +\iffalse +\ifhitsz@bachelor + \def\hitsz@maketag#1{\maketag@@@{% + (\ignorespaces\text{\equationname\hskip0.5em}#1\unskip\@@italiccorr)}} + \def\tagform@#1{\maketag@@@{% + (\ignorespaces\text{\equationname\hskip0.5em}#1\unskip\@@italiccorr)\equcaption{#1}}} \fi -\captionsetup[table]{skip=3pt} -\captionsetup[figure]{skip=10pt} +\fi +\def\hitsz@maketag#1{\maketag@@@{(\ignorespaces #1\unskip\@@italiccorr)}} +\def\tagform@#1{\maketag@@@{(\ignorespaces #1\unskip\@@italiccorr)\equcaption{#1}}} +\renewcommand{\eqref}[1]{\textup{(\ref{#1})}} +\setlength{\intextsep}{\ifhitsz@glue 8.50398bp \@plus 2.83465bp \@minus 0bp\else 8.50398bp\fi} +\setlength{\textfloatsep}{\ifhitsz@glue 8.50398bp \@plus 2.83465bp \@minus 0bp\else 8.50398bp\fi} +\setlength{\floatsep}{\ifhitsz@glue 12bp \@plus 2.83465bp \@minus 0bp\else 12bp\fi} +\g@addto@macro\appendix{\renewcommand*{\thefigure}{\thechapter-\arabic{figure}}} +\g@addto@macro\appendix{\renewcommand*{\thetable}{\thechapter-\arabic{table}}} +\g@addto@macro\appendix{\renewcommand*{\theequation}{\thechapter-\arabic{equation}}} +\renewcommand{\textfraction}{0.15} +\renewcommand{\topfraction}{0.85} +\renewcommand{\bottomfraction}{0.65} +\renewcommand{\floatpagefraction}{0.60} +\long\def\@makecaption#1#2{% + \vskip\abovecaptionskip + \ifhitsz@boldcaption\songti\bfseries\fi + \wuhao\sbox\@tempboxa{#1\ifhitsz@bachelor\hskip\ccwd\else\enskip\fi#2}% + \ifdim \wd\@tempboxa >\hsize + \ifhitsz@capcenterlast% + \vskip 6.3bp% + {\setbox0=\vbox{#1\ifhitsz@bachelor\hskip\ccwd\else\enskip\fi#2} + \setbox1=\vbox{% + \unvbox0 + \setbox2=\lastbox + \hbox to \textwidth{\hfill\unhcopy2 \unskip\unskip\hfill} + } + \unvbox1} + \else% + #1\ifhitsz@bachelor\hskip\ccwd\else\enskip\fi#2% + \fi% + \par + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi +\vskip\belowcaptionskip} +\renewcommand*{\longbionenumcaption}[7]{% +\@if@contemptyarg{#1}{\caption{#2}}{\caption[#1]{#2}}% +\global\let\@cont@oldtablename\tablename +\gdef\tablename{#3} +\global\let\LT@c@ption\@cont@LT@nonumintoc +\\[#6] +\@if@contemptyarg{#4}{\caption{#5}}{\caption[#4]{#5}}% +\global\let\tablename\@cont@oldtablename +\global\let\LT@c@ption\@cont@oldLT@c@ption +\vspace{#7}} +\let\hitsz@LT@array\LT@array +\def\LT@array{\wuhao\hitsz@LT@array} % set default font size +\newcommand{\ltfontsize}[1]{\def\LT@array{#1\hitsz@LT@array}} +\renewcommand{\thesubtable}{(\alph{subtable})} +\renewcommand{\thefigure}{\arabic{chapter}-\arabic{figure}}%使图编号为 7-1 的格式 %\protect{~} +\renewcommand{\thesubfigure}{\alph{subfigure})}%使子图编号为 a)的格式 +\renewcommand{\p@subfigure}{\thefigure~} %使子图引用为 7-1 a) 的格式,母图编号和子图编号之间用~加一个空格 +\renewcommand{\thetable}{\arabic{chapter}-\arabic{table}}%使表编号为 7-1 的格式 \newcommand\figref[1]{图\ref{#1}} \newcommand\tabref[1]{表\ref{#1}} \newcommand\equref[1]{式(\ref{#1})} -\setlist{nolistsep} -\RequirePackage{amsthm} -\let\proof\relax -\let\endproof\relax -\newtheoremstyle{ydefstyle}{3pt}{3pt}{\itshape}{}{\bfseries}{}{% -0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}} -\newtheoremstyle{ythmstyle}{3pt}{3pt}{\itshape}{}{\bfseries}{}{% -0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}} -\newtheoremstyle{yprostyle}{3pt}{3pt}{\itshape}{}{\bfseries}{}{% -0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}} -\theoremstyle{ydefstyle} -\newtheorem{ydefinition}{\definitionname }[chapter] -\theoremstyle{ythmstyle} -\newtheorem{ytheorem}{\theoremname }[chapter] -\newtheorem{ylemma}{\lemmaname }[chapter] -\newtheorem{ycorollary}{\corollaryname }[chapter] -\newtheorem{ypostulate}{\postulatename }[chapter] -\newtheorem{yaxiom}{\axiomname }[chapter] -\theoremstyle{yprostyle} -\newtheorem{yproposition}{\propositionname }[chapter] -\newenvironment{theorem}[2] - {\ifstrempty{#1}{\ytheorem}{\ytheorem[#1]}\ifstrempty{#2}{}{\label{#2}}} - {\endytheorem} -\newenvironment{definition}[2] - {\ifstrempty{#1}{\ydefinition}{\ydefinition[#1]}\ifstrempty{#2}{}{\label{#2}}} - {\endydefinition} -\newenvironment{lemma}[2] - {\ifstrempty{#1}{\ylemma}{\ylemma[#1]}\ifstrempty{#2}{}{\label{#2}}} - {\endylemma} -\newenvironment{corollary}[2] - {\ifstrempty{#1}{\ycorollary}{\ycorollary[#1]}\ifstrempty{#2}{}{\label{#2}}} - {\endycorollary} -\newenvironment{postulate}[2] - {\ifstrempty{#1}{\ypostulate}{\ypostulate[#1]}\ifstrempty{#2}{}{\label{#2}}} - {\endypostulate} -\newenvironment{axiom}[2] - {\ifstrempty{#1}{\yaxiom}{\yaxiom[#1]}\ifstrempty{#2}{}{\label{#2}}} - {\endyaxiom} -\newenvironment{proposition}[2] - {\ifstrempty{#1}{\yproposition}{\yproposition[#1]}\ifstrempty{#2}{}{\label{#2}}} - {\endyproposition} -\newenvironment{note}{ - \par\noindent\textbf{\notename\,} - \itshape}{\par} -\newenvironment{proof}{ - \par\noindent\textbf{\proofname\;} -}{\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} -\newenvironment{conclusion}{\par\noindent\textbf{\conclusionname}}{\par} -\newenvironment{property}{\par\noindent\textbf{\propertyname}}{\par} -\renewcommand{\maketitle}{\par -\begingroup - \newgeometry{left=20mm,right=20mm,top=30mm,bottom=35mm} - \newpage - % 禁止图片位于页面最上方 - \global\@topnum\z@ - \@maketitle % 下面再设置封面具体内容 - \endgroup - % 先取消原来封面样式的所有设置,以便后面重写此命令 - \global\let\thanks\relax - \global\let\maketitle\relax - \global\let\@maketitle\relax - \global\let\@thanks\@empty - \global\let\@author\@empty - \global\let\@date\@empty - \global\let\@title\@empty - \global\let\title\relax - \global\let\author\relax - \global\let\date\relax - \global\let\and\relax +\setitemize{leftmargin=0em,itemsep=0em,partopsep=0em,parsep=0em,topsep=0em,itemindent=3em} +\setenumerate{leftmargin=0em,itemsep=0em,partopsep=0em,parsep=0em,topsep=0em,itemindent=3.5em} +\newcommand{\citeup}[1]{\textsuperscript{\cite{#1}}} +\captionnamefont{\wuhao} +\captiontitlefont{\wuhao} +\renewcommand{\subcapsize}{\wuhao} +\setlength{\abovecaptionskip}{0pt}%为了双标题之间的间距,不能设置 +\setlength{\belowcaptionskip}{0pt} +\newcounter{pubctr} %自定义新计数器 +\newenvironment{publist}{%%%%%定义新环境 +\begin{list}{[\arabic{pubctr}]} %%标签格式 + { + \usecounter{pubctr} + \setlength{\leftmargin}{1.7em} % 左边界 \leftmargin =\itemindent + \labelwidth + \labelsep + \setlength{\itemindent}{0em} % 标号缩进量 + \setlength{\labelsep}{0.5em} % 标号和列表项之间的距离,默认0.5em + \setlength{\rightmargin}{0em} % 右边界 + \setlength{\topsep}{0ex} % 列表到上下文的垂直距离 + \setlength{\parsep}{0ex} % 段落间距 + \setlength{\itemsep}{0ex} % 标签间距 + \setlength{\listparindent}{0pt} % 段落缩进量 + }} +{\end{list}} +\renewtheoremstyle{plain} +{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]} +{\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\ ##3\theorem@separator]} +\theorembodyfont{\songti\rmfamily} +\theoremheaderfont{\heiti\rmfamily} +\theoremsymbol{$\square$} +\setlength{\theorempreskipamount}{0pt} +\setlength{\theorempostskipamount}{-2pt} +\setlength{\parindent}{2em} +\arraycolsep=1.6pt +\def\hitsz@title@font{% + \ifhitsz@arialtitle\sffamily\else\heiti\fi} + +\newcommand\hitsz@chapter@titleformat[1]{%开启悬挂缩进选项 + \ifthenelse% + {\equal{#1}{\eabstractcname}}% + {\bfseries #1}% + %实现章标题的居中加悬挂缩进,注意,此处一定是\CTEX@chaptername\CTEX@chapter@aftername, 否则是英文标题长度 + {\ifhitsz@chapterhang% + \settowidth{\hangindent}{\CTEX@chaptername\CTEX@chapter@aftername}\hangafter=1 + \fi#1}% + %{\begin{varwidth}[t]{\hitsz@chapter@indentboxwidth}#1\end{varwidth}} } -\newdimen\infowidth -\infowidth = 6.5cm -\def\@maketitle{% - \newpage - % 开始写封面 - \thispagestyle{empty} - \vspace*{2cm} - %%------------------------ - \begin{center} - \ifdefstring{\hitsz@covertitle}{tworow}{ - \parbox[t][1.4cm][t]{\textwidth}{ - \begin{center}\erhao[0]\bfseries\hitsz@tokens@titleone\end{center} -}\par -\parbox[t][2.5cm][t]{\textwidth}{ - \begin{center}\erhao[0]\bfseries\hitsz@tokens@titletwo\end{center} -}\par - }{\relax} - \ifdefstring{\hitsz@covertitle}{onerow}{ - \parbox[t][3.4cm][t]{\textwidth}{ - \begin{center}\erhao[0]\bfseries\hitsz@tokens@thesistitle\end{center} + +\renewcommand\@afterheading{% + \@nobreaktrue + \everypar{% + \if@nobreak + \@nobreakfalse + \clubpenalty 1 + \if@afterindent \else + {\setbox\z@\lastbox}% + \fi + \else + \clubpenalty 1 + \everypar{}% + \fi}} +\ctexset{% + chapter={ + afterindent=true, + pagestyle={hitsz@headings}, + beforeskip={24.74658bp},%一个空行 1.57481 × 18 + afterskip={24.74658bp},%0.8应该不计算间距 0.8 × 18 + 0.57481×18 + aftername=\enspace, + format={\centering\hitsz@title@font\xiaoer[1.57481]},%\center 会影响之后全局 + nameformat=\relax, + numberformat=\relax, + titleformat=\hitsz@chapter@titleformat, + fixskip=true, % 添加这一行去除默认间距 + %hang=true, + }, + section={ + afterindent=true, + beforeskip={\ifhitsz@glue + 13.5bp \@plus 1.677267bp \@minus 1.157391bp + \else + \ifhitsz@bachelor 20.25bp \else 20.25bp + \fi + \fi}, % 原为13.5bp + afterskip={\ifhitsz@glue + 13.5bp \@plus 1.677267bp \@minus 1.157391bp + \else + \ifhitsz@bachelor 20.25bp \else 20.25bp + \fi + \fi}, + format={\hitsz@title@font + \ifhitsz@glue + \fontsize{15bp}{21bp \@plus 1.677267bp \@minus 1.157391bp} + \else + \fontsize{15bp}{21bp} + \fi + \selectfont}, + aftername=\enspace, + fixskip=true, + break={}, + }, + subsection={ + afterindent=true, + beforeskip={\ifhitsz@glue 11bp \@plus 1.842609bp \@minus 0.9920497bp + \else + \ifhitsz@bachelor 16.5bp + \else 16.5bp + \fi + \fi}, % 原为11bp + afterskip={ \ifhitsz@glue 11bp \@plus 2.33863bp \@minus 0.49602bp + \else + \ifhitsz@bachelor 16.5bp + \else 16.5bp + \fi + \fi}, + format={\hitsz@title@font + \ifhitsz@glue + \fontsize{14bp}{18bp \@plus 1.842609bp \@minus 0.9920497bp} + \else + \fontsize{14bp}{18bp} + \fi\selectfont}, + aftername=\enspace, + fixskip=true, + break={}, + }, + subsubsection={ + afterindent=true, + beforeskip={\ifhitsz@glue 8.50398bp \@plus 2.83465bp \@minus 0bp + \else + \ifhitsz@bachelor 13.5bp + \else 13.5bp + \fi + \fi}, % 原为9bp + afterskip={ \ifhitsz@glue 8.50398bp \@plus 2.83465bp \@minus 0bp + \else + \ifhitsz@bachelor 13.5bp + \else 13.5bp + \fi + \fi}, + format={\hitsz@title@font\normalsize}, + aftername=\enspace, + fixskip=true, + break={}, + }, + paragraph/afterindent=true, + subparagraph/afterindent=true +} +\NewDocumentCommand{\hitsz@appendix@chapter}{s m o}{% + \IfBooleanT{#1}% + { + \phantomsection + \markboth{#2}{#2} + \ifthenelse% + {\equal{#2}{\eabstractcname}}% + {\addcontentsline{toc}{chapter}{% + \texorpdfstring{\ifhitsz@arialtitle\sffamily\heiti% + \else\heiti + \fi + \ifhitsz@absupper\MakeUppercase{#2}% + \else#2 + \fi}{#2}}} + {\addcontentsline{toc}{chapter}{% + \texorpdfstring{\ifhitsz@arialtitle\sffamily\heiti\else\heiti\fi #2}{#2}}} + \IfValueT{#3}{\addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries #3}{#3}}} + \hitsz@chapter*{#2} + } +} +\newcommand{\BiAppChapter}[2] % 该附录命令适用于有章节的完整附录 +{\phantomsection + \chapter{#1} + \addcontentsline{toe}{chapter}{% + \texorpdfstring{\bfseries \xiaosi Appendix \thechapter~~#2}{Appendix \thechapter~~#2}} } - }{\relax} - \parbox[t][8.7cm][t]{\textwidth}{ - \begin{center}\xiaoer[0]\song\textbf{\ziju{0.2}\hitsz@tokens@authorname}\end{center} +\let\hitsz@chapter\chapter +\RenewDocumentCommand{\chapter}{s o m o}{% + \ifhitsz@openright\cleardoublepage\else\clearpage\fi\phantomsection% + \IfBooleanTF{#1}% + {% if \chapter* + \hitsz@chapter*{#3}% + \IfValueT{#4}{% + \addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries #4}{#4}} + } + }% + {% if \chapter + \IfNoValueTF{#2}% + {\hitsz@chapter{#3}}% + {\hitsz@chapter[#2]{#3}}% + \IfValueT{#4}{% + \addcontentsline{toe}{chapter}{% + \texorpdfstring{\bfseries\relax Chapter \thechapter\hspace{0.5em}\ignorespaces #4}{% + Chapter \thechapter\hspace{0.5em}\ignorespaces #4}} + } } +} + +\let\hitsz@section\section +\RenewDocumentCommand\section{s o m o}{ + \IfBooleanTF{#1}% + {% if \section* + \hitsz@section*{#3}% + \IfValueT{#4}{% + \addcontentsline{toe}{section}{#4} + } + }% + {% if \section + \IfNoValueTF{#2}% + {\hitsz@section{#3}}% + {\hitsz@section[#2]{#3}}% + \IfValueT{#4}{% + \addcontentsline{toe}{section}{% + \protect\numberline{\csname thesection\endcsname}\ignorespaces #4} + } + } +} + +\let\hitsz@subsection\subsection +\RenewDocumentCommand\subsection{s o m o}{ + \IfBooleanTF{#1}% + {% if \subsection* + \hitsz@subsection*{#3}% + \IfValueT{#4}{% + \addcontentsline{toe}{subsection}{#4} + } + }% + {% if \subsection + \IfNoValueTF{#2}% + {\hitsz@subsection{#3}}% + {\hitsz@subsection[#2]{#3}}% + \IfValueT{#4}{% + \addcontentsline{toe}{subsection}{% + \protect\numberline{\csname thesubsection\endcsname}\ignorespaces #4} + } + } +} + +\let\hitsz@subsubsection\subsubsection +\RenewDocumentCommand\subsubsection{s o m o}{ + \IfBooleanTF{#1}% + {% if \subsubsection* + \hitsz@subsubsection*{#3}% + \IfValueT{#4}{% + \addcontentsline{toe}{subsubsection}{#4} + } + }% + {% if \subsubsection + \IfNoValueTF{#2}% + {\hitsz@subsubsection{#3}}% + {\hitsz@subsubsection[#2]{#3}}% + \IfValueT{#4}{% + \addcontentsline{toe}{subsubsection}{% + \protect\numberline{\csname thesubsubsection\endcsname}\ignorespaces #4} + } + } +} +\def\hitsz@def@term#1{% + \define@key{hitsz}{#1}{\csname #1\endcsname{##1}} + \expandafter\gdef\csname #1\endcsname##1{% + \expandafter\gdef\csname hitsz@#1\endcsname{##1}} + \csname #1\endcsname{}} + +\hitsz@def@term{statesecrets} %密级 +\hitsz@def@term{natclassifiedindex} %国内图书分类号 +\hitsz@def@term{intclassifiedindex} %国际图书分类号 + +\hitsz@def@term{ctitlecover} %中文标题封面 +\hitsz@def@term{ctitle} %中文标题 +\hitsz@def@term{csubtitle} %中文副标题 +\hitsz@def@term{cxueke} %中文学科 +\hitsz@def@term{cauthor} %中文作者 +\hitsz@def@term{csupervisor} %中文导师 +\hitsz@def@term{cassosupervisor} %中文副导师 +\hitsz@def@term{ccosupervisor}%中文联合导师 +\hitsz@def@term{caffil}%中文院系 +\hitsz@def@term{csubject}%中文专业 +\hitsz@def@term{cdate} + +\hitsz@def@term{cstudentid}% +\hitsz@def@term{cstudenttype}% +\hitsz@def@term{ctitleone}% +\hitsz@def@term{ctitletwo}% + +\hitsz@def@term{etitle} %英文标题 +\hitsz@def@term{esubtitle} %英文标题 +\hitsz@def@term{exueke} %英文学科 +\hitsz@def@term{eauthor} %英文作者 +\hitsz@def@term{esupervisor} %英文导师 +\hitsz@def@term{eassosupervisor} %英文副导师 +\hitsz@def@term{ecosupervisor} %英文联合导师 +\hitsz@def@term{eaffil} +\hitsz@def@term{esubject} +\hitsz@def@term{edate} +\hitsz@def@term{estudenttype} +\newcommand{\hitsz@@cabstract}[1]{\long\gdef\hitsz@cabstract{#1}} +\newenvironment{cabstract}{\Collect@Body\hitsz@@cabstract}{} +\newcommand{\hitsz@@eabstract}[1]{\long\gdef\hitsz@eabstract{#1}} +\newenvironment{eabstract}{\Collect@Body\hitsz@@eabstract}{} +\def\hitsz@parse@keywords#1{ + \define@key{hitsz}{#1}{\csname #1\endcsname{##1}} + \expandafter\gdef\csname hitsz@#1\endcsname{} + \expandafter\gdef\csname #1\endcsname##1{ + \@for\reserved@a:=##1\do{ + \expandafter\ifx\csname hitsz@#1\endcsname\@empty\else + \expandafter\g@addto@macro\csname hitsz@#1\endcsname{% + \ignorespaces\csname hitsz@#1@separator\endcsname} + \fi + \expandafter\expandafter\expandafter\g@addto@macro% + \expandafter\csname hitsz@#1\expandafter\endcsname\expandafter{\reserved@a}}}} +\hitsz@parse@keywords{ckeywords} +\hitsz@parse@keywords{ekeywords} +\def\hitszsetup{\kvsetkeys{hitsz}} +\newlength{\hitsz@title@width} +\newcommand{\hitsz@put@title}[2][\hitsz@title@width]{% + \begin{CJKfilltwosides}[b]{#1}#2\end{CJKfilltwosides}} + +\def\hitsz@first@titlepage{% + \ifhitsz@bachelor\hitsz@first@titlepage@bachelor\else\hitsz@first@titlepage@other\fi} +\def\hitsz@second@titlepage{% + \ifhitsz@bachelor\hitsz@second@titlepage@bachelor\else\hitsz@second@titlepage@other\fi} + +\newcommand{\hitsz@first@titlepage@bachelor}{ +\ifthenelse% +{\equal{\hitsz@fontset}{siyuan}}% +{\xiaosi[1]\vspace*{0.65em}}% +{\xiaosi[1]\textcolor[rgb]{1,1,1}{\songti{\hitsz@dummyrow}}}% \begin{center} - \bfseries - \begin{tabular}{rl} -{\xiaosi 学\hphantom{教师}院:} & \xiaosi\hitsz@tokens@departname\\[14pt] -{\xiaosi 学\hphantom{教师}号:} & \xiaosi\hitsz@tokens@studentID + \ifhitsz@covertitletworow + \vspace*{0.7cm} + \parbox[t][1.4cm][t]{\textwidth}{% + \begin{center} + \erhao[0]\heiti\hitsz@ctitleone + \end{center} + }\par + \parbox[t][3cm][t]{\textwidth}{% + \begin{center} + \erhao[0]\heiti\hitsz@ctitletwo + \end{center} + }\par + \else + \vspace*{1.2cm} + \parbox[t][3.4cm][t]{\textwidth}{% + \begin{center} + \erhao[0]\heiti\hitsz@ctitlecover + \end{center} + } + \fi + % 姓名 + \parbox[t][9cm][t]{\textwidth}{% + \begin{center} + \xiaoer[0]\songti\textbf{\hitsz@cauthor} + \end{center} + } + \begin{center} + \setlength{\hitsz@title@width}{4em} + \heiti\xiaosi + \ifhitsz@shenzhen% + \begin{tabular}{rl}% + \else% + \begin{tabular}{rc}% + \fi% + {\hitsz@put@title{% + \ifhitsz@harbin% + \hitsz@bachelor@caffiltitle% + \else% + \ifhitsz@shenzhen% + \hitsz@bachelor@caffiltitlesz% + \else% + \ifhitsz@weihai% + \hitsz@bachelor@caffiltitlewh% + \fi% + \fi% + \fi% + }\hitsz@title@csep} & \hitsz@caffil\\[14pt] +{\hitsz@put@title{\hitsz@bachelor@cstudentidtitle}\hitsz@title@csep} & \hitsz@cstudentid \end{tabular} - \hspace{0.5cm} - \begin{tabular}{rl} -{\xiaosi 专\hphantom{教师}业:} & \xiaosi\hitsz@tokens@majorin\\[14pt] -{\xiaosi 指导教师:} & \xiaosi\hitsz@tokens@instructor + \ifhitsz@shenzhen% + \begin{tabular}{rl}% + \else% + \begin{tabular}{rc}% + \fi% +{\hitsz@put@title{\hitsz@bachelor@cmajortitle}\hitsz@title@csep} & \hitsz@csubject\\[14pt] +{\hitsz@put@title{\hitsz@bachelor@csupervisortitle}\hitsz@title@csep} & \hitsz@csupervisor \end{tabular} \end{center} - % 日期 \vspace{2.6cm} - {\xiaosi[0]\song\textbf{2020年6月}} + {\xiaosi[0]\songti\textbf{\hitsz@cdate}} \end{center} - %%---------------------------- -%% 第二页 -\clearpage -\thispagestyle{empty} +} +\newdimen\infowidth +\infowidth = 7cm +\newcommand{\hitsz@second@titlepage@bachelor}{ \vspace*{0.8cm} - \centering\includegraphics[width=8cm]{HITSZname} + \ifhitsz@harbin% + \centering{\includegraphics[width=6.2cm]{hitlogo}} + \else% + \ifhitsz@shenzhen% + \centering{\includegraphics[width=6.2cm]{hitlogo}~~\raisebox{0.2em}{% + \kaishu\yihao\hitsz@shenzhencampus}} + \else% + \ifhitsz@weihai% + \centering{\includegraphics[width=6.2cm]{hitlogo}~~\raisebox{0.2em}{% + \kaishu\yihao\hitsz@weihaicampus}} + \fi% + \fi% + \fi% \vspace{1.3cm} \begin{center} - \centering\includegraphics[width=10.5cm]{thesistitle} + \centering\includegraphics[width=10.5cm]{bthesistitle} \vfill \parbox[t][14.2cm][b]{\textwidth} {\heiti\xiaosan - \begin{center} \renewcommand{\arraystretch}{2.6} \bfseries - % 居中对齐 - \ifdefstring{\hitsz@infoalign}{infocenter}{ -\begin{tabular}{l@{\ \ }c} - {\xiaoer 题\hphantom{\ 导\ \ \ }目} & - \underline{\makebox[\infowidth]{% - \xiaoer \hitsz@tokens@titleone}}\\ - & \underline{\makebox[\infowidth]{% - \xiaoer \hitsz@tokens@titletwo}}\\ - & \\ - {\xiaosan 专\hphantom{\ 导\ 教\ }业} & - \underline{\makebox[\infowidth]{% - \xiaosan\hitsz@tokens@majorin}}\\ - {\xiaosan 学\hphantom{\ 导\ 教\ }号} & - \underline{\makebox[\infowidth]{% - \xiaosan\hitsz@tokens@studentID}}\\ - {\xiaosan 学\hphantom{\ 导\ 教\ }生} & - \underline{\makebox[\infowidth]{% - \xiaosan\hitsz@tokens@authorname}}\\ - {\xiaosan 指\ 导\ 教\ 师} & \underline{\makebox[\infowidth]{% - \xiaosan\hitsz@tokens@instructor}}\\ - {\xiaosan 答\ 辩\ 日\ 期} & \underline{\makebox[\infowidth]{% - \xiaosan\hitsz@tokens@dateinput}} -\end{tabular} \renewcommand{\arraystretch}{1} -}{\relax} -\ifdefstring{\hitsz@infoalign}{infoleft}{ -\begin{tabular}{l@{\ \ }c} - {\xiaoer 题\hphantom{\ 导\ \ \ }目} & - \underline{\makebox[\infowidth][l]{% - \hspace*{1em}\xiaoer \hitsz@tokens@titleone}}\\ - & \underline{\makebox[\infowidth][l]{% - \hspace*{1em}\xiaoer \hitsz@tokens@titletwo}}\\ - & \\ - {\xiaosan 专\hphantom{\ 导\ 教\ }业} & - \underline{\makebox[\infowidth][l]{% - \hspace*{1em}\xiaosan\hitsz@tokens@majorin}}\\ - {\xiaosan 学\hphantom{\ 导\ 教\ }号} & - \underline{\makebox[\infowidth][l]{% - \hspace*{1em}\xiaosan\hitsz@tokens@studentID}}\\ - {\xiaosan 学\hphantom{\ 导\ 教\ }生} & - \underline{\makebox[\infowidth][l]{% - \hspace*{1em}\xiaosan\hitsz@tokens@authorname}}\\ - {\xiaosan 指\ 导\ 教\ 师} & \underline{\makebox[\infowidth][l]{% - \hspace*{1em}\xiaosan\hitsz@tokens@instructor}}\\ - {\xiaosan 答\ 辩\ 日\ 期} & \underline{\makebox[\infowidth][l]{% - \hspace*{1em}\xiaosan\hitsz@tokens@dateinput}} -\end{tabular} \renewcommand{\arraystretch}{1} -}{\relax} + \begin{center} \renewcommand{\arraystretch}{2.5} \heiti + \setlength{\hitsz@title@width}{5.5em} + \ifhitsz@infoleft + \begin{tabular}{l@{\ \ }l} + {\xiaoer \hitsz@put@title{\hitsz@bachelor@cthesistitle}} & + \underline{\makebox[\infowidth][l]{\hspace*{1em}\xiaoer \hitsz@ctitleone}}\\ + & \underline{\makebox[\infowidth][l]{\hspace*{1em}\xiaoer \hitsz@ctitletwo}}\\ + & \\ + {\hitsz@put@title{\hitsz@bachelor@cmajortitle}} & + \underline{\makebox[\infowidth][l]{\hspace*{1em}\hitsz@csubject}}\\ + {\hitsz@put@title{\hitsz@bachelor@cstudentidtitle}} & + \underline{\makebox[\infowidth][l]{\hspace*{1em}\hitsz@cstudentid}}\\ + {\hitsz@put@title{\hitsz@bachelor@cstudenttitle}} & + \underline{\makebox[\infowidth][l]{\hspace*{1em}\hitsz@cauthor}}\\ + {\hitsz@put@title{\hitsz@bachelor@csupervisortitle}} & + \underline{\makebox[\infowidth][l]{\hspace*{1em}\hitsz@csupervisor}}\\ + {\hitsz@put@title{\hitsz@cdatetitle}} & + \underline{\makebox[\infowidth][l]{\hspace*{1em}\CJK@todaysmall}} + \end{tabular} + \else + \begin{tabular}{l@{\ \ }c} + {\xiaoer \hitsz@put@title{\hitsz@bachelor@cthesistitle}} & + \underline{\makebox[\infowidth]{\xiaoer \hitsz@ctitleone}}\\ + & \underline{\makebox[\infowidth]{\xiaoer \hitsz@ctitletwo}}\\ + & \\ + {\hitsz@put@title{\hitsz@bachelor@cmajortitle}} & + \underline{\makebox[\infowidth]{\hitsz@csubject}}\\ + {\hitsz@put@title{\hitsz@bachelor@cstudentidtitle}} & + \underline{\makebox[\infowidth]{\hitsz@cstudentid}}\\ + {\hitsz@put@title{\hitsz@bachelor@cstudenttitle}} & + \underline{\makebox[\infowidth]{\hitsz@cauthor}}\\ + {\hitsz@put@title{\hitsz@bachelor@csupervisortitle}} & + \underline{\makebox[\infowidth]{\hitsz@csupervisor}}\\ + {\hitsz@put@title{\hitsz@cdatetitle}} & + \underline{\makebox[\infowidth]{\CJK@todaysmall}} + \end{tabular} + \fi + \renewcommand{\arraystretch}{1} \end{center} } \end{center} - \restoregeometry - \clearpage -} -\renewcommand{\frontmatter}{% -\cleardoublepage -\@mainmatterfalse -\pagenumbering{Roman} } -%% 中文摘要环境 -\newenvironment{abstract}{\chapter*{\abstractname} -\addcontentsline{toc}{chapter}{\abstractname} -}{\if@twocolumn\else\null\fi} -\newcommand\keywords[1]{% -\renewcommand{\hitsz@tokens@keywords}{#1} -{\vskip18pt -\hspace{-30bp}\begin{tabular}{lp{132mm}} -{\zihao{-4}\heiti\keywordsname:}& -{\xiaosi\hitsz@tokens@keywords} -\end{tabular}} + +\newlength{\hitsz@etitlelength}% +\newcommand{\hitsz@first@titlepage@other}{ + % 封面一 +\ifthenelse% +{\equal{\hitsz@fontset}{siyuan}}% +{\xiaosi[1]\vspace*{0.65em}}% +{\xiaosi[1]\textcolor[rgb]{1,1,1}{\songti{\hitsz@dummyrow}}}% + \vspace*{1.2cm} +\begin{center} + \begin{center}\xiaoyi[1]\songti\textbf{\hitsz@cxuewei\hitsz@cthesisname}\end{center} + \ifhitsz@fulltime\vspace{1.4cm}\else% + \begin{center} + \xiaoyi[1]\songti + \textbf{\hitsz@cbraceleft\hitsz@cstudenttype\hitsz@cbraceright} + \end{center} + \fi% + \parbox[t][7.8cm][t]{\textwidth}{% + \begin{center}\erhao\heiti\hitsz@ctitlecover\end{center} + \ifhitsz@subtitle% + \begin{center} + \hspace{-4em}\xiaoer\heiti\pozhehao\hitsz@csubtitle + \end{center} + \fi + \begin{center}% + \settowidth{\hitsz@etitlelength}{% + \erhao\hitsz@etitle\ifhitsz@subtitle\hitsz@title@esep\hitsz@esubtitle\fi}% + \ifdim\hitsz@etitlelength>450mm\xiaoer\else\erhao\fi% + \textbf{\MakeUppercase{\hitsz@etitle}% + \ifhitsz@subtitle% + \hitsz@title@esep\MakeUppercase{\hitsz@esubtitle} + \fi}\end{center}} + + \parbox[t][7.4cm][t]{\textwidth}{ + \begin{center}\xiaoer\songti\textbf{\hitsz@cauthor}\end{center}} + \parbox[t][1.4cm][t]{\textwidth}{ + \begin{center}\kaishu\xiaoer\textbf{\hitsz@cschoolname}\end{center}} + {\songti\xiaoer\textbf{\hitsz@cdate}} +\end{center} } -\newenvironment{abstracten}{\chapter*{\bfseries Abstract} -\addcontentsline{toc}{chapter}{ABSTRACT} -}{\if@twocolumn\else\null\fi} -\newcommand\keywordsen[1]{% -\renewcommand{\hitsz@tokens@keywordsen}{#1} -{\vskip 18pt -\hspace{-30bp}\begin{tabular}{lp{127mm}} -{\zihao{-4}\bf\keywordsenname:}& -{\xiaosi\hitsz@tokens@keywordsen} -\end{tabular}} + +\newcommand{\hitsz@second@titlepage@other}{ + \begin{center} + {\songti \xiaosi + \begin{tabular}{@{}r@{:}l@{}} +\hitsz@natclassifiedindextitle & \hitsz@natclassifiedindex\\ +\hitsz@internatclassifiedindextitle & \hitsz@intclassifiedindex + \end{tabular}}\hfill + {\songti \xiaosi + \begin{tabular}{@{}r@{:}l@{}} +\hitsz@schoolidtitle & \hitsz@schoolid\\ +\hitsz@secretlevel & \hitsz@statesecrets + \end{tabular}} + \parbox[t][3.2cm][t]{\textwidth}{\begin{center} \end{center} } + \parbox[t][2.4cm][t]{\textwidth}{\xiaoer[1] + \begin{center}\songti\bfseries\hitsz@cdegree\hitsz@cthesisname\end{center} + \ifhitsz@fulltime\relax + \else% + \begin{center} + \songti\textbf{\hitsz@cbraceleft\hitsz@cstudenttype\hitsz@cbraceright} + \end{center} + \fi} +\parbox[t][5cm][t]{\textwidth}{\erhao + \begin{center}\heiti\hitsz@ctitlecover\end{center} + \ifhitsz@subtitle% + \begin{center} + \hspace{-4em}\xiaoer\heiti\pozhehao\hitsz@csubtitle + \end{center} + \fi} + \parbox[t][9.8cm][b]{\textwidth} + {\sihao + \setlength{\hitsz@title@width}{6em} + \begin{center} \renewcommand{\arraystretch}{1.62} \songti +\begin{tabular}{l@{\hitsz@title@csep}l} + {\heiti \hitsz@put@title{\hitsz@cauthortitle}} & \hitsz@cauthor\\ + {\heiti \hitsz@put@title{\hitsz@csupervisortitle}} & \hitsz@csupervisor\\ + \ifx\hitsz@cassosupervisor\@empty\else% + {\heiti \hitsz@put@title{\hitsz@cassosupervisortitle}}& \hitsz@cassosupervisor\\ + \fi + \ifx\hitsz@ccosupervisor\@empty\else% + {\heiti \hitsz@put@title{\hitsz@ccosupervisortitle}} & \hitsz@ccosupervisor\\ + \fi + {\heiti \hitsz@put@title{\hitsz@cdegreetitle}} & \hitsz@cdegree\\ + {\heiti \hitsz@put@title{\hitsz@csubjecttitle}} & \hitsz@csubject\\ + {\heiti \hitsz@put@title{\hitsz@caffiltitle}} & \hitsz@caffil\\ + {\heiti \hitsz@put@title{\hitsz@cdatetitle}} & \hitsz@cdate\\ + {\heiti \hitsz@put@title{\hitsz@cschoolnametitle}} & \hitsz@cschoolname +\end{tabular} \renewcommand{\arraystretch}{1} + \end{center} } + \end{center} } -\newcommand{\declaration}{\par -\begingroup - \hitsz@declaration - \endgroup +\newcommand{\emultiline}[2][c]{% + \renewcommand{\arraystretch}{1} + \begin{tabular}[#1]{@{}l@{}}#2\end{tabular} + \renewcommand{\arraystretch}{1.3} } -\def\hitsztitle{\hitsz@tokens@thesistitle} -\def\hitszauthor{\hitsz@tokens@authorname} -\def\hitsz@declaration{ -\chapter*{\sanhao 哈尔滨工业大学(深圳)本科毕业设计(论文)原创性声明} -\addcontentsline{toc}{chapter}{原创性声明}\par -本人郑重声明:在哈尔滨工业大学(深圳)攻读学士学位期间,所提交的毕业设计(论文)《\hitsztitle》,是本人在导师指导下独立进行研究工作所取得的成果。对本文的研究工作做出重要贡献的个人和集体,均已在文中以明确方式注明,其它未注明部分不包含他人已发表或撰写过的研究成果,不存在购买、由他人代写、剽窃和伪造数据等作假行为。 -\par -本人愿为此声明承担法律责任。\par -\vspace{30pt} -\hspace{6em}作者签名:\hspace{8em}日期:\hspace{3em}年\hspace{1.5em}月\hspace{1.5em}日 +\newcommand{\hitsz@engcover}{ + { + \xiaosi[1.667]\noindent Classified Index: \hitsz@natclassifiedindex \\[8pt] + U.D.C: \hitsz@intclassifiedindex } + \vspace*{1em} + \begin{center} + \parbox[t][1.6cm][t]{\textwidth}{\begin{center} \end{center} } + \parbox[t][3.5cm][t]{\textwidth}{\xiaoer[1] + \begin{center}Dissertation for the {\hitsz@exueweier} Degree in \hitsz@exueke\end{center} + \ifhitsz@fulltime\relax + \else% + \begin{center} + \hitsz@ebraceleft\hitsz@estudenttype\hitsz@ebraceright + \end{center} + \fi} %与中文保持一致,删除in {\hitsz@exueke} + \parbox[t][7cm][t]{\textwidth}{% + \begin{center}% + \settowidth{\hitsz@etitlelength}{% + \erhao\hitsz@etitle\ifhitsz@subtitle\hitsz@title@esep\hitsz@esubtitle\fi}% + \ifdim\hitsz@etitlelength>450mm\xiaoer\else\erhao\fi% + \textbf{\MakeUppercase{\hitsz@etitle}% +\ifhitsz@subtitle\hitsz@title@esep\MakeUppercase{\hitsz@esubtitle}\fi}\end{center}} + %★★★★若信息内容不太长,不会引起信息内容分行时,使用tabular环境,否则使用下面的tabularx环境。 + {\sihao\renewcommand{\arraystretch}{1.3} + \begin{tabular}{@{}l@{~}l@{}} +\textbf{\hitsz@eauthortitle\hitsz@title@esep} & \hitsz@eauthor\\ +\textbf{\hitsz@esupervisortitle\hitsz@title@esep} & \hitsz@esupervisor\\ + \ifx\hitsz@eassosupervisor\@empty\else% +\textbf{\hitsz@eassosupervisortitle\hitsz@title@esep} & \hitsz@eassosupervisor\\ + \fi + \ifx\hitsz@ecosupervisor\@empty\else% +\textbf{\hitsz@ecosupervisortitle\hitsz@title@esep} & \hitsz@ecosupervisor\\ + \fi +\textbf{\hitsz@edegreetitle\hitsz@title@esep} & \hitsz@edegree\\ + \textbf{\hitsz@esubjecttitle\hitsz@title@esep} &\hitsz@esubject\\ +\textbf{\hitsz@eaffiltitle\hitsz@title@esep} &\hitsz@eaffil\\ +\textbf{\hitsz@edatetitle\hitsz@title@esep} & \hitsz@edate\\ +\textbf{\hitsz@eschoolnametitle\hitsz@title@esep} & \hitsz@eschoolname + \end{tabular}\renewcommand{\arraystretch}{1}} + \end{center} } -\renewenvironment{thebibliography}[1] - {\chapter*{\bibname}% - \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}% - \list{\@biblabel{\@arabic\c@enumiv}}% - {\settowidth\labelwidth{\@biblabel{#1}}% - \leftmargin\labelwidth - \advance\leftmargin\labelsep - \addtolength{\itemsep}{-1.5ex} - \@openbib@code - \usecounter{enumiv}% - \let\p@enumiv\@empty - \renewcommand\theenumiv{\@arabic\c@enumiv}}% - \sloppy - \clubpenalty4000 - \@clubpenalty \clubpenalty - \widowpenalty4000% - \sfcode`\.\@m} - {\def\@noitemerr - {\@latex@warning{Empty `thebibliography' environment}}% - \endlist} -\RequirePackage{fancyhdr} -\pagestyle{fancy} -\lhead{} -\chead{\wuhao 哈尔滨工业大学(深圳)本科毕业设计(论文)} -\rhead{} -\lfoot{} -\cfoot{\wuhao -\thepage-} -\rfoot{} -\newcommand{\makeheadrule}{% -\makebox[0pt][l]{\rule[1mm]{\headwidth}{0.4mm}}% -\rule[0.35\baselineskip]{\headwidth}{0.8mm}} -\renewcommand{\headrule}{% -{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi% -\makeheadrule}} -\titlecontents{chapter}[0pt]{\vspace{1mm}\heiti} -{\thecontentslabel\hskip.5em}{}{\titlerule*[4pt]{.}\contentspage} -\titlecontents{section}[25pt]{\songti} -{\thecontentslabel\hskip.5em}{}{\titlerule*[4pt]{.}\contentspage} -\titlecontents{subsection}[47pt]{\songti} -{\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} -\renewcommand{\thefigure}{\thechapter-\arabic{figure}} -\renewcommand{\thetable}{\thechapter-\arabic{table}} -\renewcommand{\theequation}{\thechapter-\arabic{equation}} -\usetikzlibrary{shapes.geometric, arrows} -\tikzstyle{startstop} = [rectangle, rounded corners, minimum width = 2cm, -minimum height=1cm,text centered, draw = black] -\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, -minimum width=2cm, minimum height=1cm, text centered, draw=black] -\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, -text centered, draw=black] -\tikzstyle{decision} = [diamond, aspect = 3, text centered, draw=black] -\tikzstyle{arrow} = [->,>=stealth] -\newcommand{\upcite}[1]{\textsuperscript{\textsuperscript{\cite{#1}}}} -\renewcommand{\thefootnote}{\fnsymbol{footnote}} -\makeatletter -\renewcommand\chapter{ -\if@openright\cleardoublepage -\else\clearpage + +\def\makecover{ + \phantomsection + \pdfbookmark[0]{\hitsz@ctitle}{ctitle} + \xiaosi[1]% + \begin{titlepage} + \hitsz@first@titlepage + \ifhitsz@library\clearpage\else\cleardoublepage\fi + \hitsz@second@titlepage + \ifhitsz@library\clearpage\else\cleardoublepage\fi + \ifhitsz@bachelor + \relax + \else + \phantomsection + \pdfbookmark[0]{\hitsz@etitle}{etitle} + \hitsz@engcover + \ifhitsz@library\clearpage\else\cleardoublepage\fi + \fi + \end{titlepage} + \normalsize + \hitsz@makeabstract} +\newbox\hitsz@kw +\newcommand\hitsz@put@keywords[2]{% + \begingroup + \setbox\hitsz@kw=\hbox{#1} + \noindent\hangindent\wd\hitsz@kw\hangafter1% + \box\hitsz@kw#2\par + \endgroup} + +\newcommand{\hitsz@makeabstract}{% + \ifhitsz@openright\cleardoublepage\else\clearpage\fi + \hitsz@appendix@chapter*{\cabstractcname}[\cabstractename] + \pagestyle{hitsz@headings} + \pagenumbering{Roman} + \hitsz@cabstract + \vskip12bp + \hitsz@put@keywords{\heiti\hitsz@ckeywords@title}{\hitsz@ckeywords} + \ifhitsz@openright\cleardoublepage\else\clearpage\fi + \hitsz@appendix@chapter*{\eabstractcname}[\eabstractename] + \hitsz@eabstract + \vskip12bp + \hitsz@put@keywords{\textbf{Keywords:\enskip}}{\hitsz@ekeywords}} +\newenvironment{denotation}[1][2.5cm]{% + \ifhitsz@openright\cleardoublepage\else\clearpage\fi + \hitsz@appendix@chapter*{\hitsz@denotation@ctitle}[\hitsz@denotation@etitle] +\setcounter{table}{0} +\renewcommand{\thetable}{\arabic{table}}%使表编号为 1 的格式 + }{\renewcommand{\thetable}{\arabic{chapter}-\arabic{table}}%使表编号为 7-1 的格式 +\setcounter{table}{0}}% +\def\hitsz@starttoc#1{% #1: float type, prepend type name in \listof*** entry. + \let\oldnumberline\numberline + \def\numberline##1{\oldnumberline{\csname #1name\endcsname\hskip.4em ##1}} + \@starttoc{\csname ext@#1\endcsname} + \let\numberline\oldnumberline} +\def\hitsz@listof#1#2{% #1: float type +\chapter*{\csname list#1name\endcsname}[#2]\hitsz@starttoc{#1}} + +\renewcommand\listoffigures{\hitsz@listof{figure}{\listfigureename}} +\renewcommand*\l@figure{\addvspace{6bp}\@dottedtocline{1}{0em}{4em}} +\renewcommand\listoftables{\hitsz@listof{table}{\listtableename}} +\let\l@table\l@figure +\def\ext@equation{loe} +\def\equcaption#1{% + \addcontentsline{\ext@equation}{equation}% + {\protect\numberline{#1}}} +\newcommand\listofequations{\hitsz@listof{equation}{\listequationename}} +\let\l@equation\l@figure +\setcounter{secnumdepth}{3} +\setcounter{tocdepth}{2} +\ifhitsz@bachelor\ifhitsz@tocfour\setcounter{tocdepth}{3}\fi\fi +\renewcommand\tableofcontents{% +\ifhitsz@openright\cleardoublepage\else\clearpage\fi +\phantomsection +\markboth{\contentsname}{ccontent} +\hitsz@chapter*{\contentsname} +\pdfbookmark[0]{\contentsname}{ccontent} +\normalsize\@starttoc{toc}} +\ifhitsz@arialtoc + \def\hitsz@toc@font{\sffamily} \fi - \thispagestyle{fancy} - \global\@topnum\z@ - \@afterindentfalse - \secdef\@chapter\@schapter -} -\makeatother -\newcommand\dif{\text{d}} -\newcommand\no{\noindent} -\newcommand\dis{\displaystyle} -\newcommand\ls{\leqslant} -\newcommand\gs{\geqslant} -\newcommand\limit{\dis\lim\limits} -\newcommand\limn{\dis\lim\limits_{n\to\infty}} -\newcommand\limxz{\dis\lim\limits_{x\to0}} -\newcommand\limxi{\dis\lim\limits_{x\to\infty}} -\newcommand\limxpi{\dis\lim\limits_{x\to+\infty}} -\newcommand\limxni{\dis\lim\limits_{x\to-\infty}} -\newcommand\limtpi{\dis\lim\limits_{t\to+\infty}} -\newcommand\limtni{\dis\lim\limits_{t\to-\infty}} -\newcommand\sumn{\dis\sum\limits_{n=1}^{\infty}} -\newcommand\sumnz{\dis\sum\limits_{n=0}^{\infty}} -\newcommand\sumi{\dis\sum\limits_{i=1}^{\infty}} -\newcommand\sumiz{\dis\sum\limits_{i=0}^{\infty}} -\newcommand\sumin{\dis\sum\limits_{i=1}^{n}} -\newcommand\sumizn{\dis\sum\limits_{i=0}^{n}} -\newcommand\sumk{\dis\sum\limits_{k=1}^{\infty}} -\newcommand\sumkz{\dis\sum\limits_{k=0}^{\infty}} -\newcommand\sumkn{\dis\sum\limits_{k=0}^n} -\newcommand\sumkfn{\dis\sum\limits_{k=1}^n} -\newcommand\pzx{\dis\frac{\partial z}{\partial x}} -\newcommand\pzy{\dis\frac{\partial z}{\partial y}} -\newcommand\pfx{\dis\frac{\partial f}{\partial x}} -\newcommand\pfy{\dis\frac{\partial f}{\partial y}} -\newcommand\pzxx{\dis\frac{\partial^2 z}{\partial x^2}} -\newcommand\pzxy{\dis\frac{\partial^2 z}{\partial x\partial y}} -\newcommand\pzyx{\dis\frac{\partial^2 z}{\partial y\partial x}} -\newcommand\pzyy{\dis\frac{\partial^2 z}{\partial y^2}} -\newcommand\pfxx{\dis\frac{\partial^2 f}{\partial x^2}} -\newcommand\pfxy{\dis\frac{\partial^2 f}{\partial x\partial y}} -\newcommand\pfyx{\dis\frac{\partial^2 f}{\partial y\partial x}} -\newcommand\pfyy{\dis\frac{\partial^2 f}{\partial y^2}} -\newcommand\intzi{\dis\int_{0}^{+\infty}} -\newcommand\intd{\dis\int} -\newcommand\intab{\dis\int_a^b} -\newcommand{\degree}{^\circ} -\newcommand\ma{\mathcal{A}} -\newcommand\mb{\mathcal{B}} -\newcommand\mc{\mathcal{C}} -\newcommand\me{\mathcal{E}} -\newcommand\mg{\mathcal{g}} -\newcommand\mcc{\mathbb{C}} -\newcommand\mrr{\mathbb{R}} -\newcommand\mzz{\mathbb{Z}} -\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} -\DeclareMathOperator{\arcsinh}{arcsinh} -\DeclareMathOperator{\arctanh}{arctanh} -\DeclareMathOperator{\arccoth}{arccoth} -\DeclareMathOperator{\grad}{\bf{grad}} -\DeclareMathOperator{\argmax}{argmax} -\DeclareMathOperator{\argmin}{argmin} -\DeclareMathOperator{\diag}{diag} -\DeclareMathOperator{\csign}{csign} -\newcommand{\spine}{% -\begingroup - \hitsz@spine +\def\@pnumwidth{4em}%规定中的提前悬挂 +\def\@tocrmarg{\@pnumwidth} +\def\@dotsep{1} +\setlength\@tempdima{4em}% +\patchcmd{\@dottedtocline}{#4}{\csname hitsz@toc@font\endcsname #4}{}{} +\patchcmd{\@dottedtocline}{\hb@xt@\@pnumwidth}{\hbox}{}{} +\renewcommand*\l@chapter[2]{% + \ifnum \c@tocdepth >\m@ne + \addpenalty{-\@highpenalty}% + %\vskip 4bp \@plus\p@ + \begingroup + \parindent \z@ \rightskip \@pnumwidth + \parfillskip -\@pnumwidth + \leavevmode + \advance\leftskip\@tempdima + \hskip -\leftskip + % numberline is called here, and it uses \@tempdima + {\ifhitsz@bachelor\rmfamily\else\csname hitsz@toc@font\endcsname\fi\heiti #1} + \leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill + \nobreak{\normalfont\normalcolor #2}\par + \penalty\@highpenalty \endgroup + \fi} +\renewcommand*\l@section{\@dottedtocline{1}{1em}{1.8em}} +\renewcommand*\l@subsection{\@dottedtocline{2}{2em}{2.5em}} +\renewcommand*\l@subsubsection{\@dottedtocline{3}{3\ccwd}{3.1em}} +\def\@dotsep{0.75} % 定义英文目录的点间距 +\setlength\leftmargini {0pt} +\setlength\leftmarginii {0pt} +\setlength\leftmarginiii {0pt} +\setlength\leftmarginiv {0pt} +\setlength\leftmarginv {0pt} +\setlength\leftmarginvi {0pt} + +\def\engcontentsname{\bfseries Contents} +\newcommand\tableofengcontents{ + %控制英文目录:细点\@dottedtocline,粗点\@dottedtoclinebold + \def\l@chapter{\@dottedtocline{0}{0em}{5em}} + \@restonecolfalse + \chapter*{\engcontentsname %chapter*上移一行,避免在toc中出现。 + \pdfbookmark[0]{Contents}{econtent} + \@mkboth{% + \engcontentsname}{\engcontentsname}} + \@starttoc{toe}% + \if@restonecol\twocolumn\fi} +\def\@dotsep{0.75} % 定义英文目录的点间距 +\ctexset{% + appendix/number=\ifhitsz@bachelor\arabic{chapter}\else\Alph{chapter}\fi, } -\def\hitsz@spine{% - \newpage\thispagestyle{empty}% - \heiti\addCJKfontfeatures*{RawFeature={vertical:}} - \xiaosan\ziju{0.4}% - \noindent\hfill\rotatebox[origin=lt]{-90}{% - \makebox[\textheight]{本科毕业设计(论文)\hfill \hitsztitle \hfill \hitszauthor} +\let\hitsz@appendix\appendix +\renewenvironment{appendix}{% + \let\title\hitsz@appendix@title + \hitsz@appendix + \ifhitsz@bachelor\renewcommand{\thechapter}{\arabic{chapter}}\fi + }{% + \let\title\@gobble} +\let\title\@gobble +\newcommand{\hitsz@appendix@title}[1]{% + \begin{center} + \bfseries\xiaosi #1 + \end{center}} +\newlist{translationbib}{enumerate}{1} +\setlist[translationbib]{label=[\arabic*],align=left,nosep,itemsep=6bp, + leftmargin=10mm,labelsep=!,before=\vspace{0.5\baselineskip}\wuhao[1.3] +} +\newenvironment{conclusions}{% +\ifhitsz@openright\cleardoublepage\else\clearpage\fi + \hitsz@appendix@chapter*{\hitsz@conclusion@ctitle}[\hitsz@conclusion@etitle]}{} +\newenvironment{acknowledgements}{% + \ifhitsz@openright\cleardoublepage\else\clearpage\fi + \hitsz@appendix@chapter*{\hitsz@acknowledgement@ctitle}[\hitsz@acknowledgement@etitle]}{} +\newenvironment{resume}{% + \ifhitsz@openright\cleardoublepage\else\clearpage\fi + \hitsz@appendix@chapter*{\hitsz@resume@ctitle}[\hitsz@resume@etitle]}{} +\newenvironment{publication}{% + \ifhitsz@openright\cleardoublepage\else\clearpage\fi + \hitsz@appendix@chapter*{\hitsz@publication@ctitle}[\hitsz@publication@etitle]}{} +\newenvironment{ceindex}{% + \ifhitsz@openright\cleardoublepage\else\clearpage\fi + \hitsz@appendix@chapter*{\indexname}[\hitsz@index@etitle] + \setlength{\columnsep}{4em} + \begin{adjustwidth}{2em}{2em} + \begin{multicols*}{2}}{\end{multicols*} + \end{adjustwidth} } + +\newlist{idxwordlist}{description}{3} +\setlist[idxwordlist, 1]{% + itemsep=\baselineskip, + labelindent=8em, + font=\normalsize\bfseries, +} +\setlist[idxwordlist, 2]{% + nosep, + labelindent=2em, + font=\wuhao\rm, +} +\setlist[idxwordlist, 3]{% + nosep, + labelindent=4em, + font=\wuhao\rm, +} + +\def\hitsz@authorization@other{% + \ifhitsz@openright\cleardoublepage\else\clearpage\fi + \hitsz@appendix@chapter*{\hitsz@authorization@ctitle}[\hitsz@authorization@etitle] + \xiaosi[1.6]\vspace{\baselineskip} + \begin{center}\xiaosan\heiti\hitsz@declarename\end{center} + \par\hitsz@declaretext + \vspace{\baselineskip} + \par\hspace{6em}\hitsz@authorsig\hfill\hitsz@frontdate\hitsz@datefill + \vspace{2\baselineskip} + \begin{center}\xiaosan\heiti\hitsz@authorizationtitle\end{center} + \par\hitsz@authorizationtext + \vspace{2\baselineskip} + \par\hspace{6em}\hitsz@authorsig\hfill\hitsz@frontdate\hitsz@datefill + \vspace{2\baselineskip} + \par\hspace{6em}\hitsz@teachersig\hfill\hitsz@frontdate\hitsz@datefill +} +\def\hitsz@authorization@bachelor@toc{% + \ifhitsz@shenzhen% + 原创性声明 + \else% + \hitsz@declarename@bachelor + \fi +} +\def\hitsz@authorization@bachelor{% + \ifhitsz@openright\cleardoublepage\else\clearpage\fi + \chapter*{\ifhitsz@harbin\relax\else\sanhao\fi\hitsz@declarename@bachelor} + \addcontentsline{toc}{chapter}{\hitsz@authorization@bachelor@toc} + \hitsz@authorizationtext@bachelor +\vspace{2\baselineskip} +\par\hspace{6em}\hitsz@authorsig\hfill\hitsz@frontdate\hitsz@datefill } -\pdfstringdefDisableCommands{% - \def\quad{}% - \def\hskip#1{}% + +\NewDocumentCommand{\authorization}{o}{% + \IfNoValueTF{#1}{% + \ifhitsz@bachelor\hitsz@authorization@bachelor\else\hitsz@authorization@other\fi + }{% + \includepdf[fitpaper=true,pagecommand={% +\thispagestyle{hitsz@empty}% + \phantomsection + \addcontentsline{toc}{chapter}{% + \ifhitsz@bachelor\hitsz@declarename@bachelor + \else\hitsz@authorization@ctitle + \fi}% +\ifhitsz@doctor% + \addcontentsline{toe}{chapter}{% + \texorpdfstring{\bfseries \hitsz@authorization@etitle}{\hitsz@authorization@etitle}}% +\fi% + }]{#1}% + }% } +\newcommand\bibstyle@numerical{\bibpunct{[}{]}{,}{s}{,}{\textsuperscript{,}}} +\newcommand\bibstyle@authoryear{\bibpunct{(}{)}{;}{a}{,}{,}} +\newcommand\bibstyle@inline{\bibpunct{[}{]}{,}{n}{,}{\hitsz@inline@sep}} +\citestyle{numerical} +\DeclareRobustCommand\inlinecite{\@inlinecite} +\def\@inlinecite#1{\begingroup\citestyle{inline}\let\@cite\NAT@citenum\citep{#1}\endgroup} +\let\onlinecite\inlinecite +\renewenvironment{thebibliography}[1]{% + \ifhitsz@openright\cleardoublepage\else\clearpage\fi\phantomsection% + \hitsz@appendix@chapter*{\bibname}[\hitsz@bibname@etitle] + \normalsize + \list{\@biblabel{\@arabic\c@enumiv}}% + {\renewcommand{\makelabel}[1]{##1\hfill} + \settowidth{\labelwidth}{\@biblabel{#1}} + \setlength{\labelsep}{0.5em} + \setlength{\itemindent}{0pt} + \setlength{\leftmargin}{\labelsep+\labelwidth} + \addtolength{\itemsep}{-0.8em} + \usecounter{enumiv}% + \let\p@enumiv\@empty + \renewcommand\theenumiv{\@arabic\c@enumiv}}% + \sloppy\frenchspacing + \flushbottom + \ifhitsz@splitbibitem + \clubpenalty0 + \@clubpenalty \clubpenalty + \widowpenalty0% + \interlinepenalty-50% + \else + \clubpenalty4000 + \@clubpenalty \clubpenalty + \widowpenalty4000% + \interlinepenalty4000% + \fi +\sfcode`\.\@m} +{\def\@noitemerr + {\@latex@warning{Empty `thebibliography' environment}}% +\endlist\frenchspacing} +\patchcmd\NAT@citexnum{% + \@ifnum{\NAT@ctype=\z@}{% + \if*#2*\else\NAT@cmt#2\fi + }{}% + \NAT@mbox{\NAT@@close}% +}{% + \NAT@mbox{\NAT@@close}% + \@ifnum{\NAT@ctype=\z@}{% + \if*#2*\else\textsuperscript{#2}\fi + }{}% +}{}{} +\renewcommand\NAT@citesuper[3]{\ifNAT@swa + \if*#2*\else#2\NAT@spacechar\fi +\unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close\if*#3*\else#3\fi}% + \else #1\fi\endgroup} +\patchcmd{\NAT@citex}{% + \if*#2*\else\NAT@cmt#2\fi + \if\relax\NAT@date\relax\else\NAT@@close\fi +}{% + \if\relax\NAT@date\relax\else\NAT@@close\fi + \if*#2*\else\textsuperscript{#2}\fi +}{}{} +\renewcommand\NAT@cite% + [3]{\ifNAT@swa\NAT@@open\if*#2*\else#2\NAT@spacechar\fi + #1\NAT@@close\if*#3*\else\textsuperscript{#3}\fi\else#1\fi\endgroup} +\AtEndOfClass{\input{hitszthesis.cfg}} \AtEndOfClass{\sloppy} \endinput %% diff --git a/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty b/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty index 392775978cb..2d787274f6a 100644 --- a/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty +++ b/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty @@ -11,22 +11,450 @@ % % This work has the LPPL1.3c maintenance status `maintained'. % -\ProvidesPackage{hitszthesis}[2020/03/05 v2.2 A Collection of Styles for Bachelor Thesis of Harbin Institute of Technology, ShenZhen] +\ProvidesPackage{hitszthesis}[2020/03/10 2.4 Style Collection of Dissertation Template for Harbin Institute of Technology, ShenZhen (HITSZ)] -% 将引入的宏包以及各种自定义命令都放在这里 -% 在 \file{main.tex} 中使用 |\usepackage{hitszthesis}| 引入本文件 +% 此文件声明不在规范中要求的格式所使用的宏包 -% 加载宏包 -% \RequirePackage{package} +% 根据窝工规范中对数字书写规范的规定(6): +% 凡4位或4位以上的数都从个位起每3位数空半个数码(1/4汉字)。 +% 注意此处,除此任何空格都是错误的(包括\:\;\ 等) +\RequirePackage{siunitx} +\sisetup{group-minimum-digits=4, group-separator= \hspace{0.25em}} +\sisetup{detect-weight,detect-mode,detect-family} -% 自定义命令 -% \newcommand\totallynewcommand{command details} -% \renewcommand\existedcommand{command details} +% 处理数学公式中的黑斜体的宏包 +\RequirePackage{bm} -% etc +% 不同于 \mathcal \mathfrak 之类的英文花体字体 +\RequirePackage{mathrsfs} +% 支持彩色 +\RequirePackage{xcolor} +\definecolor{colorzero}{rgb}{0, 0, 0} +\definecolor{colorone}{rgb}{1, 0, 0} +\definecolor{colortwo}{rgb}{0, 0, 1} +\definecolor{colorthree}{rgb}{0, 1, 0} +% 图形和表格的控制旋转 +\RequirePackage{rotating} +% 算法的宏包,注意宏包兼容性,先后顺序为 float、hyperref、algorithm(2e),否则无法 +% 生成算法列表。我工算法混乱问题详见hithesis文档。各个实验室设置具体方法详见 +% hithesis文档或者示例中给出的地址。 +\RequirePackage[algoruled,linesnumbered,algochapter]{algorithm2e} +\SetAlCapSty{} +\newcommand{\foocaption}[1]{ \def\@algocf@pre@plainruled{\hrule height1.5pt depth0pt\kern\interspacetitleruled #1 \kern\interspacealgoruled\hrule height1pt depth0pt\kern\interspacetitleruled} } +\def\@algocf@post@ruled{\kern\interspacealgoruled\hrule height1.5pt\relax}% -% 结束输入 +% 算法英文标题 +\newcommand{\algoenname}{Algo.} +\newfloatlist[chapter]{algoen}{aen}{\listalgoenname}{\algoenname} +\newfixedcaption{\algoencaption}{algoen} +\renewcommand{\thealgoen}{\thechapter-\arabic{algocf}} +\renewcommand{\@cftmakeaentitle}{\chapter*{\listalgoenname\@mkboth{\listalgoenname}{\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} + +% 定义代码颜色 +\definecolor{lightgrey}{rgb}{0.9,0.9,0.9} +\definecolor{frenchplum}{RGB}{190,20,83} +\definecolor{winered}{rgb}{0.5,0,0} + +% 设置 \LaTeX 代码排版样式 +\lstset{language = [LaTeX]TeX, + basicstyle = \small\ttfamily, + texcsstyle = *\color{winered}, + numbers = left, + stepnumber=1, + numberstyle=\small\ttfamily, + numbersep=10pt, + mathescape, + breaklines = true, + keywordstyle = \color{winered}, + commentstyle = \color{gray}, + emph = {fontenc,fontspec,xeCJK,FiraMono,xunicode,newtxmath, + figure,fig,image,img,table,itemize,enumerate,newtxtext,newtxtt, + ctex, microtype,description,times,newtx,booktabs,tabular, + PDFLaTeX,XeLaTeX,type1cm,BibTeX,device,color,mode,lang, + amsthm,tcolorbox,titlestyle,cite,marginnote,ctex,listings,base, + subnumcases,subeqnarray}, + emphstyle = {\color{frenchplum}}, + morekeywords = {DeclareSymbolFont,SetSymbolFont,toprule,midrule,bottomrule, + institute,version,includegraphics,setmainfont,setsansfont, + setmonofont,setCJKmainfont,setCJKsansfont,setCJKmonofont, + RequirePackage,figref, tabref,email,maketitle,keywords,definecolor, + extrainfo,logo,cover,subtitle,appendix,chapter,hypersetup, + mainmatter,frontmatter,tableofcontents, hitszpar,heiti,kaishu,lstset, + pagecolor,zhnumber,marginpar,part, equote,marginnote,slabel}, + frame = single, + tabsize = 2, + rulecolor = \color{black}, + framerule = 0.2pt, + columns = flexible, + % backgroundcolor = \color{lightgrey} +} + +% 或者使用minted 包。如果使用该包,需要在编译时加-shell-escape选项,且需要安装 +% pygmentatize 工具对代码进行高亮。 +% \RequirePackage{minted} +% + +% 术语宏包,用来处理首次全写,之后缩写的问题 +\RequirePackage{glossaries} +\setacronymstyle{short-long} +\renewcommand*{\genacrfullformat}[2]{% + \glsentrylong{#1}% +} +\makeglossaries + +% 添加术语举例 +\newacronym{tssbp}{树结构折筷过程}{树结构折筷过程(Tree-structured Stick-breaking process)} +\def\gtssbp{\gls{tssbp}\sindex[china]{shu!树结构折筷过程}\sindex[english]{Tree-structured Stick-breaking process}} + +\newacronym[shortplural=SCNAs,longplural={体细胞拷贝数变异(Somatic copy number alternation,SCNA)}]{scna}{SCNA}{体细胞拷贝数变异(Somatic copy number alternation,SCNA)} +\def\gscna{\gls{scna}\sindex[china]{ti!体细胞拷贝数变异}\sindex[english]{Somatic copy number alternation}\ignorespaces} +\def\gscnas{\glspl{scna}\sindex[china]{ti!体细胞拷贝数变异}\sindex[english]{Somatic copy number alternation}\ignorespaces} + +% tikz做图宏宏包 +\usepackage{tikz} +% 此处可以定义一些tikz全局样式 +% \tikzstyle{nodestyle}= [circle, fill=gray!60] +% \tikzstyle{edgestyle}= [-latex] + +\tikzstyle{maternal}= [colorone] +\tikzstyle{paternal}= [colortwo] +\tikzstyle{variant}= [colorthree!80!colorzero] +\tikzstyle{reference}= [colorzero] + +\tikzstyle{aallele}= [colorzero,rotate=90] +\tikzstyle{ballele}= [colorthree!80!colorzero,rotate=90] + +\tikzstyle{refseg}= [colorzero,draw=colorzero, opacity=0.2] +\tikzstyle{mseg}= [colorone,draw=colorone, opacity=0.2] +\tikzstyle{pseg}= [colortwo,draw=colortwo, opacity=0.2] +\tikzstyle{vseg}= [colorthree!80!colorzero,draw=colorthree!80!colorzero, opacity=0.6] + +\tikzstyle{bncell}= [draw=colorzero,opacity=0.2,line width=2pt, rounded corners=1pt] +\tikzstyle{btcell}= [draw=colorone,opacity=0.6, line width=2pt, rounded corners=1pt] + +\tikzstyle{tncell}= [colorzero,opacity=0.9] +\tikzstyle{ttcell}= [colorone,opacity=0.6] +\tikzstyle{tscell}= [colorzero] +\tikzstyle{refcell}= [colorzero] + +\tikzstyle{evolve}= [->,draw=colortwo,opacity=0.3,line width=1.5pt] +\tikzstyle{fakeevolve}= [->,draw=colorzero,opacity=0.3,line width=1.5pt] + +\tikzstyle{refline}= [dashed,draw=colorzero,line width=1pt] +\tikzstyle{tnline}= [dashed,draw=colorzero,opacity=0.3,line width=1pt] + +\newcommand{\gseg}[9]{% + \pgfmathsetmacro{\sstartx}{#1} + \pgfmathsetmacro{\slengx}{#2} + \pgfmathsetmacro{\sy}{#3} + \pgfmathsetmacro{\sdy}{#4} + \pgfmathsetmacro{\sdx}{#5} + \pgfmathsetmacro{\sdxh}{#7} + \pgfmathsetmacro{\sdxt}{#8} + \fill[#6](\sstartx,\sy)--(\sstartx-\sdx,\sy+\sdy)-- + (\slengx+\sstartx+1.5-\sdx,\sy+\sdy)--(\slengx+\sstartx+1.5,\sy)-- + (\slengx+\sstartx+1.5-\sdx,\sy-\sdy)--(\sstartx-\sdx,\sy-\sdy)--cycle; + \draw[#9] (\sstartx-\sdxh,\sy) -- (\sstartx, \sy); + \draw[#9] (\slengx+\sstartx+1.5, \sy) -- (\slengx+\sstartx+1.5+\sdxt,\sy); +} +\newcommand{\gsegr}[9]{% + \pgfmathsetmacro{\sstartx}{#1} + \pgfmathsetmacro{\slengx}{#2} + \pgfmathsetmacro{\sy}{#3} + \pgfmathsetmacro{\sdy}{#4} + \pgfmathsetmacro{\sdx}{#5} + \pgfmathsetmacro{\sdxh}{#7} + \pgfmathsetmacro{\sdxt}{#8} + \fill[#6](\sstartx-0.5,\sy)--(\sstartx+\sdx-0.5,\sy+\sdy)-- + (\slengx+\sstartx+1.5+\sdx-0.5,\sy+\sdy)--(\slengx+\sstartx+1.5-0.5,\sy)-- + (\slengx+\sstartx+1.5+\sdx-0.5,\sy-\sdy)--(\sstartx+\sdx-0.5,\sy-\sdy)--cycle; + \draw[#9] (\sstartx-\sdxh-0.5,\sy) -- (\sstartx-0.5, \sy); + \draw[#9] (\slengx+\sstartx+1.5-0.5, \sy) -- (\slengx+\sstartx+1.5+\sdxt-0.5,\sy); +} + +\newcommand{\rcell}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node at (\x+10, \y) {Reference}; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[aallele]{C}; + \draw (\x+3,\y) node[aallele]{T}; + \draw (\x+4,\y) node[aallele]{C}; + \gseg{\x}{4}{\y}{0.2}{0.5}{refseg}{1.5}{1}{reference}; +} + +\newcommand{\ncell}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node [maternal] at (\x+8, \y) {M}; + %\node [paternal] at (\x+8, \y-0.5) {P}; + \draw[bncell](\x-2,\y+0.5)--(\x+7,\y+0.5)-- + (\x+7,\y-1)--(\x-2,\y-1)--cycle; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[ballele]{G}; + \draw (\x+3,\y) node[aallele]{T}; + \draw (\x+4,\y) node[aallele]{C}; + \gseg{\x}{4}{\y}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-0.5) node[ballele]{T}; + \draw (\x+2,\y-0.5) node[aallele]{C}; + \draw (\x+3,\y-0.5) node[aallele]{T}; + \draw (\x+4,\y-0.5) node[ballele]{A}; + \gseg{\x}{4}{\y-0.5}{0.2}{0.5}{pseg}{1.5}{1}{paternal}; +} + +\newcommand{\tcellone}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node [maternal] at (\x+8, \y) {M}; + %\node [maternal] at (\x+8, \y-0.5) {M}; + %\node [paternal] at (\x+8, \y-1) {P}; + \draw[btcell](\x-2,\y+0.5)--(\x+7,\y+0.5)-- + (\x+7,\y-1.5)--(\x-2,\y-1.5)--cycle; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[ballele]{G}; + \draw (\x+3,\y) node[aallele]{T}; + \draw (\x+4,\y) node[aallele]{C}; + \gseg{\x}{4}{\y}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-0.5) node[aallele]{A}; + \draw (\x+2,\y-0.5) node[ballele]{G}; + \draw (\x+3,\y-0.5) node[aallele]{T}; + \draw (\x+4,\y-0.5) node[aallele]{C}; + \gseg{\x}{4}{\y-0.5}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-1) node[ballele]{T}; + \draw (\x+2,\y-1) node[aallele]{C}; + \draw (\x+3,\y-1) node[aallele]{T}; + \draw (\x+4,\y-1) node[ballele]{A}; + \gseg{\x}{4}{\y-1}{0.2}{0.5}{pseg}{1.5}{1}{paternal}; +} + +\newcommand{\tcellthree}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node [maternal] at (\x+12, \y) {M}; + %\node [paternal] at (\x+12, \y-0.5) {P}; + \draw[btcell](\x-2,\y+0.5)--(\x+11,\y+0.5)-- + (\x+11,\y-1)--(\x-2,\y-1)--cycle; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[ballele]{G}; + \gseg{\x}{2}{\y}{0.2}{0.5}{mseg}{1.5}{0}{maternal}; + \gseg{\x+4}{0}{\y}{0.2}{0.5}{vseg}{0.5}{0.5}{variant}; + \draw (\x+7,\y) node[aallele]{T}; + \draw (\x+8,\y) node[aallele]{C}; + \gseg{\x+6}{2}{\y}{0.2}{0.5}{mseg}{0}{1}{maternal}; + \draw (\x+1,\y-0.5) node[ballele]{T}; + \draw (\x+2,\y-0.5) node[aallele]{C}; + \draw (\x+3,\y-0.5) node[aallele]{T}; + \draw (\x+4,\y-0.5) node[ballele]{A}; + \gseg{\x}{4}{\y-0.5}{0.2}{0.5}{pseg}{1.5}{1}{paternal}; +} + +\newcommand{\tcellfour}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node [maternal] at (\x+18, \y) {M}; + %\node [paternal] at (\x+18, \y-0.5) {P}; + \draw[btcell](\x-2,\y+0.5)--(\x+15,\y+0.5)-- + (\x+15,\y-1)--(\x-2,\y-1)--cycle; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[ballele]{G}; + \gseg{\x}{2}{\y}{0.2}{0.5}{mseg}{1.5}{0}{maternal}; + \gseg{\x+4}{0}{\y}{0.2}{0.5}{vseg}{0.5}{0.5}{variant}; + \draw (\x+7,\y) node[aallele]{T}; + \gseg{\x+6}{1}{\y}{0.2}{0.5}{mseg}{0}{0}{maternal}; + \gseg{\x+9}{0}{\y}{0.2}{0.5}{vseg}{0.5}{0.5}{variant}; + \draw (\x+12,\y) node[aallele]{C}; + \gseg{\x+11}{1}{\y}{0.2}{0.5}{mseg}{0}{1}{maternal}; + \draw (\x+1,\y-0.5) node[ballele]{T}; + \draw (\x+2,\y-0.5) node[aallele]{C}; + \draw (\x+3,\y-0.5) node[aallele]{T}; + \draw (\x+4,\y-0.5) node[ballele]{A}; + \gseg{\x}{4}{\y-0.5}{0.2}{0.5}{pseg}{1.5}{1}{paternal}; +} + +\newcommand{\tcelltwo}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node [maternal] at (\x+8, \y) {M}; + %\node [maternal] at (\x+8, \y-0.5) {M}; + %\node [paternal] at (\x+8, \y-1) {P}; + \draw[btcell](\x-2,\y+0.5)--(\x+7,\y+0.5)-- + (\x+7,\y-1.5)--(\x-2,\y-1.5)--cycle; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[ballele]{G}; + \draw (\x+3,\y) node[aallele]{T}; + \draw (\x+4,\y) node[aallele]{C}; + \gseg{\x}{4}{\y}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-0.5) node[aallele]{A}; + \draw (\x+2,\y-0.5) node[ballele]{G}; + \draw (\x+3,\y-0.5) node[aallele]{T}; + \draw (\x+4,\y-0.5) node[ballele]{G}; + \gseg{\x}{4}{\y-0.5}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-1) node[ballele]{T}; + \draw (\x+2,\y-1) node[aallele]{C}; + \draw (\x+3,\y-1) node[aallele]{T}; + \draw (\x+4,\y-1) node[ballele]{A}; + \gseg{\x}{4}{\y-1}{0.2}{0.5}{pseg}{1.5}{1}{paternal}; +} + + +\newcommand{\tcellfive}[2]{% + \pgfmathsetmacro{\x}{#1} + \pgfmathsetmacro{\y}{#2} + %\node [maternal] at (\x+8, \y) {M}; + %\node [maternal] at (\x+8, \y-0.5) {M}; + %\node [paternal] at (\x+8, \y-1) {P}; + \draw[btcell](\x-2,\y+0.5)--(\x+9.5,\y+0.5)-- + (\x+9.5,\y-1.5)--(\x-2,\y-1.5)--cycle; + \draw (\x+1,\y) node[aallele]{A}; + \draw (\x+2,\y) node[ballele]{G}; + \draw (\x+3,\y) node[aallele]{T}; + \draw (\x+4,\y) node[aallele]{C}; + \gseg{\x}{4}{\y}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-0.5) node[aallele]{A}; + \draw (\x+2,\y-0.5) node[ballele]{G}; + \draw (\x+3,\y-0.5) node[aallele]{T}; + \draw (\x+4,\y-0.5) node[aallele]{C}; + \gseg{\x}{4}{\y-0.5}{0.2}{0.5}{mseg}{1.5}{1}{maternal}; + \draw (\x+1,\y-1) node[ballele]{T}; + \gseg{\x}{1}{\y-1}{0.2}{0.5}{pseg}{1.5}{0}{paternal}; + \draw (\x+4.5,\y-1) node[ballele]{A}; + \draw (\x+5.5,\y-1) node[aallele]{T}; + \draw (\x+6.5,\y-1) node[aallele]{C}; + \gsegr{\x+3.5}{3}{\y-1}{0.2}{0.5}{pseg}{0.5}{1.5}{paternal}; +} + +% 最后定义一些常见的数学公式样式 +\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}}}} + +% 新简记数学命令 +\newcommand\dif{\text{d}} +\newcommand\no{\noindent} +\newcommand\dis{\displaystyle} +\newcommand\ls{\leqslant} +\newcommand\gs{\geqslant} + +% 极限 +\newcommand\limit{\dis\lim\limits} +\newcommand\limn{\dis\lim\limits_{n\to\infty}} +\newcommand\limxz{\dis\lim\limits_{x\to0}} +\newcommand\limxi{\dis\lim\limits_{x\to\infty}} +\newcommand\limxpi{\dis\lim\limits_{x\to+\infty}} +\newcommand\limxni{\dis\lim\limits_{x\to-\infty}} +\newcommand\limtpi{\dis\lim\limits_{t\to+\infty}} +\newcommand\limtni{\dis\lim\limits_{t\to-\infty}} + +% n求和 +\newcommand\sumn{\dis\sum\limits_{n=1}^{\infty}} +\newcommand\sumnz{\dis\sum\limits_{n=0}^{\infty}} + +% i求和 +\newcommand\sumi{\dis\sum\limits_{i=1}^{\infty}} +\newcommand\sumiz{\dis\sum\limits_{i=0}^{\infty}} +\newcommand\sumin{\dis\sum\limits_{i=1}^{n}} +\newcommand\sumizn{\dis\sum\limits_{i=0}^{n}} + +% k求和 +\newcommand\sumk{\dis\sum\limits_{k=1}^{\infty}} +\newcommand\sumkz{\dis\sum\limits_{k=0}^{\infty}} +\newcommand\sumkn{\dis\sum\limits_{k=0}^n} +\newcommand\sumkfn{\dis\sum\limits_{k=1}^n} + +% z偏微分 +\newcommand\pzx{\dis\frac{\partial z}{\partial x}} +\newcommand\pzy{\dis\frac{\partial z}{\partial y}} + +% f偏微分 +\newcommand\pfx{\dis\frac{\partial f}{\partial x}} +\newcommand\pfy{\dis\frac{\partial f}{\partial y}} + +% z二重偏微分 +\newcommand\pzxx{\dis\frac{\partial^2 z}{\partial x^2}} +\newcommand\pzxy{\dis\frac{\partial^2 z}{\partial x\partial y}} +\newcommand\pzyx{\dis\frac{\partial^2 z}{\partial y\partial x}} +\newcommand\pzyy{\dis\frac{\partial^2 z}{\partial y^2}} + +% f二重偏微分 +\newcommand\pfxx{\dis\frac{\partial^2 f}{\partial x^2}} +\newcommand\pfxy{\dis\frac{\partial^2 f}{\partial x\partial y}} +\newcommand\pfyx{\dis\frac{\partial^2 f}{\partial y\partial x}} +\newcommand\pfyy{\dis\frac{\partial^2 f}{\partial y^2}} + +% 积分 +\newcommand\intzi{\dis\int_{0}^{+\infty}} +\newcommand\intd{\dis\int} +\newcommand\intab{\dis\int_a^b} + +% 角度符号 +\newcommand{\degree}{^\circ} + +% 花体 +\newcommand\ma{\mathcal{A}} +\newcommand\mb{\mathcal{B}} +\newcommand\mc{\mathcal{C}} +\newcommand\me{\mathcal{E}} +\newcommand\mg{\mathcal{g}} + +% 重体 +\newcommand\mcc{\mathbb{C}} +\newcommand\mrr{\mathbb{R}} +\newcommand\mzz{\mathbb{Z}} + +% 向量 +\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} +\DeclareMathOperator{\arcsinh}{arcsinh} +\DeclareMathOperator{\arctanh}{arctanh} +\DeclareMathOperator{\arccoth}{arccoth} +\DeclareMathOperator{\grad}{\bf{grad}} +\DeclareMathOperator{\argmax}{argmax} +\DeclareMathOperator{\argmin}{argmin} +\DeclareMathOperator{\diag}{diag} +\DeclareMathOperator{\csign}{csign} + +% 定义命令 +\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 |