From 938d0017220d59681ce920e3593cb9cdef66341e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 5 Mar 2020 22:08:01 +0000 Subject: hitszthesis (5mar20) git-svn-id: svn://tug.org/texlive/trunk@54111 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/hitszthesis/hitszthesis.cls | 157 +++++++++++++++------ .../tex/latex/hitszthesis/hitszthesis.sty | 8 +- 2 files changed, 115 insertions(+), 50 deletions(-) (limited to 'Master/texmf-dist/tex/latex/hitszthesis') diff --git a/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls b/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls index c4c05b05394..35b4dea5b39 100644 --- a/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls +++ b/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.cls @@ -23,11 +23,11 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{hitszthesis} -[2020/02/23 v2.1 A Bachelor Thesis Template for Harbin Institute of Technology, ShenZhen +[2020/03/05 v2.3 A Bachelor Thesis Template for Harbin Institute of Technology, ShenZhen (HITSZ)] \RequirePackage{ifxetex} \ifxetex\else - \ClassError{hitszthesis}{Please use XeLaTeX to compile the file}{} + \ClassError{hitszthesis}{Please use XeLaTeX to compile this file}{} \end{document} \fi \RequirePackage{kvoptions} @@ -41,28 +41,106 @@ \DeclareVoidOption{onerow}{\ykv{covertitle = onerow}} \DeclareVoidOption{tworow}{\ykv{covertitle = tworow}} \DeclareStringOption[newtxmath]{mathfont} -\DeclareVoidOption{newtxmath}{\ykv{mathfont = newtxmath}} +\DeclareVoidOption{XITS}{\ykv{mathfont = XITS}} \DeclareVoidOption{mtpro2}{\ykv{mathfont = mtpro2}} +\DeclareVoidOption{mtpro2lite}{\ykv{mathfont = mtpro2lite}} +\DeclareVoidOption{newtxmath}{\ykv{mathfont = newtxmath}} +\DeclareBoolOption[false]{boldcaption} \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{book}} \ProcessKeyvalOptions*\relax \LoadClass[12pt,a4paper,openany,oneside]{book} \RequirePackage{etex} -\RequirePackage[UTF8,space=auto,scheme=plain]{ctex} +\RequirePackage[UTF8,scheme=chinese,zihao=-4,heading=true]{ctex} +\ctexset{% + space = auto, + chapter={ + afterindent=true, + number=\arabic{chapter}, + beforeskip={28.34658bp},%一个空行 1.57481 × 18 + afterskip={24.74658bp},%0.8应该不计算间距 0.8 × 18 + 0.57481×18 + aftername=\enspace, + format={\centering\heiti\xiaoer[1.57481]},%\center 会影响之后全局 + nameformat=\relax, + numberformat=\relax, + fixskip=true, % 添加这一行去除默认间距 + %hang=true, + }, + section={ + afterindent=true, + beforeskip={12bp},%上下空0.5行 + afterskip={13.5bp}, + format={\heiti\fontsize{15bp}{21bp}\selectfont}, + aftername=\enspace, + fixskip=true, + break={}, + }, + subsection={ + afterindent=true, + beforeskip={10bp}, + afterskip={11bp}, + format={\heiti\fontsize{14bp}{18bp}\selectfont}, + aftername=\enspace, + fixskip=true, + break={}, + }, + subsubsection={ + afterindent=true, + beforeskip={9bp}, + afterskip={9bp}, + format={\heiti\normalsize}, + aftername=\enspace, + fixskip=true, + break={}, + }, + paragraph/afterindent=true, + subparagraph/afterindent=true +} \RequirePackage{amsmath} -\RequirePackage[T1]{fontenc} -\RequirePackage{newtxtext} -\ifdefstring{\hitsz@mathfont}{mtpro2}{ -\RequirePackage[mtphrb,mtpcal,zswash,uprightGreek]{mtpro2} +\ifdefstring{\hitsz@mathfont}{XITS}{ + \setmainfont{Times New Roman} + \setsansfont{Arial} + \setmonofont[Scale=MatchLowercase]{Consolas} + \RequirePackage{unicode-math} + \unimathsetup{ + math-style = ISO, + bold-style = ISO, + nabla = upright, + partial = upright, + } + \IfFontExistsTF{XITSMath-Regular.otf}{ + \setmathfont[ + Extension = .otf, + BoldFont = XITSMath-Bold, + StylisticSet = 8, + ]{XITSMath-Regular} + \setmathfont[range={cal,bfcal},StylisticSet=1]{XITSMath-Regular.otf} + }{ + \setmathfont[ + Extension = .otf, + BoldFont = *bold, + StylisticSet = 8, + ]{xits-math} + \setmathfont[range={cal,bfcal},StylisticSet=1]{xits-math.otf} + } + \AtBeginDocument{\renewcommand{\mathbf}{\mathbfup} + \newcommand\square{\mdlgwhtsquare} + } +}{\relax} +\ifdefstring{\hitsz@mathfont}{mtpro2}{% + \RequirePackage{newtxtext} % newtxtext宏包必须加在数学字体宏包之前 + \RequirePackage[mtphrb,mtpcal,zswash,uprightGreek]{mtpro2} +}{\relax} +\ifdefstring{\hitsz@mathfont}{mtpro2lite}{% + \RequirePackage{newtxtext} + \RequirePackage[lite,subscriptcorrection,slantedGreek,nofontinfo]{mtpro2} }{\relax} -\ifdefstring{\hitsz@mathfont}{newtxmath}{ -\RequirePackage{newtxmath} +\ifdefstring{\hitsz@mathfont}{newtxmath}{% + \RequirePackage{newtxtext} + \RequirePackage{newtxmath} \let\openbox\relax }{\relax} -\renewcommand{\rmdefault}{ptm} -\RequirePackage[scaled=0.92]{helvet} \RequirePackage{type1cm} \RequirePackage{lipsum} -\RequirePackage{mathdesign} \setCJKfamilyfont{kai}[AutoFakeBold]{simkai.ttf} \newcommand*{\kai}{\CJKfamily{kai}} \setCJKfamilyfont{song}[AutoFakeBold]{SimSun} @@ -91,12 +169,11 @@ \RequirePackage{calc} \RequirePackage{tikz} \RequirePackage{bm} -\RequirePackage{cases} +\RequirePackage{subeqnarray} \RequirePackage{siunitx} \RequirePackage{pdfpages} \includepdfset{fitpaper=true} \RequirePackage{listings} -\renewcommand{\ttdefault}{cmtt} \lstdefinestyle{ystyle}{ basicstyle=% \ttfamily @@ -175,11 +252,6 @@ \newcommand{\keywordsname}{关键词} \newcommand{\keywordsenname}{Keywords} \renewcommand{\contentsname}{目\quad 录} -\renewcommand{\figurename}{图} -\renewcommand{\tablename}{表} -\renewcommand{\partname}{部分} -\renewcommand{\bibname}{参考文献} -\renewcommand{\appendixname}{附录~\thechapter} \renewcommand{\indexname}{索\quad 引} \newcommand{\notename}{笔记} \renewcommand*{\proofname}{证明} @@ -230,7 +302,7 @@ top=41mm, bottom=30mm, headheight = 2.17cm, headsep = 1mm, -footskip = 0cm, +footskip = 5mm, } \RequirePackage{hyperref} \hypersetup{ @@ -254,21 +326,10 @@ pdfborder={0 0 0}, \RequirePackage[pagestyles]{titlesec} \RequirePackage{apptools} \setcounter{secnumdepth}{3} -\renewcommand{\chaptername}{第 \thechapter\;章} -\titleformat{\chapter}[hang]{\centering\heiti} -{\filcenter\xiaoer\enspace\heiti{% -\IfAppendix{\appendixname}{\chaptername}\enspace}}{1pt}{\xiaoer} -\titleformat{\section}[hang]{\heiti} -{\xiaosan\heiti{\thesection}\enspace}{1pt}{\xiaosan\heiti\filright} -\titleformat{\subsection}[hang]{\heiti} -{\sihao\heiti\thesubsection\enspace}{1pt}{\sihao\heiti\filright} -\titleformat{\subsubsection}[hang]{\heiti} -{\xiaosi\heiti\thesubsubsection\enspace}{1pt}{\xiaosi\heiti\filright} -\titlespacing{\chapter}{0pt}{0bp}{14.4bp} -\titlespacing{\section}{0pt}{7.5bp}{7.5bp} -\titlespacing{\subsection}{0pt}{7bp}{7bp} -\titlespacing{\subsubsection}{0pt}{6bp}{6bp} \RequirePackage[font=small,labelsep=quad]{caption} +\ifhitsz@boldcaption + \renewcommand\captionfont{\small\song\bfseries} +\fi \captionsetup[table]{skip=3pt} \captionsetup[figure]{skip=10pt} \newcommand\figref[1]{图\ref{#1}} @@ -320,7 +381,7 @@ pdfborder={0 0 0}, \itshape}{\par} \newenvironment{proof}{ \par\noindent\textbf{\proofname\;} -}{\hfill$\Box$\quad\par} +}{\hfill$\square$\quad\par} \newenvironment{solution}{\medskip\par\noindent\textbf{\solutionname} \itshape}{\par} \newenvironment{remark}{\noindent\textbf{\remarkname}}{\par} \newenvironment{assumption}{\par\noindent\textbf{\assumptionname}}{\par} @@ -386,7 +447,7 @@ pdfborder={0 0 0}, \end{center} % 日期 \vspace{2.6cm} - {\xiaosi[0]\song\textbf{2020年7月}} + {\xiaosi[0]\song\textbf{2020年6月}} \end{center} %%---------------------------- %% 第二页 @@ -505,6 +566,7 @@ pdfborder={0 0 0}, {\settowidth\labelwidth{\@biblabel{#1}}% \leftmargin\labelwidth \advance\leftmargin\labelsep + \addtolength{\itemsep}{-1.5ex} \@openbib@code \usecounter{enumiv}% \let\p@enumiv\@empty @@ -518,7 +580,6 @@ pdfborder={0 0 0}, {\@latex@warning{Empty `thebibliography' environment}}% \endlist} \RequirePackage{fancyhdr} -\RequirePackage{lastpage} \pagestyle{fancy} \lhead{} \chead{\wuhao 哈尔滨工业大学(深圳)本科毕业设计(论文)} @@ -533,12 +594,12 @@ pdfborder={0 0 0}, {\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi% \makeheadrule}} \titlecontents{chapter}[0pt]{\vspace{1mm}\heiti} -{第\thecontentslabel\,\,章\hskip.5em}{}{\titlerule*[0.5pc]{.}\contentspage} +{\thecontentslabel\hskip.5em}{}{\titlerule*[4pt]{.}\contentspage} \titlecontents{section}[25pt]{\songti} -{\thecontentslabel\hskip.5em}{}{\titlerule*[0.5pc]{.}\contentspage} +{\thecontentslabel\hskip.5em}{}{\titlerule*[4pt]{.}\contentspage} \titlecontents{subsection}[47pt]{\songti} -{\thecontentslabel\hskip.5em}{}{\titlerule*[0.5pc]{.}\contentspage} -\RequirePackage[title,titletoc]{appendix} +{\thecontentslabel\hskip.5em}{}{\titlerule*[4pt]{.}\contentspage} +\g@addto@macro\appendix{\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}} \BeforeBeginEnvironment{tabular}{\wuhao} \AfterEndEnvironment{table}{\vspace{-1cm}} \newcounter{rowno} @@ -614,10 +675,10 @@ text centered, draw=black] \newcommand\mcc{\mathbb{C}} \newcommand\mrr{\mathbb{R}} \newcommand\mzz{\mathbb{Z}} -\newcommand\vx{\bf{x}} -\newcommand\vX{\bf{X}} -\newcommand\vy{\bf{y}} -\newcommand\vY{\bf{Y}} +\newcommand\vx{\mathbf{x}} +\newcommand\vX{\mathbf{X}} +\newcommand\vy{\mathbf{y}} +\newcommand\vY{\mathbf{Y}} \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\arccot}{arccot} \DeclareMathOperator{\arccosh}{arccosh} @@ -642,6 +703,10 @@ text centered, draw=black] \makebox[\textheight]{本科毕业设计(论文)\hfill \hitsztitle \hfill \hitszauthor} } } +\pdfstringdefDisableCommands{% + \def\quad{}% + \def\hskip#1{}% +} \AtEndOfClass{\sloppy} \endinput %% diff --git a/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty b/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty index 8b6c62e1fb9..392775978cb 100644 --- a/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty +++ b/Master/texmf-dist/tex/latex/hitszthesis/hitszthesis.sty @@ -2,16 +2,16 @@ % Copyright (C) 2019-2020 by Jingxuan Yang % % This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 +% conditions of the LaTeX Project Public License, either version 1.3c % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX +% and version 1.3c or later is part of all distributions of LaTeX % version 2005/12/01 or later. % -% This work has the LPPL maintenance status `maintained'. +% This work has the LPPL1.3c maintenance status `maintained'. % -\ProvidesPackage{hitszthesis}[2020/02/23 v2.1 A Collection of Styles for Bachelor Thesis of Harbin Institute of Technology, ShenZhen] +\ProvidesPackage{hitszthesis}[2020/03/05 v2.2 A Collection of Styles for Bachelor Thesis of Harbin Institute of Technology, ShenZhen] % 将引入的宏包以及各种自定义命令都放在这里 % 在 \file{main.tex} 中使用 |\usepackage{hitszthesis}| 引入本文件 -- cgit v1.2.3