summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/cquthesis
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-08-27 22:15:55 +0000
committerKarl Berry <karl@freefriends.org>2016-08-27 22:15:55 +0000
commit11c9c4d9505fbae8b108824303315d6203a2a655 (patch)
tree0d6139f60080d4acfe0f1eaa4af6b6808b9fc037 /Master/texmf-dist/source/latex/cquthesis
parent5fd39aa8867152c78c0dd8676a185880b9a797b6 (diff)
cquthesis (27aug16)
git-svn-id: svn://tug.org/texlive/trunk@41938 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/cquthesis')
-rw-r--r--Master/texmf-dist/source/latex/cquthesis/cquthesis.dtx294
-rwxr-xr-xMaster/texmf-dist/source/latex/cquthesis/makewin.bat136
2 files changed, 384 insertions, 46 deletions
diff --git a/Master/texmf-dist/source/latex/cquthesis/cquthesis.dtx b/Master/texmf-dist/source/latex/cquthesis/cquthesis.dtx
index 1fcc59f1257..70ed872f91a 100644
--- a/Master/texmf-dist/source/latex/cquthesis/cquthesis.dtx
+++ b/Master/texmf-dist/source/latex/cquthesis/cquthesis.dtx
@@ -16,7 +16,7 @@
%
% \iffalse
%<*driver>
-\ProvidesFile{cquthesis.dtx}[2016/06/09 v0.9.7 Chongqing University Thesis Template]
+\ProvidesFile{cquthesis.dtx}[2016/08/18 v1.14 Chongqing University Thesis Template]
\documentclass{ltxdoc}
\usepackage{dtx-style}
@@ -81,6 +81,10 @@
% \changes{v0.9.4}{2016/05/19}{用户文档撰写完成,CQUThesis提交至CTAN审核。}
% \changes{v0.9.7}{2016/06/09}{参与了2016年重庆大学毕业设计工作后,模板根据实际测试情况作了一番改进,Beta测试落下帷幕。}
% \changes{v0.9.7}{2016/06/09}{拆分了\file{cquthesis.sty}宏包,将其大部分内容并入\file{cquthesis.cls}和\file{cquthesis.cfg}。}
+% \changes{v1.00}{2016/06/17}{最后一些小修补,今年的毕设工作完全结束了。目前本科方面的格式审查没有问题,研究生和博士生哪边还没有数据。}
+% \changes{v1.00}{2016/06/17}{版本号格式从vX.Y.Z改为vX.YZ,更简洁一些。}
+% \changes{v1.10}{2016/06/21}{增加了CQUThesis的开发工具Makefile和makewin.bat,现在它对\LaTeX 中高阶用户和开发者更加友好,文档也相应更新了。}
+% \changes{v1.14}{2016/08/18}{改进了makewin.bat,默认的thesis选项加入了自动判定,如果dtx没有解包,程序会自动解包。这也就是说,新手可以在几乎所有情况下放心地通过双击makewin.bat来完成编译了。}
%
% \def\indexname{代码索引}
% \def\glossaryname{更新记录}
@@ -129,7 +133,8 @@
% \item 支持重庆大学本科(文学、理工)、硕士(学术、专业)、博士的毕业论文格式;
% \item 内置封面、目录、索引、授权书等论文部件,可按需自动生成;
% \item 自动侦测文档页数,生成相应的单面打印/双面打印PDF文件;
-% \item 预置一批优化过的宏包和小功能,包含国际标准单位、化学式支持、三线表等,可按需开启。
+% \item 预置一批优化过的宏包和小功能,包含中英双语题注及配套图录、表录,国际标准单位、化学式支持、三线表等,可按需开启;
+% \item 支持基于cwl文件的代码补全,makefile功能能够在Linux, Mac, Windows三平台通用。
% \end{itemize}
%
% 本文档将尽量完整的介绍模板的使用方法,如有不清楚之处可以参考示例文档或者根据第~\ref{sec:howtoask}节说明提问,有兴趣者都可以参与完善此手册,也非常欢迎对代码的贡献。
@@ -141,16 +146,24 @@
%
% \subsection{系统要求}
% \label{sec:sysrequire}
-% 本模板用到的宏包比较多,这些包在常见的\TeX{}发行版中都有,推荐使用\textbf{TeX Live},本模板在Windows和Mac环境下的\textbf{TeX Live}发行版中都进行了编译测试。
+% 本模板用到的宏包比较多,这些包在常见的\TeX{}发行版中都有,按照您操作系统的不同,您可以选择不同的\TeX{}发行版:
+% \begin{itemize}
+% \item Windows用户,推荐使用Mik \TeX ,这是一个专为Windows环境设计的\TeX 发行版,下载体积小,而且可以自主解决宏包依赖问题;
+% \item Linux和Mac用户,推荐使用\TeX Live,这是一套大而全的\TeX{}发行版,考虑到使用这两个系统的用户动手能力相对较强,\TeX Live没法自己解决依赖这个问题应该不是很让人头疼\footnote{使用宏包管理器或者从CTAN获取依赖宏包。}。
+% \end{itemize}
%
-% 截止本文档编译时,本模板(\cquthesis)已经被收录到Mik\TeX 中。
+% 本模板在Windows和Mac环境下的TeX Live发行版中都进行了编译测试。
%
% \note{在条件允许的情况下,强烈推荐您使用\XeTeX 引擎进行编译工作。}
%
% \subsection{获取\cquthesis}
-% 请造访\cquthesis{ } \href{https://github.com/nanmu42/cquthesis}{Github主页}下载最新的版本。
-%
-% 本宏包在CTAN官方库中也有镜像,镜像定期更新,可以\href{http://www.ctan.org/pkg/cquthesis}{造访这个页面}查看。
+% 您可通过三个主要途径获取\cquthesis :
+%
+% \begin{itemize}
+% \item 造访\cquthesis{ } \href{https://github.com/nanmu42/CQUThesis/releases}{Github主页}下载最新的预发行版本,这是更新最快,功能最全的版本(含工具箱Toolkit);
+% \item 访问本模板\href{http://www.ctan.org/pkg/cquthesis}{CTAN官方镜像}下载发行版,这个版本定期从预发行版本同步(不含工具箱Toolkit\footnote{这是出于许可证方面的考虑。});
+% \item 使用Mik \TeX 或\TeX Live的宏包管理功能直接获得本模板,这个方式不含模板示例文件。
+% \end{itemize}
%
% 除此之外,\cquthesis{}不拥有也不维护任何其他镜像。
%
@@ -168,11 +181,13 @@
% \endfoot
% \endlastfoot
% cquthesis.ins & \textsc{DocStrip} 驱动文件(用于安装或更新) \\
-% cquthesis.dtx & \textsc{DocStrip} 源文件(用于安装或更新)\\\midrule
+% cquthesis.dtx & \textsc{DocStrip} 源文件(用于安装或更新)\\
+% makefile & GNU make配置文件(Mac和Linux)\\
+% makewin.bat & Windows版make \\\midrule
% cquthesis.cls & \LaTeX 模板文件\\
% cquthesis.cfg & 模板配置文件\\
% cqunumerical.bst & 参考文献样式文件\\
-% cquthesis.cwl & 代码自动补全配置文件\\\midrule
+% cquthesis.cwl & 代码着色和自动补全配置文件\\\midrule
% main.tex & 示例文档主文件\\
% contents/ & 示例文档章节具体内容\\
% figures/ & 示例文档图片路径\\
@@ -183,40 +198,62 @@
% \textbf{cquthesis.pdf} & 用户手册(本文档)\\\bottomrule
% \end{longtable}
%
-% \note{\file{cquthesis.cls}和\file{cquthesis.cfg}以及\file{cqunumerical.bst}可以由\file{cquthesis.ins}和\file{cquthesis.dtx}生成。}
+% \note{\file{cquthesis.cls}和\file{cquthesis.cfg}以及\file{cqunumerical.bst}可以由\file{cquthesis.ins}和\file{cquthesis.dtx}生成,从\cquthesis { }v1.10之后,\file{cquthesis.cls}和\file{cquthesis.cfg}不再做预先提取,这个工作交给用户,整个过程很简单,请见\ref{sec:install}节。}
%
% \subsection{安装}
% \label{sec:install}
+% 得益于GNU make和makewin.bat,\cquthesis 的安装十分便利。
% 下载\cquthesis{}的\file*{.zip}压缩包后请将整个文件夹解压出来,进入文件夹后:
% \begin{itemize}
-% \item Window用户请在文件夹空白处{\heiti 按住Shift键再点击书鼠标右键},选择“在此处打开命令窗口”,运行下列命令:
+% \item Windows用户可以直接双击运行\file{makewin.bat};
%
-% \begin{shell}
-% latex cquthesis.ins
-% \end{shell}
-% \item Linux和Mac用户请在Bash窗口中进行如下操作:
+% \item Linux和Mac用户请在Bash窗口中进行如下操作:
%
% \begin{shell}
% cd cquthesis
-% latex cquthesis.ins
+% make thesis
% \end{shell}
%\end{itemize}
%
-% 之后将生成的文件放到\LaTeX{}能够侦测到的地方,安装即可完成。
+% 即可完成\cquthesis 的安装和示例文档的编译。
%
% \subsection{升级}
-% \cquthesis 的升级很方便,下载最新的开发版,将zip文件中的\file{cquthesis.dtx} 和\file{cquthesis.ins} 覆盖掉工作文件夹中的相应文件,之后再运行一次\ref{sec:install}节中的命令即可。
+% \cquthesis 的升级很方便,下载最新的开发版,将zip文件中的\file{cquthesis.dtx} 和\file{cquthesis.ins} 覆盖掉工作文件夹中的相应文件后:
+% \begin{itemize}
+% \item Windows用户请在文件夹空白处{\heiti 按住Shift键再点击书鼠标右键},选择“在此处打开命令窗口”,运行下列命令:
+%
+% \begin{shell}
+% makewin extract
+% \end{shell}
+%
+% \item Linux和Mac用户请在Bash窗口中进行如下操作:
+%
+% \begin{shell}
+% cd cquthesis
+% make cls
+% \end{shell}
+%\end{itemize}
+%
+% 即可完成\cquthesis 的升级。
%
% \subsection{编译用户手册}
-% 如果您需要编译用户手册,请定位到解压后的文件夹,运行下列命令:
+% 如果您需要编译用户手册,请定位到解压后的文件夹:
+% \begin{itemize}
+% \item Windows用户请在文件夹空白处{\heiti 按住Shift键再点击书鼠标右键},选择“在此处打开命令窗口”,运行下列命令:
+%
% \begin{shell}
-% xelatex cquthesis.dtx
-% makeindex -s gind.ist -o cquthesis.ind cquthesis.idx
-% makeindex -s gglo.ist -o cquthesis.gls cquthesis.glo
-% xelatex cquthesis.dtx
-% xelatex cquthesis.dtx
+% makewin doc
% \end{shell}
%
+% \item Linux和Mac用户请在Bash窗口中进行如下操作:
+%
+% \begin{shell}
+% cd cquthesis
+% make doc
+% \end{shell}
+%\end{itemize}
+%
+% \note{关于make命令和makewin命令的更多用法,请使用help命令进行查询,Windows用户请在命令行中运行makewin help,Linux和Mac用户请打开\file{Makefile}文件查看。}
% \section{使用说明}
% \label{sec:usage}
% 本手册假定用户已经能处理一般的 \LaTeX{} 文档,并对\BibTeX{} 有一定了解。如果从来没有接触过 \TeX 和 \LaTeX,建议先学习相关的基础知识。磨刀不误砍柴工!
@@ -257,6 +294,8 @@
% xelatex main
% \end{shell}
%
+% \note{实际情况中,您只需使用make或者makewin就可以自动完成以上所有工作\footnote{make和makewin调用latexmk来完成编译工作,比示意的编译命令更加灵活,能够自主确定必要的编译次数,可以明显缩短编译时间。}。}
+%
% 下面是示例文件中主文件\file{main.tex}的内容:
%
% \lstinputlisting[style=lstStyleLaTeX]{main.tex}
@@ -289,14 +328,24 @@
% \documentclass[type=master,proffesionalmaster=true,]{cquthesis}
% \end{latex}
% \DescribeOption{printmode=}
-% 可选项,确定单双页打印模式,有三个值可用:
+% 可选项,确定单双页打印模式,有三个值可用,默认采用自动判定(auto):
% \begin{description}
% \item[\option{auto}] 模板会按照学校要求和论文类型自动判定打印模式;
% \item[\option{oneside}] 强制以单页模式打印,适合最后提交电子版时;
% \item[\option{twoside}] 强制以双页模式打印。
% \end{description}
-%
-% 默认采用自动判定。
+%
+% \DescribeOption{bilinguallist=}
+% 从版本v1.12开始,\cquthesis 开始支持图、表、公式的中英双语题注。除此之外,就像您期待的那样,表录、图录、公式目录页有了自己的英文版本,它们全部按双语题注的内容自动生成。这是一个可选项,有三个值可用:
+% \begin{description}
+% \item[\option{off}] 缺省默认,模板不会生成表录、图录、公式目录的英文版本;
+% \item[\option{combined}] 模板会生成表录、图录、公式目录的英文版本,它们会在中文版本中逐条嵌入;
+% \item[\option{apart}] 模板会生成表录、图录、公式目录的英文版本,它们独立于中文版本,与其一同输出。
+% \end{description}
+%
+% 有关双语题注的用法和英文版本表录等文档部件的位置调整方式,请参阅第\ref{sec:bicaptions}节。
+%
+% \note{以上三个选项仅与表录、图录、公式目录相关,不会影响双语题注的功能。}
%
% \DescribeOption{openany}
% \DescribeOption{openright}
@@ -429,6 +478,13 @@
%
% \note{在\file{cover.tex}中自己用不上的字段可以坐视不理、注释、删除(随你意)。模板在v 0.9.7 版本后更新了运作机制,\textbf{不再需要}主动注释掉不需要的字段以获得正确的封面排版。}
%
+% \DescribeMacro{\cassistsupervisor}
+% \DescribeMacro{\cextrasupervisor}
+% \DescribeMacro{\eassistsupervisor}
+% 本科毕业设计中,有的同学会有助理指导老师或者在校外进行毕业设计(常见于保研的同学),这时需要在论文封面上标注自己的“助理指导教师”或“校外指导教师”。在使用时需要注意:1.这三个字段中,不使用的项目要求留空为正反大括号;2.“助理指导教师”和“校外指导教师”的英文都填写在\cs{eassistsupervisor}中,如果两类指导老师同时存在(这个情况太少了),可以使用正反大括号括起,括号内以逗号分隔。
+%
+% \note{这是v 1.14 版本中的新增功能。}
+%
% \DescribeMacro{\cmajor}
% \DescribeMacro{\emajor}
% 填写自己的专业名称,专硕不用这个字段。在专业名称太长的时候封面可能会不够美观,这时可以使用\cs{zihao}来调整这一个字段的字号大小。详情请见\file{cover.tex}。
@@ -558,6 +614,36 @@
% 生成原创说明和授权书,这个命令可以带一个\oarg{PDF文件地址}作为参数。这样,在您和您的导师签名之后,您可以单独扫描一下签过名的原创说明和授权书,以\cs{cquauthpage}\oarg{pdf文件地址}的形式将扫描页放入论文的PDF文件中的对应位置。
%
% \subsection{宏包和特色功能}
+% \subsubsection{双语题注}
+% \label{sec:bicaptions}
+% \DescribeMacro{\bicaption}
+% 在学校的相关格式文件中,硕士生和博士生的表格和插图的题注需要中英对照,使用\cs{bicaption}\marg{中文题注}\marg{英文题注}命令代替\cs{caption}即可解决这个问题,示例如下:
+%
+% \begin{latex}
+% \begin{figure}[tbh]
+% \centering
+% \includegraphics[width=0.7\linewidth]{figures/TEST}
+% \bicaption{这是一张测试用图片}{This figure is for test only}
+% \label{fig:cqubadge}
+% \end{figure}
+% \end{latex}
+%
+% 在题注很长的时候,为了防止题注对应的表录(或图录)的条目太长,可使用\cs{bicaption}\oarg{短中文}\marg{中文题注}\oarg{短英文}\marg{英文题注}来解决这个问题:
+% \begin{latex}
+% \begin{tabularx}{cc}
+% \bicaption[这是表录中的段条目]{这是一个很长很长很长的中文题注,你可以写很多行}%
+% [This is a really short one.]{Linebreak is for demostration only. It's okay to go without it.}
+% \label{fig:cqubadge}
+% 我 & 在\\
+% 测 & 试\\
+% \end{tabularx}
+% \end{latex}
+% \DescribeMacro{\eqlist}
+% 重要算式列表\cs{eqlist}和\cs{listeq}命令从v1.12版本后也支持中英双语,用法是\cs{eqlist}\marg{中文}\oarg{英文},请注意括号。
+%
+% 上面的这些用法都在\cquthesis 的示例文件中有所体现,供您参考。
+%
+% \note{英文版本的重要算式列表需要在\option{bilinguallist=}\option{combined}或者\option{apart}时才会生效。另外,当且仅当在\option{bilinguallist=}\option{apart}时,\file{main.tex}中的\cs{listoffiguresEN},\cs{listoftablesEN}和\cs{listofequationsEN}才会发挥作用,此时您可以通过调整这些命令的位置来调整图录、表录、方程式列表各自之间以及中英文版本之间的顺序。}
% \subsubsection{数学环境}
% \label{sec:math}
% \cquthesis{} 定义了常用的数学环境:
@@ -673,23 +759,30 @@
%<cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<cls>\ProvidesClass{cquthesis}
%<cfg>\ProvidesFile{cquthesis.cfg}
-%<cls|cfg>[2016/06/09 v0.9.7 Chongqing University Thesis Template]
+%<cls|cfg>[2016/08/18 v1.14 Chongqing University Thesis Template]
% \end{macrocode}
% 定义一些开发常量:
% \begin{macrocode}
%<*cls>
\hyphenation{Cqu-Thesis}
\newcommand{\cquthesis}{\textsc{CquThesis}}
-\def\version{0.9.7}
+\def\version{1.14}
%</cls>
% \end{macrocode}
-% \file{cquthesis.cfg}有一些难以分类的常量:
+% \file{cquthesis.cfg}中,涉及文档部件的部分常量:
% \changes{v0.9.0}{2016/05/16}{把目录加入到了PDF书签中。}
% \begin{macrocode}
%<*cfg>
\def\cqueqshortname {式}
\def\cqu@denotation@name {主要符号对照表}
+\def\shorttablename {表}
+\def\shorttablenameEN {Table}
+\def\shortfigurename {图}
+\def\shortfigurenameEN {Figure}
\def\listofequationsname {重要算式索引}
+\def\listofequationsnameEN {\textbf{List of Equations}}
+\def\listoffiguresnameEN {\textbf{List of Figures}}
+\def\listoftablesnameEN {\textbf{List of Tables}}
\def\cqu@bib@name {参考文献}
\def\cqu@tocnameinbkmark {目{ }录}
\newcommand{\parenthesesthis}[1]{(#1)}
@@ -753,6 +846,16 @@
% \begin{macrocode}
\DeclareBoolOption{continuoustoc}
% \end{macrocode}
+% 双语图录、表录、公式列表开关
+% \begin{macrocode}
+\newif\if@bioff
+\newif\if@bicombined
+\newif\if@biapart
+\@biofffalse\@bicombinedfalse\@biapartfalse
+\define@key{cqu}{bilinguallist}{%
+ \@biofffalse\@bicombinedfalse\@biapartfalse
+ \expandafter\csname @bi#1true\endcsname}
+% \end{macrocode}
% 传递选项给CTeXBook
% \begin{macrocode}
\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}}
@@ -796,6 +899,19 @@
\fi
\fi
% \end{macrocode}
+% 如果没有正确指定图录表录的双语模式,取默认值off:
+% \begin{macrocode}
+\if@bioff\relax\else
+ \if@bicombined\relax\else
+ \if@biapart\relax\else
+ \kvsetkeys{cqu}{bilinguallist=off,}
+ \ClassWarning{cquthesis}%
+ {Unexpected or missing bilingual list mode, processing with OFF: \MessageBreak
+ bilinguallist=[off|combined|apart]}{}
+ \fi
+ \fi
+\fi
+% \end{macrocode}
% \subsection{载入宏包}
%
% 使用成熟的宏包而不是自己造轮子几乎总是一个不错的选择,\LaTeX 的强大之处就在这诸多宏包。
@@ -825,8 +941,12 @@
%
% 解决各种文档部件需求,如表格、题注、插图等
% \changes{v0.9.41}{2016/05/25}{修正了\pkg{tgcursor}使\cs{textbf}失效的Bug,现在起使用\pkg{courier}代替。}
+% \changes{v1.12}{2016/07/06}{得益于\pkg{caption}和\pkg{bicaption}和\pkg{newfloat}三个宏包,\cquthesis 支持双语题注了。}
% \begin{macrocode}
+\RequirePackage{newfloat}
+\RequirePackage{caption}
\RequirePackage[labelformat=simple]{subcaption}
+\RequirePackage{bicaption}
\RequirePackage{array}
\RequirePackage{tabularx}
\RequirePackage{booktabs}
@@ -1283,8 +1403,9 @@
\fi
%</cls>
% \end{macrocode}
-%<*cfg>
+%
% \begin{macrocode}
+%<*cfg>
\sisetup{%
list-final-separator = {和},
list-pair-separator = {和},
@@ -1325,9 +1446,9 @@
\setlength{\floatsep}{20bp \@plus4pt \@minus1pt}
\setlength{\intextsep}{24bp \@plus4pt \@minus2pt}
\setlength{\textfloatsep}{20bp \@plus4pt \@minus2pt}
-\setlength{\@fptop}{0bp \@plus1.0fil}
-\setlength{\@fpsep}{12bp \@plus2.0fil}
-\setlength{\@fpbot}{0bp \@plus1.0fil}
+\setlength{\@fptop}{6bp \@plus2bp}
+\setlength{\@fpsep}{12bp \@plus2bp}
+\setlength{\@fpbot}{6bp \@plus2bp}
% \end{macrocode}
% 让浮动对象缺省值更宽松
% \begin{macrocode}
@@ -1369,11 +1490,12 @@
% \end{macro}
% \end{macro}
% 定制表格和插图的题注样式:
+% \changes{v1.12}{2016/07/06}{题注的字体设置对中英文都进行了适配。}
% \begin{macrocode}
\def\cqu@tabular{\zihao{5}\@tabular}
-\DeclareCaptionLabelFormat{cqu}{{\zihao{5}\songti #1~\rmfamily #2}}
+\DeclareCaptionLabelFormat{cqu}{{\zihao{5}\rmfamily\songti \textbf{#1~#2}}}
\DeclareCaptionLabelSeparator{cqu}{\hspace{\ccwd}}
-\DeclareCaptionFont{cqu}{\zihao{5}}
+\DeclareCaptionFont{cqu}{\zihao{5}\rmfamily\songti}
\captionsetup{labelformat=cqu,labelsep=cqu,font=cqu}
\captionsetup[table]{position=top,belowskip={12bp-\intextsep},aboveskip=6bp}
\captionsetup[figure]{position=bottom,belowskip={12bp-\intextsep},aboveskip=6bp}
@@ -1381,6 +1503,45 @@
\renewcommand{\thesubfigure}{(\alph{subfigure})}
\renewcommand{\thesubtable}{(\alph{subtable})}
% \end{macrocode}
+% \begin{macro}{\bicaption}
+% 这里对\cs{bicaption}这个命令进行设置,题注的第二语言默认为英文,用户可以重定义\cs{shorttablenameEN}和\cs{shortfigurenameEN}
+% \begin{macrocode}
+\captionsetup[bi-first]{bi-first}
+\captionsetup[bi-second]{bi-second}
+\DeclareCaptionOption{bi-first}[]{%
+\def\tablename{\shorttablename}
+\def\figurename{\shortfigurename}
+}%bi-first
+\DeclareCaptionOption{bi-second}[]{%
+ \def\tablename{\shorttablenameEN}
+ \def\figurename{\shortfigurenameEN}
+}%bi-second
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\listoffiguresEN}
+% \begin{macro}{\listoftablesEN}
+% 按照三种不同情况进行不同的工作:1、如果不开启双语索引,则去掉命令作用,将创建出的list作为黑洞;2、要求中英文编录到一起时不分离索引文件:
+% \begin{macrocode}
+\DeclareFloatingEnvironment[fileext=lofEN]{figuresEN}[\shortfigurenameEN][\listoffiguresnameEN]
+\DeclareFloatingEnvironment[fileext=lotEN]{tablesEN}[\shorttablenameEN][\listoftablesnameEN]
+% \end{macrocode}
+% 3、中英文分开编译
+% \begin{macrocode}
+\if@bicombined\relax
+\else
+ \captionsetup[bi-second]{listtype+=sEN}
+\fi
+\if@biapart\relax
+\else
+ \AtBeginDocument{%
+ \let\listoffiguresEN\relax
+ \let\listoftablesEN\relax
+ \let\listofequationsEN\relax
+ }%AtBeginDocument
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% 调整表格字号,调整每列之间的间距,单元格内垂直居中
% \begin{macrocode}
\AtBeginEnvironment{tabularx}{\begingroup\zihao{5}}
@@ -1403,16 +1564,20 @@
%
% longtable方面也需要做设置
% \begin{macrocode}
+\setlength{\LTpre}{\bigskipamount}
+\setlength{\LTpost}{\bigskipamount}
\let\cqu@LT@array\LT@array
\def\LT@array{\zihao{5}\cqu@LT@array}
% \end{macrocode}
%
% \subsubsection{代码环境}
-% 载入\pkg{listings}宏包,定义基础代码环境:
+% \begin{environment}{lstStyleBase}
+% \changes{v1.00}{2016/06/17}{将代码环境的基础字号改为了\cs{footnotesize},原先的\cs{scriptsize}实在太小了。}
+% 载入\pkg{listings}宏包,定义基础代码环境,注意这个环境只是个模板,没有提供直接使用的接口:
% \begin{macrocode}
\RequirePackage{listings}
\lstdefinestyle{lstStyleBase}{%
- basicstyle=\scriptsize\ttfamily,
+ basicstyle=\footnotesize\ttfamily,
aboveskip=\medskipamount,
belowskip=\medskipamount,
lineskip=0pt,
@@ -1454,6 +1619,7 @@
rulecolor=\color{cyan},
language=Python}
% \end{macrocode}
+% \end{environment}
% \begin{environment}{Cplus}
% \begin{environment}{Python}
% \cquthesis 内置了两个代码环境,\env{Cplus}和\env{Python},您可以参照代码在\file{cquthesis.sty}中定义自己的环境。
@@ -1553,6 +1719,9 @@
\cqu@def@term{studentid}
\cqu@def@term{csupervisor}
\cqu@def@term{esupervisor}
+\cqu@def@term{cassistsupervisor}
+\cqu@def@term{cextrasupervisor}
+\cqu@def@term{eassistsupervisor}
\cqu@def@term{cpsupervisor}
\cqu@def@term{epsupervisor}
\cqu@def@term{cmajor}
@@ -1619,12 +1788,14 @@
% \begin{macro}{\make@cover@CN}
% \changes{v0.9.7}{2016/06/09}{使用\pkg{varwidth}代替了\pkg{pbox}。}
% 基本上的思路是能复用就复用,姓名那几行分为左右两个\env{varwidth}:
+% \changes{v1.00}{2016/06/17}{现在,标题中的英文和中文统一使用无衬线字体。}
+% \changes{v1.14}{2016/08/18}{本科封面新增“助理指导教师”“校外指导教师”的字段,自动判定是否有输入,有则显示,无则不显示。}
% \begin{macrocode}
\newcommand{\make@cover@CN}{%
\thispagestyle{style@empty}
\begin{center}
\rule{0mm}{15mm}
- \heiti
+ \sffamily\heiti
\ifcqu@bachelor
\zihao{-2}\cqu@thesistypenameCN
\\ \vspace{\stretch{1}}
@@ -1648,6 +1819,8 @@
\cqu@studentCN\cqu@title@separatorCN\\
\cqu@studentnumCN\cqu@title@separatorCN\\
\cqu@supervisorCN\cqu@title@separatorCN\\
+ \ifdefstring{\cqu@cassistsupervisor}{}{\relax}{{\zihao{5}\begin{CJKfilltwosides}{66bp}\cqu@assistsupervisorCN\end{CJKfilltwosides}}\hfill\cqu@title@separatorCN\\}
+ \ifdefstring{\cqu@cextrasupervisor}{}{\relax}{{\zihao{5}\begin{CJKfilltwosides}{66bp}\cqu@extrasupervisorCN\end{CJKfilltwosides}}\hfill\cqu@title@separatorCN\\}
\cqu@majorCN\cqu@title@separatorCN
\end{CJKfilltwosides}
\end{varwidth}
@@ -1670,9 +1843,13 @@
\zihao{3}
\begin{varwidth}{\textwidth}%
\mbox{\cqu@cauthor}\\
- \ifcqu@bachelor\mbox{\cqu@studentid}\\\fi
+ \ifcqu@bachelor\cqu@studentid\\\fi
\cqu@csupervisor\\ %不要放在盒子里
\ifcqu@academic %这里有点复杂
+ \ifcqu@bachelor
+ \ifdefstring{\cqu@cassistsupervisor}{}{\relax}{\cqu@cassistsupervisor\\}
+ \ifdefstring{\cqu@cextrasupervisor}{}{\relax}{\cqu@cextrasupervisor\\}
+ \fi
\mbox{\cqu@cmajor}
\ifcqu@bachelor\relax\else\\\cqu@cclass\fi
\else
@@ -1691,6 +1868,7 @@
% \subsubsection{绘制英文封面}
% \begin{macro}{\make@cover@EN}
% 英文封面由于不需要汉字两端对齐,相对来说排版难度低一些:
+% \changes{v1.14}{2016/08/18}{“助理指导教师”“校外指导教师”的英文字段也相应添加,同样自动判定是否有输入来决定是否显示。}
% \begin{macrocode}
\newcommand{\make@cover@EN}{%
\cleardoublepage
@@ -1707,6 +1885,7 @@
\\ \vspace{\stretch{2}}
\zihao{3}\textbf{\cqu@studentEN\cqu@title@separatorEN\mbox{\cqu@eauthor}}\\
\cqu@supervisorEN\cqu@title@separatorEN\mbox{\cqu@esupervisor}\\
+ \ifdefstring{\cqu@eassistsupervisor}{}{\relax}{\cqu@assistsupervisorEN\cqu@title@separatorEN\mbox{\cqu@eassistsupervisor}\\}
\cqu@majorEN\cqu@title@separatorEN\mbox{\cqu@emajor}
\else
\zihao{-1}\textbf{\cqu@etitle}
@@ -1869,6 +2048,9 @@
\def\cqu@studentnumCN{学号}
\def\cqu@supervisorCN{指导教师}
\def\cqu@supervisorEN{Supervisor}
+ \def\cqu@assistsupervisorCN{助理指导教师}
+ \def\cqu@extrasupervisorCN{校外指导教师}
+ \def\cqu@assistsupervisorEN{Assistant Supervisor}
\def\cqu@majorCN{专业}
\def\cqu@majorEN{Major}
\def\cqu@universitynameCN{重庆大学}
@@ -1990,13 +2172,30 @@
\fi
% \end{macrocode}
% \subsubsection{公式索引}
+% \begin{macro}{\listofequationsEN}
+% 支持生成双语对照索引,分三个情况:
% \begin{macrocode}
\newlistof[chapter]{equations}{equ}{\listofequationsname}
-\newcommand{\listeq}[1]{%
- \addcontentsline{equ}{equations}{\protect\numberline{\theequation}#1}\par}
+\newlistof[chapter]{equationsEN}{equEN}{\listofequationsnameEN}
+\DeclareDocumentCommand{\listeq}{ m o }{%
+ \addcontentsline{equ}{equations}{\protect\numberline{\theequation}#1}\par
+ \IfNoValueTF{#2}{%
+ \relax
+ }{%
+ \if@bicombined
+ \addcontentsline{equ}{equations}{\protect\numberline{\theequation}#2}\par
+ \else
+ \if@biapart
+ \addcontentsline{equEN}{equationsEN}{\protect\numberline{\theequation}#2}\par
+ \fi
+ \fi
+ }
+}%listeq
\setlength{\cftequationsnumwidth}{2.5em}
+\setlength{\cftequationsENnumwidth}{2.5em}
\let\eqlist\listeq
% \end{macrocode}
+% \end{macro}
%
% 正确输出页眉页脚
% \begin{macrocode}
@@ -2011,17 +2210,20 @@
%
% 目录和索引标题居中,包含\cs{fixhead}
% \changes{v0.9.0}{2016/05/16}{把目录加到了PDF书签中。}
+% \changes{v1.12}{2016/07/06}{现在,目录、图录、表录、公式表的英文字体也采用了无衬线字。}
% \begin{macrocode}
%<*cls>
\renewcommand{\cfttoctitlefont}{%
- \phantomsection\pdfbookmark[0]{\cqu@tocnameinbkmark}{toc}\cqu@fixhead\hfill\heiti\zihao{3}}
-\renewcommand{\cftloftitlefont}{\cqu@fixhead\hfill\heiti\zihao{3}}
-\renewcommand{\cftlottitlefont}{\cqu@fixhead\hfill\heiti\zihao{3}}
-\renewcommand{\cftequtitlefont}{\cqu@fixhead\hfill\heiti\zihao{3}}
+ \phantomsection\pdfbookmark[0]{\cqu@tocnameinbkmark}{toc}\cqu@fixhead\hfill\bfseries\sffamily\heiti\zihao{3}}
+\renewcommand{\cftloftitlefont}{\cqu@fixhead\hfill\sffamily\heiti\zihao{3}}
+\renewcommand{\cftlottitlefont}{\cqu@fixhead\hfill\sffamily\heiti\zihao{3}}
+\renewcommand{\cftequtitlefont}{\cqu@fixhead\hfill\sffamily\heiti\zihao{3}}
+\renewcommand{\cftequENtitlefont}{\cqu@fixhead\hfill\sffamily\heiti\zihao{3}}
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand{\cftafterloftitle}{\hfill}
\renewcommand{\cftafterlottitle}{\hfill}
\renewcommand{\cftafterequtitle}{\hfill}
+\renewcommand{\cftafterequENtitle}{\hfill}
% \end{macrocode}
%
% 重写使用tocloft宏包情况下的目录和索引生成,每次生成新开一页
diff --git a/Master/texmf-dist/source/latex/cquthesis/makewin.bat b/Master/texmf-dist/source/latex/cquthesis/makewin.bat
new file mode 100755
index 00000000000..b7a547cb29c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cquthesis/makewin.bat
@@ -0,0 +1,136 @@
+@echo off
+
+set flag=%1
+if %flag%x == x (
+ set flag=thesis
+)
+
+if %flag%x == thesisx (
+ call:thesis
+ goto:EOF
+)
+if %flag%x == thesisxx (
+ call:thesisx
+ goto:EOF
+)
+if %flag%x == docx (
+ call:extract
+ call:document
+ goto:EOF
+)
+if %flag%x == cleanx (
+ call:cleanaux
+ goto:EOF
+)
+if %flag%x == cleanpdfx (
+ call:cleanpdf
+ goto:EOF
+)
+if %flag%x == cleanallx (
+ call:cleanaux
+ call:cleanpdf
+ goto:EOF
+)
+if %flag%x == extractx (
+ call:extract
+ goto:EOF
+)
+if %flag%x == allx (
+ call:thesis
+ call:document
+ goto:EOF
+)
+if %flag%x == buildx (
+ call:extract
+ call:thesis
+ goto:EOF
+)
+if %flag%x == buildxx (
+ call:extract
+ call:thesis
+ call:document
+ goto:EOF
+)
+
+:help
+ echo *************************************************************
+ echo This is the Makefile script for CQUThesis on Windows.
+ echo For CQUThesis: https://github.com/nanmu42/CQUThesis
+ echo by Zhennan Li (C) 2016 under LPPL 1.3
+ echo The idea comes from Github Liam0205/sduthesis, Many thanks!
+ echo *************************************************************
+ echo *
+ echo USAGE:
+ echo makewin [param]
+ echo param:
+ echo help Display this help text
+ echo thesis (default)Compile the thesis via latexmk
+ echo thesisx Compile the thesis via XeLaTeX(only if latexmk is not installed.)
+ echo doc Compile the documentation of CQUThesis
+ echo clean Clean all aux files
+ echo cleanpdf Clean all PDFs
+ echo cleanall Clean all aux files and all PDFs
+ echo extract Extract the Thesis Template from .dtx files.
+ echo all thesis + doc
+ echo build extract + thesis
+ echo buildx extract + thesis + doc
+ echo *
+ echo ***********************Happy TeXing**************************
+goto:EOF
+
+:checkfiles
+ IF NOT EXIST cquthesis.cls call:extract
+ IF NOT EXIST cquthesis.cfg call:extract
+goto:EOF
+
+:thesis
+ call:checkfiles
+ latexmk -xelatex main.tex
+goto:EOF
+
+:thesisx
+ call:checkfiles
+ xelatex main.tex
+ bibtex main.tex
+ xelatex main.tex
+ xelatex main.tex
+ xelatex main.tex
+goto:EOF
+
+:cleanaux
+ echo clean aux...
+ for %%i in (*.aux *.bbl *.equ *.glo *.gls *.hd *.idx *.ilg *.ind *.lof *.lot *.out *.blg *.log *.thm *.toc *.synctex.gz *.lofEN *.lotEN *.equEN) do (
+ del %%i
+ )
+ echo Done.
+goto:EOF
+
+:cleanpdf
+ echo clean pdf...
+ for %%i in (*.pdf) do (
+ del %%i
+ )
+ echo Done.
+goto:EOF
+
+:clean_all
+ call:cleanaux
+ call:cleanpdf
+goto:EOF
+
+:extract
+ echo extracting...
+ latex cquthesis.ins
+ echo *******CQUThesis has been extracted.********
+goto:EOF
+
+:document
+ echo building documents...
+ set cmode=-interaction=batchmode
+ xelatex cquthesis.dtx
+ makeindex -s gind.ist -o cquthesis.ind cquthesis.idx
+ makeindex -s gglo.ist -o cquthesis.gls cquthesis.glo
+ xelatex cquthesis.dtx
+ xelatex cquthesis.dtx
+ xelatex cquthesis.dtx
+goto:EOF