diff options
author | Karl Berry <karl@freefriends.org> | 2019-02-19 22:19:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-02-19 22:19:26 +0000 |
commit | 119dd66bd04be86e878563dfdc69216266e9a52f (patch) | |
tree | cf85f4882d89ea7bfae26cdf25ecad9525e32855 /Master/texmf-dist/source | |
parent | 4cbd171caf00fc7956bd4d7ca79bcecd0cc34526 (diff) |
hithesis (19feb19)
git-svn-id: svn://tug.org/texlive/trunk@50062 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/hithesis/Makefile | 108 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/hithesis/hithesis.dtx | 284 |
2 files changed, 309 insertions, 83 deletions
diff --git a/Master/texmf-dist/source/latex/hithesis/Makefile b/Master/texmf-dist/source/latex/hithesis/Makefile new file mode 100644 index 00000000000..337d8d0561e --- /dev/null +++ b/Master/texmf-dist/source/latex/hithesis/Makefile @@ -0,0 +1,108 @@ +# Makefile for ThuThesis + +# Compiling method: latexmk/xelatex/pdflatex +METHOD = xelatex +# Set opts for latexmk if you use it +LATEXMKOPTS = -xelatex +# Basename of thesis +THESISMAIN = main + +PACKAGE=hithesis +SOURCES=$(PACKAGE).ins $(PACKAGE).dtx +THESISCONTENTS=$(THESISMAIN).tex front/*.tex body/*.tex back/*.tex $(FIGURES) *.bst +# NOTE: update this to reflect your local file types. +FIGURES=$(wildcard figures/*.eps figures/*.pdf) +BIBFILE=*.bib +CLSFILES=dtx-style.sty $(PACKAGE).cls $(PACKAGE).ist h$(PACKAGE).cfg + +# make deletion work on Windows +ifdef SystemRoot + RM = del /Q + OPEN = start +else + RM = rm -f + OPEN = open +endif + +.PHONY: all clean distclean dist thesis viewthesis doc viewdoc cls check FORCE_MAKE + +all: doc thesis + +cls: $(CLSFILES) + +$(CLSFILES): $(SOURCES) + latex $(PACKAGE).ins + +viewdoc: doc + $(OPEN) $(PACKAGE).pdf + +doc: $(PACKAGE).pdf + +viewthesis: thesis + $(OPEN) $(THESISMAIN).pdf + +thesis: $(THESISMAIN).pdf + +ifeq ($(METHOD),latexmk) + +$(PACKAGE).pdf: $(CLSFILES) FORCE_MAKE + $(METHOD) $(LATEXMKOPTS) $(PACKAGE).dtx + +$(THESISMAIN).pdf: $(CLSFILES) FORCE_MAKE + $(METHOD) $(LATEXMKOPTS) $(THESISMAIN) + +else ifeq ($(METHOD),xelatex) + +$(PACKAGE).pdf: $(CLSFILES) + $(METHOD) $(PACKAGE).dtx + makeindex -s gind.ist -o $(PACKAGE).ind $(PACKAGE).idx + makeindex -s gglo.ist -o $(PACKAGE).gls $(PACKAGE).glo + $(METHOD) $(PACKAGE).dtx + $(METHOD) $(PACKAGE).dtx + +$(THESISMAIN).idx: $(THESISMAIN).bbl + $(METHOD) $(THESISMAIN) + $(METHOD) $(THESISMAIN) + + +$(THESISMAIN)_china.idx : $(CLSFILES) $(THESISMAIN).bbl $(THESISMAIN).idx + splitindex $(THESISMAIN) -- -s $(PACKAGE).ist # 自动生成索引 + +$(THESISMAIN)_english.ind $(THESISMAIN)_china.ind $(THESISMAIN)_english.idx : $(THESISMAIN)_china.idx + +$(THESISMAIN).pdf: $(CLSFILES) $(THESISCONTENTS) $(THESISMAIN)_china.ind $(THESISMAIN)_china.idx $(THESISMAIN)_english.ind $(THESISMAIN)_english.idx $(THESISMAIN).bbl + $(METHOD) $(THESISMAIN) + splitindex $(THESISMAIN) -- -s $(PACKAGE).ist # 自动生成索引 + $(METHOD) $(THESISMAIN) + +$(THESISMAIN).bbl: $(BIBFILE) + $(METHOD) $(THESISMAIN) + -bibtex $(THESISMAIN) + $(RM) $(THESISMAIN).pdf + +else +$(error Unknown METHOD: $(METHOD)) + +endif + +clean: + latexmk -c $(PACKAGE).dtx + latexmk -c $(THESISMAIN) + -@$(RM) *~ *.idx *.ind *.ilg *.thm *.toe *.bbl + +cleanall: clean + -@$(RM) $(PACKAGE).pdf $(THESISMAIN).pdf + +distclean: cleanall + -@$(RM) $(CLSFILES) + -@$(RM) -r dist + +check: FORCE_MAKE + ag 'Harbin Institute of Technology Template|\\def\\version|"version":' hithesis.dtx package.json + +dist: all + @if [ -z "$(version)" ]; then \ + echo "Usage: make dist version=[x.y.z | ctan]"; \ + else \ + npm run build -- --version=$(version); \ + fi diff --git a/Master/texmf-dist/source/latex/hithesis/hithesis.dtx b/Master/texmf-dist/source/latex/hithesis/hithesis.dtx index 7ec3d376787..5cddf61a13c 100644 --- a/Master/texmf-dist/source/latex/hithesis/hithesis.dtx +++ b/Master/texmf-dist/source/latex/hithesis/hithesis.dtx @@ -16,7 +16,7 @@ % % \iffalse %<*driver> -\ProvidesFile{hithesis.dtx}[2017/11/5 1.0.9 Harbin Institute of Technology Thesis Template] +\ProvidesFile{hithesis.dtx}[2018/12/05 2.0.6 Harbin Institute of Technology Thesis Template] \documentclass{ltxdoc} \usepackage{dtx-style} @@ -377,6 +377,7 @@ % 如果有副标题,需要在封面选项中设置subtitle=true,否则不显示副标题。 % \begin{latex} % \hitsetup{ +% ctitlecover={封面中文题目可断行}, % ctitle={论文中文题目}, % etitle={Thesis English Title}, % csubtitle={论文中文副题目(如果有)}, @@ -940,7 +941,7 @@ %<cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<cls>\ProvidesClass{hithesis} %<cfg>\ProvidesFile{hithesis.cfg} -%<cls|cfg>[2017/11/5 1.0.9 Harbin Institute of Technology] +%<cls|cfg>[2018/12/05 2.0.6 Harbin Institute of Technology Thesis Template] % \end{macrocode} % % \subsection{定义选项} @@ -962,6 +963,16 @@ \hit@doctorfalse \expandafter\csname hit@#1true\endcsname} % \end{macrocode} +% 设置版芯,由于窝工版芯歧义。 +% \changes{v2.0.0}{2018/6/14}{此处添加geometry选项} +% \begin{macrocode} +\newif\ifhit@geometrynewone +\newif\ifhit@geometrynewtwo +\define@key{hit}{newgeometry}{% + \hit@geometrynewonefalse + \hit@geometrynewtwofalse + \expandafter\csname hit@geometrynew#1true\endcsname} +% \end{macrocode} % 目录中英文是否用 Arial 字体(默认关闭)。 % \begin{macrocode} \DeclareBoolOption[false]{arialtoc} @@ -1008,10 +1019,7 @@ % \begin{macrocode} \DeclareBoolOption[false]{debug} % \end{macrocode} -% 是否使用新的版心设置(默认否)。 -% \begin{macrocode} -\DeclareBoolOption[false]{newgeometry} -% \end{macrocode} +% \changes{v2.0.0}{2018/6/14}{此处删除newgeometry选项} % 是否使用右开页(默认否)。 % \begin{macrocode} \DeclareBoolOption[false]{openright} @@ -1026,6 +1034,28 @@ % \begin{macrocode} \DeclareBoolOption[false]{subcapcenterlast} % \end{macrocode} +% 中文目录中Abstract是否均为大写 +% \changes{v1.0.13}{2018/4/5}{此处添加中文目录中Abstract是否均为大写选项} +% \begin{macrocode} +\DeclareBoolOption[false]{absupper} +% \end{macrocode} +% 此处添加控制本科论文的页码横线选项 +% \changes{v1.0.15}{2018/06/05}{添加控制本科论文的页码横线选项} +% \begin{macrocode} +\DeclareBoolOption[false]{bsmainpagenumberline} +\DeclareBoolOption[false]{bsfrontpagenumberline} +\DeclareBoolOption[true]{bsheadrule} +% \end{macrocode} +% 数学字体是否使用新罗马 +% \changes{v2.0.5}{2018/12/05}{添加数学字体开关} +% \begin{macrocode} +\DeclareBoolOption[true]{newtxmath} +% \end{macrocode} +% 此处应广大刀客要求添加一参考文献分割开关 +% \changes{v2.0.3}{2018/10/08}{添加参考文献分割开关} +% \begin{macrocode} +\DeclareBoolOption[false]{splitbibitem} +% \end{macrocode} % 声明字体选项。 % \begin{macrocode} \DeclareStringOption{fontset} @@ -1114,11 +1144,15 @@ % \begin{macrocode} \RequirePackage{amsmath} % \end{macrocode} -% % \pkg{newtx} 设置 Times New Roman,Helvetica。 % \begin{macrocode} \RequirePackage[defaultsups]{newtxtext} +% \end{macrocode} +% 添加数学字体开关 +% \begin{macrocode} +\ifhit@newtxmath \RequirePackage{newtxmath} +\fi % \end{macrocode} % \pkg{newtx} 的 Mono 字体虽然很好看,但在论文中不常见。学校虽未要求 Mono 字体, % 还是选择常见的 Courier 字体。由于比较新的实现 \TeX\ Gyre Cursor 会修 @@ -1208,26 +1242,42 @@ ignoreall, nomarginpar, } -\ifhit@newgeometry% -\geometry{ - centering, - text={150true mm,240true mm}, - left=30true mm, - head=5true mm, - headsep=0true mm, - footskip=0true mm, - foot=0true mm -} +% \end{macrocode} +% 添加版芯设置选项 +% \changes{v2.0.0}{2018/6/14}{添加版芯设置选项} +% \begin{macrocode} +\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% -\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 -} -\fi + \ifhit@geometrynewone% + \geometry{ + centering, + text={150true mm,240true mm}, + left=30true mm, + head=5true mm, + headsep=0true mm, + footskip=0true mm, + foot=0true mm + } + \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 + } + \fi% +\fi% % \end{macrocode} % 载入显示行号的包。 % \changes{v1.0.9}{2018/01/07}{添加debug包} @@ -1247,6 +1297,11 @@ % \begin{macrocode} \RequirePackage{tabularx} \RequirePackage{varwidth} +% \end{macrocode} +% 此处changepage环境用来控制索引页面的左右边距,规范中给出的示例的边距要大于正文。 +% \changes{v1.0.10}{2018/02/19}{修改了索引的间距,使其更符合规范中的示例} +% \begin{macrocode} +\RequirePackage{changepage} \RequirePackage{multicol} \RequirePackage{amssymb} \RequirePackage[below]{placeins}%允许上一个section的浮动图形出现在下一个section的开始部分,还提供\FloatBarrier命令,使所有未处理的浮动图形立即被处理 @@ -1266,13 +1321,14 @@ %</cls> % \end{macrocode} % 我工要求的索引格式。 +% \changes{v1.0.10}{2018/02/19}{修改了索引的间距,使其更符合规范中的示例} % \begin{macrocode} %<*ist> headings_flag 1 -heading_prefix "\{\\centering\\normalsize\\textbf\{" +heading_prefix "\{\\vskip -\\baselineskip\\centering\\normalsize\\textbf\{" heading_suffix "\}\\par\}\\nopagebreak\\wuhao\n" -delim_0 "\\hspace{2em}" -delim_1 "\\hspace{2em}" +delim_0 "\\hspace*{\\fill}" +delim_1 "\\hspace*{\\fill}" %</ist> % \end{macrocode} % 排版logo。 @@ -1455,14 +1511,11 @@ delim_1 "\\hspace{2em}" \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } - -\fancypagestyle{hit@plain}{% - \fancyhead{} - \fancyfoot[C]{\xiaowu\thepage} - \renewcommand{\headrulewidth}{0pt} - \renewcommand{\footrulewidth}{0pt} -} - +% \end{macrocode} +% 此处根据本科生模板的多种版本,提供选项自定义页码、页眉样式。 +% \changes{v1.0.15}{2018/06/05}{添加控制本科论文的页码横线选项} +% \changes{v1.0.15}{2018/06/05}{删除冗余的页面格式} +% \begin{macrocode} \fancypagestyle{hit@headings}{% \fancyhf{} \ifhit@doctor @@ -1475,23 +1528,32 @@ delim_1 "\\hspace{2em}" \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}{}}} @@ -1501,7 +1563,6 @@ delim_1 "\\hspace{2em}" % \end{macro} % \end{macro} % -% % \subsubsection{段落} % \label{sec:paragraph} % @@ -1559,8 +1620,10 @@ delim_1 "\\hspace{2em}" %<*cls> \allowdisplaybreaks[4] \predisplaypenalty=0 %公式之前可以换页,公式出现在页面顶部 +\postdisplaypenalty=0 \renewcommand\theequation{\ifnum \c@chapter>\z@ \thechapter-\fi\@arabic\c@equation} % \end{macrocode} +% \changes{v2.0.3}{2018/10/08}{设置公式前后随意断页} % 公式距前后文的距离由 4 个参数控制,参见 \cs{normalsize} 的定义。 % 同时为了让 \pkg{amsmath} 的 \cs{tag*} 命令得到正确的格式,我们必须修改这些代 % 码。\cs{make@df@tag} 是定义 \cs{tag*} 和 \cs{tag} 内部命令的。 @@ -1598,7 +1661,11 @@ delim_1 "\\hspace{2em}" \newtheorem*{proof}{证明} \theoremstyle{plain} \theoremsymbol{} -\theoremseparator{:} +% \end{macrocode} +% 此处去除了冒号,(如果需要在加上这个冒号?),反正规范中没有。 +% \changes{v2.0.2}{2018/06/28}{取出了定理冒号} +% \begin{macrocode} +\theoremseparator{} \newtheorem{assumption}{假设}[chapter] \newtheorem{definition}{定义}[chapter] \newtheorem{proposition}{命题}[chapter] @@ -1619,13 +1686,14 @@ delim_1 "\\hspace{2em}" % \changes{v1.0.9}{2018/01/07}{修正float垂直间距bug} % \begin{macrocode} %<*cls> -\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} % \end{macrocode} +% 此处设置float在p选项时间隔,此处不设置\cs{@fptop}和\cs{@fpbot}以确保居中。 +% \changes{v1.0.12}{2018/04/03}{修正float为p状态时默认不居中bug} +% \changes{v2.0.4}{2018/12/04}{删除\cs{@fpsep}设置,似乎没有什么用} +% \changes{v2.0.4}{2018/12/04}{更新\cs{intextsep}\cs{textfloatsep}\cs{floatsep}间距为正文行间距} % 下面这组命令使浮动对象的缺省值稍微宽松一点,从而防止幅度对象占据过多的文本页面, % 也可以防止在很大空白的浮动页上放置很小的图形。 % \changes{v1.0.8}{2017/11/5}{修改附录中图、表、公式数字编码} @@ -1639,16 +1707,9 @@ delim_1 "\\hspace{2em}" \renewcommand{\floatpagefraction}{0.60} % \end{macrocode} % 由于我工的双标题,导致标题之下多出一空白字符的距离,去除。 -% \begin{macrocode} -\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} -% \end{macrocode} +% \changes{v2.0.4}{2018/12/04}{更新图段后空白距离} +% \changes{v2.0.4}{2018/12/04}{删除表段后空白距离} +% \changes{v2.0.5}{2018/12/05}{删除图段后空白距离} % \begin{macro}{\@makecaption} % 根据我工规范,本科和硕博的图题序号之后的空格不一样。 % \begin{hitrgu}[\PGR][2.13.1] @@ -1755,8 +1816,13 @@ delim_1 "\\hspace{2em}" \setlength{\listparindent}{0pt} % 段落缩进量 }} {\end{list}} +% \end{macrocode} % 设置定理定义格式 -\theoremstyle{plain} +% \changes{v2.0.1}{2018/6/28}{去除定理注释括号} +% \begin{macrocode} +\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$} @@ -1789,8 +1855,11 @@ delim_1 "\\hspace{2em}" \newcommand\equationname{公式} \newcommand{\cabstractcname}{摘\hspace{\ccwd}要} \newcommand{\cabstractename}{Abstract (In Chinese)} +% \end{macrocode} +% 此处删除冗余选项 +% \changes{v1.0.13}{2018/4/5}{此处删除冗余的Abstract标题} +% \begin{macrocode} \newcommand{\eabstractcname}{Abstract} -\def\hit@doctor@eabstract@ename{ABSTRACT} \newcommand{\eabstractename}{Abstract (In English)} \newcommand{\hit@ckeywords@title}{关键词:} \def\hit@ckeywords@separator{;} @@ -1807,7 +1876,11 @@ delim_1 "\\hspace{2em}" \or\def\CJK@today{\CJK@todaysmall} \or\def\CJK@today{\CJK@todaybig} \fi} -\cdate{\ifhit@bachelor\CJK@todaysmall\else\CJK@todaybig@short\fi} +% \end{macrocode} +% 按照word示范要求,此处使用阿拉伯数字 +% \changes{v1.0.14}{2018/05/06}{修正自动生成日期bug} +% \begin{macrocode} +\cdate{\ifhit@bachelor\CJK@todaysmall\else\CJK@todaysmall@short\fi} \edate{\ifcase \month \or January\or February\or March\or April\or May% \or June\or July \or August\or September\or October\or November \or December\fi\unskip,\ \ \the\year} @@ -1890,14 +1963,18 @@ delim_1 "\\hspace{2em}" } % \end{macrocode} % 设置附表、附录格式。 +% \changes{v1.0.13}{2018/4/5}{此处添加中文目录中Abstract是否均为大写选项} % \begin{macrocode} \NewDocumentCommand{\hit@appendix@chapter}{s m o}{% \IfBooleanT{#1}% { \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} } } @@ -1905,7 +1982,11 @@ delim_1 "\\hspace{2em}" \newcommand{\BiAppChapter}[2] % 该附录命令适用于有章节的完整附录 {\phantomsection \chapter{#1} - \addcontentsline{toe}{chapter}{\bfseries \xiaosi Appendix \thechapter~~#2} +% \end{macrocode} +% 此处添加保护选项 +% \changes{v1.0.13}{2018/4/5}{添加\cs{texorpdfstring}命令去除书签中带有格式时的警告} +% \begin{macrocode} + \addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries \xiaosi Appendix \thechapter~~#2}{Appendix \thechapter~~#2}} } % \end{macrocode} % 设置章节命令。s: 星号,表示在目录中出不出现序号。m: 必须要有的选项,中文章 @@ -1923,7 +2004,11 @@ delim_1 "\\hspace{2em}" {% if \chapter* \hit@chapter*{#3}% \IfValueT{#4}{% - \addcontentsline{toe}{chapter}{\bfseries #4} +% \end{macrocode} +% 此处添加保护选项 +% \changes{v1.0.13}{2018/4/5}{添加\cs{texorpdfstring}命令去除书签中带有格式时的警告} +% \begin{macrocode} + \addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries #4}{#4}} } }% {% if \chapter @@ -1934,8 +2019,10 @@ delim_1 "\\hspace{2em}" % \end{macrocode} % 此处需删除章节的空白 % \changes{v1.0.5}{2017/09/20}{添加\cs{ignorespaces}选项,矫正英文目录多出一个空白而无法对其的bug} +% 此处添加保护选项 +% \changes{v1.0.13}{2018/4/5}{添加\cs{texorpdfstring}命令去除书签中带有格式时的警告} % \begin{macrocode} - \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}} } } } @@ -2017,6 +2104,8 @@ delim_1 "\\hspace{2em}" % \subsubsection{定义封面} % \label{sec:cov} % 封面信息。 +% \changes{v1.0.11}{2018/03/07}{更改的中文标题,根据反馈,在封面中标题需要自由 +% 换行且不能影响到原创性声明。此处额外设置了一个变量ctitlecover。} % \begin{macrocode} \def\hit@def@term#1{% \define@key{hit}{#1}{\csname #1\endcsname{##1}} @@ -2028,6 +2117,7 @@ delim_1 "\\hspace{2em}" \hit@def@term{natclassifiedindex} %国内图书分类号 \hit@def@term{intclassifiedindex} %国际图书分类号 +\hit@def@term{ctitlecover} %中文标题封面 \hit@def@term{ctitle} %中文标题 \hit@def@term{csubtitle} %中文副标题 \hit@def@term{cxueke} %中文学科 @@ -2197,7 +2287,7 @@ delim_1 "\\hspace{2em}" \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} } @@ -2220,6 +2310,8 @@ delim_1 "\\hspace{2em}" % \end{macrocode} % 此处本科生使用了\hit\ 的logo且本科生论文标题使用了华文新魏字体,为了方便使用, % 此处使用了矢量化图片作为输入。 +% \changes{v1.0.11}{2018/03/07}{更改的中文标题,根据反馈,在封面中标题需要自由 +% 换行且不能影响到原创性声明。此处额外设置了一个变量ctitlecover。} % \begin{macrocode} \newcommand{\hit@second@titlepage@bachelor}{ \vspace*{0.8cm} @@ -2261,15 +2353,15 @@ delim_1 "\\hspace{2em}" \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}{ @@ -2296,7 +2388,7 @@ delim_1 "\\hspace{2em}" \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 @@ -2561,10 +2653,18 @@ delim_1 "\\hspace{2em}" \newenvironment{publication}{% \ifhit@openright\cleardoublepage\else\clearpage\fi \hit@appendix@chapter*{\hit@publication@ctitle}[\hit@publication@etitle]}{} - +% \end{macrocode} +% 此处中英文索引的格式设置尽量符合\PGR\ 中给出的示例的格式。此处间距常数是人工调节的。 +% \changes{v1.0.10}{2018/02/19}{修改了索引的间距,使其更符合规范中的示例} +% \begin{macrocode} \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]{% @@ -2614,7 +2714,10 @@ delim_1 "\\hspace{2em}" \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}% +% \end{macrocode} +% \changes{v1.0.13}{2018/4/5}{添加\cs{texorpdfstring}命令去除书签中带有格式时的警告} +% \begin{macrocode} + \addcontentsline{toe}{chapter}{\texorpdfstring{\bfseries \hit@authorization@etitle}{\hit@authorization@etitle}}% \fi% }]{#1}% }% @@ -2622,10 +2725,13 @@ delim_1 "\\hspace{2em}" \newcommand\bibstyle@numerical{\bibpunct{[}{]}{,}{s}{,}{\textsuperscript{,}}} \newcommand\bibstyle@authoryear{\bibpunct{(}{)}{;}{a}{,}{,}} -\newcommand\bibstyle@inline{\bibpunct{[}{]}{,}{n}{,}{,}} +% \end{macrocode} +% \changes{v2.0.6}{2018/12/5}{在\cs{inlinecite}内添加空格} +% \begin{macrocode} +\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% @@ -2642,10 +2748,20 @@ delim_1 "\\hspace{2em}" \let\p@enumiv\@empty \renewcommand\theenumiv{\@arabic\c@enumiv}}% \sloppy\frenchspacing +% \end{macrocode} +% \changes{v2.0.3}{2018/10/08}{添加参考文献分割开关} +% \begin{macrocode} + \ifhit@splitbibitem + \clubpenalty0 + \@clubpenalty \clubpenalty + \widowpenalty0% + \interlinepenalty-50% + \else \clubpenalty4000 \@clubpenalty \clubpenalty \widowpenalty4000% \interlinepenalty4000% + \fi \sfcode`\.\@m} {\def\@noitemerr {\@latex@warning{Empty `thebibliography' environment}}% @@ -2806,7 +2922,9 @@ delim_1 "\\hspace{2em}" %<cfg|dtx-style>{《\hit 研究生学位论文撰写规范》}} %<cfg|dtx-style>\def\UGR{\href{http://jwc.hit.edu.cn/2566/list.htm} %<cfg|dtx-style>{《\hit 本科生毕业论文撰写规范》}} +%<cfg>\def\hit@inline@sep{,} % \end{macrocode} +% \changes{v2.0.6}{2018/12/5}{在\cs{inlinecite}内添加空格} % \begin{macrocode} %<*dtx-style> \NewDocumentEnvironment{hitrgu}{o o} |