diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/hithesis/hithesis.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/hithesis/hithesis.cls | 152 |
1 files changed, 93 insertions, 59 deletions
diff --git a/Master/texmf-dist/tex/latex/hithesis/hithesis.cls b/Master/texmf-dist/tex/latex/hithesis/hithesis.cls index f3659498d67..e9dc36c4c86 100644 --- a/Master/texmf-dist/tex/latex/hithesis/hithesis.cls +++ b/Master/texmf-dist/tex/latex/hithesis/hithesis.cls @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2017-2018 by Chu Yanshuo <yanshuoc@gmail.com> +%% Copyright (C) 2017-2019 by Chu Yanshuo <yanshuoc@gmail.com> %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3a @@ -25,7 +25,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{hithesis} -[2017/11/5 1.0.9 Harbin Institute of Technology] +[2018/12/05 2.0.6 Harbin Institute of Technology Thesis Template] \RequirePackage{ifthen} \RequirePackage{kvoptions} \SetupKeyvalOptions{ @@ -40,6 +40,12 @@ \hit@masterfalse \hit@doctorfalse \expandafter\csname hit@#1true\endcsname} +\newif\ifhit@geometrynewone +\newif\ifhit@geometrynewtwo +\define@key{hit}{newgeometry}{% + \hit@geometrynewonefalse + \hit@geometrynewtwofalse + \expandafter\csname hit@geometrynew#1true\endcsname} \DeclareBoolOption[false]{arialtoc} \DeclareBoolOption[false]{arialtitle} \DeclareBoolOption[true]{raggedbottom} @@ -51,10 +57,15 @@ \DeclareBoolOption[true]{fulltime} \DeclareBoolOption[false]{subtitle} \DeclareBoolOption[false]{debug} -\DeclareBoolOption[false]{newgeometry} \DeclareBoolOption[false]{openright} \DeclareBoolOption[false]{capcenterlast} \DeclareBoolOption[false]{subcapcenterlast} +\DeclareBoolOption[false]{absupper} +\DeclareBoolOption[false]{bsmainpagenumberline} +\DeclareBoolOption[false]{bsfrontpagenumberline} +\DeclareBoolOption[true]{bsheadrule} +\DeclareBoolOption[true]{newtxmath} +\DeclareBoolOption[false]{splitbibitem} \DeclareStringOption{fontset} \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}} \ProcessKeyvalOptions* @@ -103,7 +114,9 @@ \RequirePackage{xparse} \RequirePackage{amsmath} \RequirePackage[defaultsups]{newtxtext} +\ifhit@newtxmath \RequirePackage{newtxmath} +\fi \RequirePackage{courier} \RequirePackage{graphicx} \RequirePackage{pdfpages} @@ -143,7 +156,18 @@ ignoreall, nomarginpar, } -\ifhit@newgeometry% +\ifhit@geometrynewtwo% +\geometry{ + centering, + text={150true mm,236true mm}, + left=30true mm, + head=5true mm, + headsep=2true mm, + footskip=0true mm, + foot=5.2true mm +} +\else% +\ifhit@geometrynewone% \geometry{ centering, text={150true mm,240true mm}, @@ -155,14 +179,15 @@ } \else% \geometry{%根据PlutoThesis 原版定义而来 - text={150true mm,224true mm}, - top=35.5true mm, - left=30true mm, - head=5true mm, - headsep=2.5true mm, - foot=8.5true mm +text={150true mm,224true mm}, +top=35.5true mm, +left=30true mm, +head=5true mm, +headsep=2.5true mm, +foot=8.5true mm } -\fi +\fi% +\fi% \ifhit@debug% \RequirePackage{layout} \RequirePackage{layouts} @@ -171,6 +196,7 @@ \RequirePackage{fancyhdr} \RequirePackage{tabularx} \RequirePackage{varwidth} +\RequirePackage{changepage} \RequirePackage{multicol} \RequirePackage{amssymb} \RequirePackage[below]{placeins}%允许上一个section的浮动图形出现在下一个section的开始部分,还提供\FloatBarrier命令,使所有未处理的浮动图形立即被处理 @@ -245,14 +271,6 @@ \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } - -\fancypagestyle{hit@plain}{% - \fancyhead{} - \fancyfoot[C]{\xiaowu\thepage} - \renewcommand{\headrulewidth}{0pt} - \renewcommand{\footrulewidth}{0pt} -} - \fancypagestyle{hit@headings}{% \fancyhf{} \ifhit@doctor @@ -265,23 +283,32 @@ \fi \ifhit@bachelor \fancyhead[C]{\songti\xiaowu[0]\hit@cschoolname\hit@bachelor@cxuewei\hit@bachelor@cthesisname}% - \fancyfoot[C]{\xiaowu \thepage} + \fancyfoot[C]{\xiaowu\if@mainmatter\ifhit@bsmainpagenumberline-~\thepage~-\else\thepage\fi\else\ifhit@bsfrontpagenumberline-~\thepage~-\else\thepage\fi\fi} + \ifhit@bsheadrule + \renewcommand{\headrule}{ + \vskip 1.190132pt + \hrule\@height2.276208pt\@width\headwidth + \vskip 0.75pt + \hrule\@height.75pt\@width\headwidth + } \else - \fancyfoot[C]{\xiaowu -~\thepage~-} + \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 % 此处可能和word模板不一致 % 页眉中小五汉字,0行距时,占用9bt,页眉高度为14pt, 所以以下数字之和要保持等于14pt-9bt=4.96634pt % 根据PlutoThesis模板中rule宽度定义为2.25, 0.75, 保持粗线和细线之间的间距为细线宽度。 % 如果页眉是多行的情况,rule向下溢出 - \renewcommand{\headrule}{ - \vskip 1.190132pt - \hrule\@height2.276208pt\@width\headwidth - \vskip 0.75pt - \hrule\@height.75pt\@width\headwidth - } \renewcommand{\footrulewidth}{0pt} } - \AtBeginDocument{%此处解决页眉经典bug \pagestyle{hit@empty} \renewcommand{\chaptermark}[1]{\@mkboth{\CTEXthechapter\enspace#1}{}}} @@ -312,6 +339,7 @@ \apptocmd{\@makefntext}{\let\@makefnmark\hit@makefnmark}{}{} \allowdisplaybreaks[4] \predisplaypenalty=0 %公式之前可以换页,公式出现在页面顶部 +\postdisplaypenalty=0 \renewcommand\theequation{\ifnum \c@chapter>\z@ \thechapter-\fi\@arabic\c@equation} \def\make@df@tag{\@ifstar\hit@make@df@tag@@\make@df@tag@@@} \def\hit@make@df@tag@@#1{\gdef\df@tag{\hit@maketag{#1}\def\@currentlabel{#1}}} @@ -326,12 +354,9 @@ \def\hit@maketag#1{\maketag@@@{(\ignorespaces #1\unskip\@@italiccorr)}} \def\tagform@#1{\maketag@@@{(\ignorespaces #1\unskip\@@italiccorr)\equcaption{#1}}} \renewcommand{\eqref}[1]{\textup{(\ref{#1})}} -\setlength{\floatsep}{\ifhit@glue 20.50398bp \@plus 2.83465bp \@minus 0bp\else 21bp\fi} -\setlength{\intextsep}{\ifhit@glue 20.50398bp \@plus 2.83465bp \@minus 0bp\else 21bp\fi} -\setlength{\textfloatsep}{\ifhit@glue 20.50398bp \@plus 2.83465bp \@minus 0bp\else 21bp\fi} -\setlength{\@fptop}{0bp} -\setlength{\@fpsep}{\ifhit@glue 20.50398bp \@plus 2.83465bp \@minus 0bp\else 21bp\fi} -\setlength{\@fpbot}{0bp} +\setlength{\intextsep}{\ifhit@glue 8.50398bp \@plus 2.83465bp \@minus 0bp\else 8.50398bp\fi} +\setlength{\textfloatsep}{\ifhit@glue 8.50398bp \@plus 2.83465bp \@minus 0bp\else 8.50398bp\fi} +\setlength{\floatsep}{\ifhit@glue 20.50398bp \@plus 2.83465bp \@minus 0bp\else 20.50398bp\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}}} @@ -339,14 +364,6 @@ \renewcommand{\topfraction}{0.85} \renewcommand{\bottomfraction}{0.65} \renewcommand{\floatpagefraction}{0.60} -\let\hit@oldfigure\figure -\let\hit@oldendfigure\endfigure -\def\figure{\begingroup\hit@oldfigure} -\def\endfigure{\vskip-1em\hit@oldendfigure\endgroup} -\let\hit@oldtable\table -\let\hit@oldendtable\endtable -\def\table{\begingroup\hit@oldtable} -\def\endtable{\vskip-1em\hit@oldendtable\endgroup} \long\def\@makecaption#1#2{% \vskip\abovecaptionskip \wuhao\sbox\@tempboxa{#1\ifhit@bachelor\hskip\ccwd\else\enskip\fi#2}% @@ -410,7 +427,9 @@ \setlength{\listparindent}{0pt} % 段落缩进量 }} {\end{list}} -\theoremstyle{plain} +\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$} @@ -492,15 +511,18 @@ { \phantomsection \markboth{#2}{#2} - \addcontentsline{toc}{chapter}{\ifhit@arialtitle\sffamily\heiti\else\heiti\fi #2} - \IfValueT{#3}{\addcontentsline{toe}{chapter}{\bfseries #3}} + \ifthenelse% + {\equal{#2}{\eabstractcname}}% + {\addcontentsline{toc}{chapter}{\texorpdfstring{\ifhit@arialtitle\sffamily\heiti\else\heiti\fi \ifhit@absupper\MakeUppercase{#2}\else#2\fi}{#2}}} + {\addcontentsline{toc}{chapter}{\texorpdfstring{\ifhit@arialtitle\sffamily\heiti\else\heiti\fi #2}{#2}}} + \IfValueT{#3}{\addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries #3}{#3}}} \hit@chapter*{#2} } } \newcommand{\BiAppChapter}[2] % 该附录命令适用于有章节的完整附录 {\phantomsection \chapter{#1} - \addcontentsline{toe}{chapter}{\bfseries \xiaosi Appendix \thechapter~~#2} + \addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries \xiaosi Appendix \thechapter~~#2}{Appendix \thechapter~~#2}} } \let\hit@chapter\chapter \RenewDocumentCommand{\chapter}{s o m o}{% @@ -509,7 +531,7 @@ {% if \chapter* \hit@chapter*{#3}% \IfValueT{#4}{% - \addcontentsline{toe}{chapter}{\bfseries #4} + \addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries #4}{#4}} } }% {% if \chapter @@ -517,7 +539,7 @@ {\hit@chapter{#3}}% {\hit@chapter[#2]{#3}}% \IfValueT{#4}{% - \addcontentsline{toe}{chapter}{\bfseries\relax Chapter \thechapter\hspace{0.5em}\ignorespaces #4} + \addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries\relax Chapter \thechapter\hspace{0.5em}\ignorespaces #4}{Chapter \thechapter\hspace{0.5em}\ignorespaces #4}} } } } @@ -588,6 +610,7 @@ \hit@def@term{natclassifiedindex} %国内图书分类号 \hit@def@term{intclassifiedindex} %国际图书分类号 +\hit@def@term{ctitlecover} %中文标题封面 \hit@def@term{ctitle} %中文标题 \hit@def@term{csubtitle} %中文副标题 \hit@def@term{cxueke} %中文学科 @@ -650,7 +673,7 @@ \vspace*{1.2cm} \begin{center} \parbox[t][3.4cm][t]{\textwidth}{ - \begin{center}\erhao[0]\heiti\hit@ctitle\end{center} } + \begin{center}\erhao[0]\heiti\hit@ctitlecover\end{center} } \parbox[t][9cm][t]{\textwidth}{ \begin{center}\xiaoer[0]\songti\textbf{\hit@cauthor}\end{center} } @@ -710,15 +733,15 @@ \ifhit@fulltime\vspace{1.4cm}\else% \begin{center}\xiaoyi[1]\songti\textbf{\hit@cbraceleft\hit@cstudenttype\hit@cbraceright}\end{center} \fi% - \parbox[t][2.8cm][t]{\textwidth}{% - \begin{center}\erhao\heiti\hit@ctitle\end{center} -\ifhit@subtitle\begin{center}\hspace{-4em}\xiaoer\heiti\pozhehao\hit@csubtitle\end{center}\fi} - \parbox[t][5.1cm][t]{\textwidth}{%英文标题太长时可以采用\xiaoer + \parbox[t][7.8cm][t]{\textwidth}{% + \begin{center}\erhao\heiti\hit@ctitlecover\end{center} +\ifhit@subtitle\begin{center}\hspace{-4em}\xiaoer\heiti\pozhehao\hit@csubtitle\end{center}\fi \begin{center}% \settowidth{\hit@etitlelength}{\erhao\hit@etitle\ifhit@subtitle\hit@title@esep\hit@esubtitle\fi}% \ifdim\hit@etitlelength>450mm\xiaoer\else\erhao\fi% \textbf{\MakeUppercase{\hit@etitle}% \ifhit@subtitle\hit@title@esep\MakeUppercase{\hit@esubtitle}\fi}\end{center}} + \parbox[t][7.4cm][t]{\textwidth}{ \begin{center}\xiaoer\songti\textbf{\hit@cauthor}\end{center}} \parbox[t][1.4cm][t]{\textwidth}{ @@ -744,7 +767,7 @@ \begin{center}\songti\bfseries\hit@cdegree\hit@cthesisname\end{center} \ifhit@fulltime\relax\else\begin{center}\songti\textbf{\hit@cbraceleft\hit@cstudenttype\hit@cbraceright}\end{center}\fi} \parbox[t][5cm][t]{\textwidth}{\erhao - \begin{center}\heiti\hit@ctitle\end{center} + \begin{center}\heiti\hit@ctitlecover\end{center} \ifhit@subtitle\begin{center}\hspace{-4em}\xiaoer\heiti\pozhehao\hit@csubtitle\end{center}\fi} \parbox[t][9.8cm][b]{\textwidth} {\sihao @@ -960,10 +983,14 @@ \newenvironment{publication}{% \ifhit@openright\cleardoublepage\else\clearpage\fi \hit@appendix@chapter*{\hit@publication@ctitle}[\hit@publication@etitle]}{} - \newenvironment{ceindex}{% \ifhit@openright\cleardoublepage\else\clearpage\fi - \hit@appendix@chapter*{\indexname}[\hit@index@etitle]\begin{multicols*}{2}}{\end{multicols*}} + \hit@appendix@chapter*{\indexname}[\hit@index@etitle] + \setlength{\columnsep}{4em} + \begin{adjustwidth}{2em}{2em} + \begin{multicols*}{2}}{\end{multicols*} + \end{adjustwidth} + } \newlist{idxwordlist}{description}{3} \setlist[idxwordlist, 1]{% @@ -1013,7 +1040,7 @@ \thispagestyle{hit@empty}% \phantomsection\addcontentsline{toc}{chapter}{\ifhit@bachelor\hit@declarename@bachelor\else\hit@authorization@ctitle\fi}% \ifhit@doctor% -\addcontentsline{toe}{chapter}{\bfseries \hit@authorization@etitle}% +\addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries \hit@authorization@etitle}{\hit@authorization@etitle}}% \fi% }]{#1}% }% @@ -1021,10 +1048,10 @@ \newcommand\bibstyle@numerical{\bibpunct{[}{]}{,}{s}{,}{\textsuperscript{,}}} \newcommand\bibstyle@authoryear{\bibpunct{(}{)}{;}{a}{,}{,}} -\newcommand\bibstyle@inline{\bibpunct{[}{]}{,}{n}{,}{,}} +\newcommand\bibstyle@inline{\bibpunct{[}{]}{,}{n}{,}{\hit@inline@sep}} \citestyle{numerical} \DeclareRobustCommand\inlinecite{\@inlinecite} -\def\@inlinecite#1{\begingroup\let\@cite\NAT@citenum\citep{#1}\endgroup} +\def\@inlinecite#1{\begingroup\citestyle{inline}\let\@cite\NAT@citenum\citep{#1}\endgroup} \let\onlinecite\inlinecite \renewenvironment{thebibliography}[1]{% \ifhit@openright\cleardoublepage\else\clearpage\fi\phantomsection% @@ -1041,10 +1068,17 @@ \let\p@enumiv\@empty \renewcommand\theenumiv{\@arabic\c@enumiv}}% \sloppy\frenchspacing + \ifhit@splitbibitem + \clubpenalty0 + \@clubpenalty \clubpenalty + \widowpenalty0% + \interlinepenalty-50% + \else \clubpenalty4000 \@clubpenalty \clubpenalty \widowpenalty4000% \interlinepenalty4000% + \fi \sfcode`\.\@m} {\def\@noitemerr {\@latex@warning{Empty `thebibliography' environment}}% |