summaryrefslogtreecommitdiff
path: root/macros/xetex/latex/xduts/xduts.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/xetex/latex/xduts/xduts.dtx')
-rw-r--r--macros/xetex/latex/xduts/xduts.dtx623
1 files changed, 501 insertions, 122 deletions
diff --git a/macros/xetex/latex/xduts/xduts.dtx b/macros/xetex/latex/xduts/xduts.dtx
index d0e0686923..e17a05a32e 100644
--- a/macros/xetex/latex/xduts/xduts.dtx
+++ b/macros/xetex/latex/xduts/xduts.dtx
@@ -1,14 +1,16 @@
% \iffalse
%<*driver>
\ProvidesFile{xduts.dtx}
-[2022/04/16 v1.2.0.0 Xidian University TeX Suite]
+[2022/05/03 v1.8.1.0 Xidian University TeX Suite]
%</driver>
%<class|sty>\NeedsTeXFormat{LaTeX2e}
%<class|sty>\RequirePackage{expl3}
-%<xduugthesis>\ProvidesExplClass{xduugthesis}
%<xdufont>\ProvidesExplPackage{xdufont}
-%<class|sty> {2022/04/16}{1.2.0.0}
+%<xdupgthesis>\ProvidesExplClass{xdupgthesis}
+%<xduugthesis>\ProvidesExplClass{xduugthesis}
+%<class|sty> {2022/05/03}{1.8.1.0}
%<xdufont> {Xidian University Font package}
+%<xdupgthesis> {Xidian University Postgraduate Thesis document class}
%<xduugthesis> {Xidian University Undergraduate Thesis document class}
%<*driver>
\documentclass{ctxdoc}
@@ -29,6 +31,7 @@
}
}
\setcounter{tocdepth}{5}
+\ctexset{punct=quanjiao}
\usepackage{hologo}
\usepackage{fetamont}
\usepackage{xurl}
@@ -57,7 +60,8 @@
% [<name>] LaTeX2e可选参数
\newcommand{\oargx}[1]{\xspace\Arg{#1}\xspace}
% 文件
-\newcommand{\filex}[1]{\xspace\texttt{#1}\xspace}
+\usepackage{seqsplit}
+\newcommand{\filex}[1]{\xspace{\ttfamily\seqsplit{#1}}\xspace}
% 环境
\newcommand{\envx}[1]{\xspace\env{#1}\xspace}
% 宏包
@@ -102,7 +106,7 @@
framerule = 1 pt,
framesep = 0 pt,
xleftmargin = 0 em,
- xrightmargin = 3 em,
+ xrightmargin = 0 em,
escapeinside = {(*}{*)},
breaklines = true,
basicstyle = \small\ttfamily,
@@ -141,7 +145,7 @@
\end{document}
%</driver>
% \fi
-% \CheckSum{1068}
+% \CheckSum{1195}
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -165,8 +169,8 @@
% \thispagestyle{empty}
% \begin{abstract}
% \xduts{}是面向西安电子科技大学本科生/研究生的\LaTeXiii{}文档类和宏包套装,
-% 支持\XeLaTeX{},
-% 支持\texlive{}、\mactex{}、\miktex{},
+% 仅支持\XeLaTeX{},
+% 仅支持\texlive{}、\mactex{}、\miktex{},
% 支持Windows、macOS、GNU/Linux、Overleaf和TeXPage。
% \end{abstract}
% \renewcommand{\abstractname}{免责声明}
@@ -188,38 +192,45 @@
% \section{介绍}
% \xduts{} (Xidian University \TeX{} Suite)
% 是为了帮助西安电子科技大学本科生/研究生撰写开题报告/学位论文及其他文档
-% 而编写的\LaTeX{}文档类和宏包套装,目前有:
+% 而编写的\LaTeXiii{}文档类和宏包套装,目前有:
% \begin{itemize}
-% \item \clsx{xduugthesis},本科毕业设计论文。
% \item \pkgx{xdufont},中/英/数学字体配置宏包。
+% \item \clsx{xduugthesis},本科毕业设计论文。
% \end{itemize}
-% 即将支持:
+% 正在开发:
% \begin{itemize}
-% \item \clsx{xduugtp},本科毕业设计论文开题报告表。
% \item \clsx{xdupgthesis},研究生学位论文。
+% \end{itemize}
+% 即将支持:
+% \begin{itemize}
% \item \clsx{xdupgtp},研究生学位论文开题报告表。
+% \item \clsx{xduugtp},本科毕业设计论文开题报告表。
% \end{itemize}
% \par
-% 本文档将尽量完整的介绍\xduts{}的使用方法,
+% \changes{v1.2.0.1}{2022/04/19}{增加GitHub Discussions}
+% 本文档将尽量完整地介绍\xduts{}的使用方法,
% 如有不清楚之处,或者想提出改进建议,
+% 可以在GitHub Discussions\footurl{https://github.com/note286/xduts/discussions/}
+% 参与讨论或提问。
+% 如确定\xduts{}存在bug,
% 可以在GitHub Issues\footurl{https://github.com/note286/xduts/issues/}
-% 参与讨论或提问。另外,\textbf{不接受任何Pull Requests}。
+% 具体描述。另外,\textbf{不接受任何Pull Requests}。
% \StopEventually{}
% \section{使用说明}
% \label{使用说明}
% 《一份(不太)简短的\LaTeXe{}介绍》\footctan{info/lshort/chinese/lshort-zh-cn.pdf}
-% 中提及的内容本文档将不再提及。
-% \xduts{}中的所有文档类和宏包仅内置了实现功能所必要的宏包,
+% 中提及的内容本文档将不再赘述。
+% \xduts{}中的所有文档类和宏包仅内置了实现功能所需的宏包,
% 对于常用的宏包如\pkgx{subfig}、\pkgx{algpseudocodex}、
% \pkgx{amsmath}、\pkgx{amsthm}和\pkgx{siunitx}等\textbf{均未内置},
-% 用户视需求自行加载。
-% 请在最新版\LaTeX{}环境中使用最新版\xduts{},
-% 认真阅读相应文档类/宏包使用说明章节即可使用\xduts{}。
-% \par
+% 用户可以参考\secrefx{兼容性说明}后,视需求自行加载。
% 相应格式规范均已实现,用户仅需要撰写文章内容即可,请勿随意添加格式修改命令。
% \changes{v1.1.2.1}{2022/04/15}{增加默认值说明}
-% 部分样式的默认值并不严格符合学校规范,
+% \textbf{部分样式的默认值并不严格符合学校规范},
% 用户可以结合学校规范并参考\secrefx{功能说明}功能说明自行修改。
+% \par
+% 请在最新版\LaTeX{}环境中使用最新版\xduts{},
+% 认真阅读相应文档类/宏包使用说明章节即可使用\xduts{}。
% \subsection{xdufont}
% \pkgx{xdufont}宏包基于\pkgx{xeCJK},相较于\pkgx{ctex}宏包的主要优势为默认支持宋体粗体、斜体,内置多种字体配置,可任意搭配中/英/数学字体,更加符合校内各种文档的撰写要求。
% \par
@@ -234,13 +245,17 @@
% \end{document}
% \end{latexexample}
% \par
-% 学会以上用法后即可立即使用\pkgx{xdufont}宏包了。
+% 学会以上用法后即可使用\pkgx{xdufont}宏包。
+% \changes{v1.4.0.0}{2022/04/26}{新增研究生学位论文}
+% \subsection{xdupgthesis}
% \subsection{xduugthesis}
% \pkgx{xduugthesis}基于\clsx{ctexbook}文档类,
% 提供多种字体配置,部分样式可自定义,信息录入便捷。
+% \changes{v1.3.1.1}{2022/04/26}{英文本科生毕业设计规范参考说明}
+% 论文语言为英文时,部分格式符合《外国语学院学士论文写作手册》。
% 请在阅读《本科生毕业设计(论文)工作手册》后再使用\pkgx{xduugthesis}。
% \par
-% 典型的\clsx{xduugthesis}主文件结构应该如下所示:
+% 典型的\clsx{xduugthesis}主文件结构如下所示:
% \begin{latexexample}[moretexcs={\xdusetup,\frontmatter,\mainmatter,\chapter,\backmatter},emph={[1]document}]
% \documentclass{xduugthesis}
% \xdusetup{}
@@ -256,7 +271,6 @@
% \secrefx{编译}介绍了如何编译,\secrefx{参数设置}介绍了如何自定义配置。
% 其中,字体选项见\secrefx{字体选项},
% 部分英文字体切换见\secrefx{英文字体},
-% 论文语言切换见\secrefx{语言配置},
% 参考文献配置见\secrefx{参考文献配置},
% 页面配置见\secrefx{页面配置},
% 交叉引用配置见\secrefx{交叉引用配置},
@@ -288,7 +302,25 @@
% }
% \end{latexexample}
% \par
-% 学会以上用法后即可立即使用\clsx{xduugthesis}文档类了。
+% 学会以上用法后即可使用\clsx{xduugthesis}文档类。
+% \changes{v1.3.0.1}{2022/04/20}{增加兼容性说明}
+% \section{兼容性说明}
+% \label{兼容性说明}
+% \xduts{}对部分常见宏包进行了针对性地适配,
+% 需要注意的是,这些宏包仍需用户视需求自行加载。
+% \subsection{算法}
+% 主要适配算法内容字号和默认浮动位置。
+% \pkgx{algorithm}宏包提供了算法浮动体\envx{algorithm}环境,
+% 可以搭配\pkgx{algpseudocodex}等宏包使用。
+% \pkgx{algorithm2e}宏包提供了算法环境,
+% 该宏包提供的\envx{algorithm}环境实际将浮动体与算法内容合二为一。
+% \subsection{图片}
+% 主要适配子图caption字体字号,
+% \changes{v1.4.1.1}{2022/04/27}{修正子图适配宏包名称}
+% 包括\pkgx{subfig}宏包和\pkgx{subcaption}宏包。
+% \subsection{表格}
+% 主要适配表格内容字号,
+% 包括所有使用\envx{table}浮动体的表格和\pkgx{longtable}宏包提供的\envx{longtable}环境。
% \section{功能说明}
% \label{功能说明}
% 请根据\secrefx{使用说明}中相应文档类/宏包的说明来选择性地阅读本节内容。
@@ -316,7 +348,7 @@
% 它们可以按如下两种等价方式来设定:
% \begin{latexexample}[morekeywords={\xdusetup},emph={[1]style,cjk-font,latin-font,info,title,author,department}]
% \xdusetup{
-% style = {cjk-font = adobe, latin-font = tacn},
+% style = { cjk-font = adobe, latin-font = tacn },
% info = {
% title = {论如何让用户认真阅读文档},
% author = {张三},
@@ -374,7 +406,7 @@
% \begin{syntax}
% \optx{style/cjk-fake-bold}=\metax{伪粗体粗细程度}
% \end{syntax}
-% 设置中文字体伪粗体粗细程度。默认为\valuex{3},对于部分存在对应的粗体字体的中文字体,如FandolSong和FandolHei等,该选项不生效。
+% 设置中文字体伪粗体粗细程度。默认为\valuex{3},对于部分存在对应粗体字体的中文字体,如FandolSong和FandolHei等,该选项不生效。
% \end{function}
% \begin{function}[added=2022-04-01]{style/cjk-fake-slant}
% \begin{syntax}
@@ -489,7 +521,7 @@
% \begin{syntax}
% \optx{style/en-cjk-font}=\metax{true|(false)}
% \end{syntax}
-% 切换字体族时,英文是否使用中文字体。主要作用于封面、章节标题、caption、页眉页脚等。
+% 切换字体族时,英文是否使用中文字体。主要作用于封面、章节标题、caption、页眉页脚、参考文献列表等。
% \end{function}
% \begin{optdesc}
% \item[true] 英文使用相对应字体族的中文字体。
@@ -652,6 +684,16 @@
% \end{function}
% \subsection{信息录入}
% \label{信息录入}
+% \begin{function}[added=2022-05-02]{info/graduate-type}
+% \begin{syntax}
+% \optx{info/graduate-type}=\metax{(master)|doctor}
+% \end{syntax}
+% 设置研究生类型。
+% \end{function}
+% \begin{optdesc}
+% \item[master] 硕士研究生。
+% \item[doctor] 博士研究生。
+% \end{optdesc}
% \begin{function}[added=2022-04-01]{info/title}
% \begin{syntax}
% \optx{info/title}=\argx{论文标题}
@@ -774,9 +816,11 @@
% \begin{macro}{\PassOptionsToClass,\LoadClass}
% 加载\clsx{ctexbook}文档类。
% \changes{v0.3.2.0}{2022/04/04}{修正行间距为1.5倍}
+% \changes{v1.8.1.0}{2022/05/03}{修正页面尺寸}
% \begin{macrocode}
\PassOptionsToClass
{
+ a4paper,
zihao=-4,
sub4section,
linespread = 1.5,
@@ -793,7 +837,7 @@
% \end{macrocode}
% \begin{macrocode}
%</class>
-%<*xduugthesis>
+%<*thesis>
% \end{macrocode}
% \begin{macrocode}
\RequirePackage { fancyhdr }
@@ -801,7 +845,7 @@
\RequirePackage { graphicx }
% \end{macrocode}
% \begin{macrocode}
-%</xduugthesis>
+%</thesis>
%<*xdufont>
% \end{macrocode}
% \begin{macrocode}
@@ -1609,9 +1653,10 @@
% \end{macro}
% \begin{macrocode}
%</class|xdufont>
-%<*xduugthesis>
+%<*thesis>
% \end{macrocode}
% \subsection{信息录入}
+% \changes{v1.8.0.0}{2022/05/02}{拆分信息录入选项}
% \begin{variable}
% {
% \l_@@_title_str,
@@ -1621,10 +1666,7 @@
% \l_@@_major_str,
% \l_@@_author_str,
% \l_@@_supv_str,
-% \l_@@_supv_dept_str,
% \l_@@_supv_ent_str,
-% \l_@@_supv_sch_str,
-% \l_@@_class_id_str,
% \l_@@_student_id_str,
% \l_@@_abstract_zh_tl,
% \l_@@_abstract_en_tl,
@@ -1654,22 +1696,10 @@
% \begin{macrocode}
\str_new:N \l_@@_supv_str
% \end{macrocode}
-% 院内导师姓名。
-% \begin{macrocode}
-\str_new:N \l_@@_supv_dept_str
-% \end{macrocode}
% 校外导师姓名。
% \begin{macrocode}
\str_new:N \l_@@_supv_ent_str
% \end{macrocode}
-% 校内导师姓名。
-% \begin{macrocode}
-\str_new:N \l_@@_supv_sch_str
-% \end{macrocode}
-% 作者班级号。
-% \begin{macrocode}
-\str_new:N \l_@@_class_id_str
-% \end{macrocode}
% 作者学号。
% \begin{macrocode}
\str_new:N \l_@@_student_id_str
@@ -1721,22 +1751,10 @@
% \begin{macrocode}
supervisor .tl_set:N = \l_@@_supv_str,
% \end{macrocode}
-% 院内导师姓名。
-% \begin{macrocode}
- supervisor-department .tl_set:N = \l_@@_supv_dept_str,
-% \end{macrocode}
% 校外导师姓名。
% \begin{macrocode}
supervisor-enterprise .tl_set:N = \l_@@_supv_ent_str,
% \end{macrocode}
-% 校内导师姓名。
-% \begin{macrocode}
- supervisor-school .tl_set:N = \l_@@_supv_sch_str,
-% \end{macrocode}
-% 作者班级号。
-% \begin{macrocode}
- class-id .tl_set:N = \l_@@_class_id_str,
-% \end{macrocode}
% 作者学号。
% \begin{macrocode}
student-id .tl_set:N = \l_@@_student_id_str,
@@ -1768,24 +1786,116 @@
% \begin{macrocode}
\keys_set:nn { xdu }
{
- info / title = { },
- info / department = { },
- info / major = { },
- info / author = { },
- info / supervisor = { },
- info / supervisor-department = { },
- info / supervisor-enterprise = { },
- info / supervisor-school = { },
- info / class-id = { },
- info / student-id = { },
- info / abstract = { },
- info / abstract* = { },
- info / keywords = { },
- info / keywords* = { },
- info / acknowledgements = { }
+ info / title = { },
+ info / department = { },
+ info / major = { },
+ info / author = { },
+ info / supervisor = { },
+ info / supervisor-enterprise = { },
+ info / student-id = { },
+ info / abstract = { },
+ info / abstract* = { },
+ info / keywords = { },
+ info / keywords* = { },
+ info / acknowledgements = { }
}
% \end{macrocode}
% \end{macro}
+% \begin{macrocode}
+%<*xduugthesis>
+% \end{macrocode}
+% \subsubsection{本科生}
+% \begin{variable}
+% {
+% \l_@@_supv_dept_str,
+% \l_@@_supv_sch_str,
+% \l_@@_class_id_str
+% }
+% 院内导师姓名。
+% \begin{macrocode}
+\str_new:N \l_@@_supv_dept_str
+% \end{macrocode}
+% 校内导师姓名。
+% \begin{macrocode}
+\str_new:N \l_@@_supv_sch_str
+% \end{macrocode}
+% 作者班级号。
+% \begin{macrocode}
+\str_new:N \l_@@_class_id_str
+% \end{macrocode}
+% \end{variable}
+% \begin{macro}{\keys_define:nn}
+% 定义信息键值。
+% \begin{macrocode}
+\keys_define:nn { xdu / info }
+ {
+% \end{macrocode}
+% 院内导师姓名。
+% \begin{macrocode}
+ supervisor-department .tl_set:N = \l_@@_supv_dept_str,
+% \end{macrocode}
+% 校内导师姓名。
+% \begin{macrocode}
+ supervisor-school .tl_set:N = \l_@@_supv_sch_str,
+% \end{macrocode}
+% 作者班级号。
+% \begin{macrocode}
+ class-id .tl_set:N = \l_@@_class_id_str
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\keys_set:nn}
+% 初始设置。
+% \begin{macrocode}
+\keys_set:nn { xdu }
+ {
+ info / supervisor-department = { },
+ info / supervisor-school = { },
+ info / class-id = { }
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</xduugthesis>
+%<*xdupgthesis>
+% \end{macrocode}
+% \subsubsection{研究生}
+% \begin{variable}
+% {
+% \l_@@_gr_type_tl
+% }
+% 研究生类型。
+% \begin{macrocode}
+\tl_new:N \l_@@_gr_type_tl
+% \end{macrocode}
+% \end{variable}
+% \begin{macro}{\keys_define:nn}
+% 定义信息键值。
+% \begin{macrocode}
+\keys_define:nn { xdu / info }
+ {
+% \end{macrocode}
+% 研究生类型。
+% \begin{macrocode}
+ graduate-type .choices:nn = { master, doctor }
+ { \tl_set_eq:NN \l_@@_gr_type_tl \l_keys_choice_tl }
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\keys_set:nn}
+% \changes{v1.7.1.0}{2022/05/02}{设置研究生类型默认值}
+% \changes{v1.7.2.0}{2022/05/02}{修正guard}
+% 初始设置。
+% \begin{macrocode}
+\keys_set:nn { xdu }
+ {
+ info / graduate-type = { master },
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</xdupgthesis>
+% \end{macrocode}
% \subsection{样式配置}
% \begin{variable}
% {
@@ -1940,7 +2050,7 @@
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
-%</xduugthesis>
+%</thesis>
% \end{macrocode}
% \begin{macrocode}
%<*class|xdufont>
@@ -1971,7 +2081,39 @@
% \end{macro}
% \begin{macrocode}
%</class|xdufont>
-%<*xduugthesis>
+%<*xdupgthesis>
+% \end{macrocode}
+% \subsection{内部文本}
+% \begin{variable}{l_@@_header_str}
+% \changes{v1.7.0.0}{2022/05/02}{研究生页眉文本}
+% 研究生页眉文本。
+% \begin{macrocode}
+\str_new:N \l_@@_header_str
+\ctex_at_end_preamble:n
+ {
+ \@@_lang_switch:nn
+ {
+ \tl_if_eq:NnTF \l_@@_gr_type_tl { master }
+ { \str_set:Nn \l_@@_header_str { 西安电子科技大学硕士学位论文 } }
+ { \str_set:Nn \l_@@_header_str { 西安电子科技大学博士学位论文 } }
+ }
+ {
+ \tl_if_eq:NnTF \l_@@_gr_type_tl { master }
+ {
+ \str_set:Nn \l_@@_header_str
+ { Master~Thesis~of~XIDIAN~UNIVERSITY }
+ }
+ {
+ \str_set:Nn \l_@@_header_str
+ { Doctoral~Dissertation~of~XIDIAN~UNIVERSITY }
+ }
+ }
+ }
+% \end{macrocode}
+% \end{variable}
+% \begin{macrocode}
+%</xdupgthesis>
+%<*thesis>
% \end{macrocode}
% \subsection{内部函数}
% \begin{macro}{\@@_lang_switch:nn}
@@ -2073,6 +2215,10 @@
% \end{macro}
% \begin{macro}{\@@_n_chapter_head_ii:nn}
% 新建无编号章节并添加页眉和书签并单独设置标题样式。
+% \begin{arguments}
+% \item 章节标题处。
+% \item 章节标题样式。
+% \end{arguments}
% \begin{macrocode}
\cs_new:Npn \@@_n_chapter_head_ii:nn #1#2
{
@@ -2099,6 +2245,24 @@
}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\@@_n_chapter_head_ii:nnn}
+% \changes{v1.2.1.0}{2022/04/19}{新建无编号章节并单独添加页眉和书签并单独设置标题样式}
+% 新建无编号章节并添加页眉和书签并单独设置标题样式,多用于章节标题为2个汉字的情况。
+% \begin{arguments}
+% \item 章节标题处。
+% \item 书签和页眉处。
+% \item 章节标题样式。
+% \end{arguments}
+% \begin{macrocode}
+\cs_new:Npn \@@_n_chapter_head_ii:nnn #1#2#3
+ {
+ {
+ \ctexset { chapter / format = { #3 } }
+ \@@_n_chapter_head:nn { #1 } { #2 }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\@@_n_chapter_head_toc:n}
% 新建无编号章节并添加目录及页眉。
% \begin{macrocode}
@@ -2155,10 +2319,17 @@
% \subsection{页面设置}
% \subsubsection{页面尺寸}
% \begin{macro}{\geometry,\newgeometry,\savegeometry}
-% 正文页面:上3厘米、下2厘米、内侧3厘米、外侧2厘米;装订线1厘米;页眉2厘米;页脚1厘米。
+% \changes{v1.5.1.0}{2022/05/01}{修正页脚高度}
+% \changes{v1.5.2.0}{2022/05/02}{修正底部页边距高度}
+% 正文页面。
+% \begin{description}
+% \item[本科生] 上3、下2、内3、外2;装订线1;页眉2、页脚1。
+% \item[研究生] 上3、\textbf{下2.5}、内2.5、外2.5;装订线0.5;页眉2、页脚$2.5-1.75=0.75$。
+% \end{description}
% \begin{macrocode}
\newgeometry
{
+%<*xduugthesis>
top = 3cm,
bottom = 2cm,
inner = 3cm,
@@ -2166,31 +2337,69 @@
bindingoffset = 1cm,
head = 2cm,
foot = 1cm
+%</xduugthesis>
+%<*xdupgthesis>
+ top = 3cm,
+ bottom = 2.5cm,
+ inner = 2.5cm,
+ outer = 2.5cm,
+ bindingoffset = 0.5cm,
+ head = 2cm,
+ foot = 0.75cm
+%</xdupgthesis>
}
\savegeometry { main }
% \end{macrocode}
-% 左右对称正文页面:上3厘米、下2厘米、内侧3厘米、外侧3厘米;页眉2厘米;页脚1厘米。
+% \changes{v1.5.1.0}{2022/05/01}{修正页脚高度}
+% \changes{v1.5.2.0}{2022/05/02}{修正底部页边距高度}
+% 左右对称正文页面。
+% \begin{description}
+% \item[本科生] 上3、下2、内3、外3;页眉2、页脚1。
+% \item[研究生] 上3、\textbf{下2.5}、内2.75、外2.75;页眉2、页脚$2.5-1.75=0.75$。
+% \end{description}
% \begin{macrocode}
\newgeometry
{
+%<*xduugthesis>
top = 3cm,
bottom = 2cm,
inner = 3cm,
outer = 3cm,
head = 2cm,
foot = 1cm
+%</xduugthesis>
+%<*xdupgthesis>
+ top = 3cm,
+ bottom = 2.5cm,
+ inner = 2.75cm,
+ outer = 2.75cm,
+ head = 2cm,
+ foot = 0.75cm
+%</xdupgthesis>
}
\savegeometry { main-sym }
% \end{macrocode}
-% 封面页面:上2.5厘米、下2厘米、内侧3厘米、外侧2厘米。
% \changes{v0.10.3.0}{2022/04/14}{修复封面超页}
+% 封面页面。
+% \begin{description}
+% \item[本科生] 上2.5、下2、内3、外2。
+% \item[研究生] 上3、下2、内3、外2.5。
+% \end{description}
% \begin{macrocode}
\newgeometry
{
+%<*xduugthesis>
top = 2.5cm,
bottom = 2cm,
inner = 3cm,
outer = 2cm
+%</xduugthesis>
+%<*xdupgthesis>
+ top = 3cm,
+ bottom = 2cm,
+ inner = 3cm,
+ outer = 2.5cm
+%</xdupgthesis>
}
\savegeometry { cover }
% \end{macrocode}
@@ -2208,6 +2417,41 @@
% \end{macrocode}
% \end{macro}
% \subsubsection{页眉页脚}
+% \begin{macro}
+% {
+% \@@_chinese:,
+% \@@_arabic:,
+% \@@_roman:,
+% \@@_Roman:,
+% \@@_alph:,
+% \@@_Alph:,
+% \@@_fnsymbol:
+% }
+% \changes{v1.2.2.0}{2022/04/20}{定义序号转换函数}
+% 定义序号转换函数。
+% \begin{macrocode}
+\clist_map_inline:nn
+ {
+ { chinese },
+ { arabic },
+ { roman },
+ { Roman },
+ { alph },
+ { Alph },
+ { fnsymbol }
+ }
+ { \cs_new_eq:cc { @@ _ #1 : } { #1 } }
+% \end{macrocode}
+% \end{macro}
+% \begin{variable}{\l_@@_chaptername}
+% \changes{v1.2.2.0}{2022/04/20}{页眉内部英文章节名}
+% 页眉内部英文章节名。
+% \begin{macrocode}
+\tl_set:Nn \chaptername { Chapter }
+\tl_new:N \l_@@_chaptername
+\tl_set_eq:NN \l_@@_chaptername \chaptername
+% \end{macrocode}
+% \end{variable}
% \begin{macro}{\chaptermark}
% 设置奇数页页眉为章标题。
% \begin{macrocode}
@@ -2217,7 +2461,7 @@
{
\@@_lang_switch:nn
{ \CTEXthechapter }
- { \chaptername\space\Roman { chapter } }
+ { \l_@@_chaptername \space \@@_Roman: { chapter } }
\quad #1
}
{ }
@@ -2225,21 +2469,55 @@
% \end{macrocode}
% \end{macro}
% \begin{macro}{\fancypagestyle}
-% 设置正文页眉页脚。页眉:宋体五号,居中排列。左面页眉为论文题目,右面页眉为章次和章标题。页眉底划线的宽度为 0.75 磅。页码:宋体小五号,排在页眉行的最外侧,不加任何修饰。
% \changes{v0.1.1.0}{2022/04/03}{修正页眉字号}
+% \changes{v1.6.0.0}{2022/05/02}{设置页脚页码}
+% \changes{v1.7.0.0}{2022/05/02}{设置页眉}
+% 设置正文页眉页脚。
+% \begin{description}
+% \item[本科生] 页眉:宋体五号,居中排列。左面页眉为论文题目,右面页眉为章次和章标题。页眉底划线的宽度为0.75磅。页码:宋体小五号,排在页眉行的最外侧,不加任何修饰。
+% \item[研究生] 页眉设置:单面页码页眉标题为章节题目,每一章节的起始页必须在单面页码,双面页码页眉标题统一为“西安电子科技大学博/硕士学位论文”,页眉标题居中排列,字体为宋体,字号为五号。页眉文字下添加双横线,双横线宽度为0.5磅。页眉的“西安电子科技大学博士/硕士学位论文”统一翻译成:Doctoral Dissertation of XIDIAN UNIVERSITY/Master Thesis of XIDIAN UNIVERSITY。页码设置:前置部分的页码用罗马数字标识,字体为Times New Roman,字号为小五号;主体部分的页码用阿拉伯数字标识,字体为宋体,字号为小五号。页码统一居于页面底端中部,不加任何修饰。
+% \end{description}
% \begin{macrocode}
\fancypagestyle { plain }
{
\pagestyle { fancy }
\fancyhf { }
+%<*xduugthesis>
\fancyhead [ CE ] { \@@_rm_family: \zihao { 5 } \l_@@_pure_title_str }
\fancyhead [ CO ] { \@@_rm_family: \zihao { 5 } \leftmark }
\fancyhead [ LE ] { \@@_rm_family: \zihao { -5 } \thepage }
\fancyhead [ RO ] { \@@_rm_family: \zihao { -5 } \thepage }
\renewcommand { \headrulewidth } { 0.75pt }
+%</xduugthesis>
+%<*xdupgthesis>
+ \fancyhead [ CE ] { \@@_rm_family: \zihao { 5 } \l_@@_header_str }
+ \fancyhead [ CO ] { \@@_rm_family: \zihao { 5 } \leftmark }
+ \fancyfoot [ CE ] { \@@_rm_family: \zihao { -5 } \thepage }
+ \fancyfoot [ CO ] { \@@_rm_family: \zihao { -5 } \thepage }
+ \cs_set:Npn \headrulewidth { 0.5pt }
+ \cs_set:Npn \headrule
+ {
+ \hrule \@height \headrulewidth
+ \skip_vertical:N \headrulewidth
+ \hrule \@height \headrulewidth
+ \skip_vertical:N -\headrulewidth
+ }
+%</xdupgthesis>
+ }
+%<*xdupgthesis>
+\fancypagestyle { front }
+ {
+ \pagestyle { plain }
+ \fancyfoot [ CE ] { \rmfamily \zihao { -5 } \thepage }
+ \fancyfoot [ CO ] { \rmfamily \zihao { -5 } \thepage }
}
+%</xdupgthesis>
% \end{macrocode}
% \end{macro}
+% \begin{macrocode}
+%</thesis>
+%<*xduugthesis>
+% \end{macrocode}
% \subsection{标题设置}
% 中文章标题黑体,三号,居中排列。节标题宋体,四号,居中排列。英文一级标题字体为Times New Roman,四号,正体,左对齐,以大写罗马数字(I、II 等)标出序号。其余各级标题的字体均为Times New Roman,小四号,正体。二级及以下级别的标题依次缩进4个英文字符,以1.1,1.2,1.1.1,1.1.2形式标出序号。
% \subsubsection{章节层次}
@@ -2257,7 +2535,7 @@
{
chapter / name =
{
- \@@_lang_switch:nn { 第 } { \chaptername\space },
+ \@@_lang_switch:nn { 第 } { \l_@@_chaptername \space },
\@@_lang_switch:nn { 章 } { }
},
section / name = { },
@@ -2270,21 +2548,34 @@
% \end{macro}
% \subsubsection{章节编号}
% \begin{macro}{\ctexset}
+% \changes{v1.2.1.0}{2022/04/19}{修正英文论文标题序号}
% 设置章节编号的数字输出格式。
% \begin{macrocode}
-\ctexset
+\ctex_at_end_preamble:n
{
- chapter / number =
+ \@@_lang_switch:nn
{
- \@@_lang_switch:nn
- { \chinese { chapter } }
- { \Roman { chapter } }
- },
- section / number = { \thesection },
- subsection / number = { \thesubsection },
- subsubsection / number = { \thesubsubsection },
- paragraph / number = { \theparagraph },
- subparagraph / number = { \thesubparagraph }
+ \ctexset
+ {
+ chapter / number = { \chinese { chapter } },
+ section / number = { \thesection },
+ subsection / number = { \thesubsection },
+ subsubsection / number = { \thesubsubsection },
+ paragraph / number = { \theparagraph },
+ subparagraph / number = { \thesubparagraph }
+ }
+ }
+ {
+ \ctexset
+ {
+ chapter / number = { \Roman { chapter } },
+ section / number = { \thesection },
+ subsection / number = { \thesubsection },
+ subsubsection / number = { ( \roman { subsubsection } ) },
+ paragraph / number = { ( \alph { paragraph } ) },
+ subparagraph / number = { ( \arabic { subparagraph } ) }
+ }
+ }
}
% \end{macrocode}
% \end{macro}
@@ -2307,15 +2598,23 @@
}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\@@_en_t:nnn}
+% \changes{v1.2.1.0}{2022/04/19}{英文章节样式增加位置参数}
% 设置英文章节名字和随后的标题内容格式。
-% \begin{macro}{\@@_en_t:nn}
% \begin{arguments}
% \item 字号。
-% \item 偏移量。
+% \item 位置。
% \end{arguments}
% \begin{macrocode}
\cs_new:Npn \@@_en_t:nn #1#2
- { \zihao { \use:c { l_@@_ #1 _tl } } \raggedright \skip_horizontal:n { #2 ex } }
+ {
+ \rmfamily
+ \zihao { \use:c { l_@@_ #1 _tl } }
+ \bfseries
+ \str_if_eq:ccTF { #2 } { c }
+ { \centering }
+ { \raggedright }
+ }
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ctexset}
@@ -2326,12 +2625,12 @@
{
\@@_lang_switch:nn
{
- \@@_tl_set_if_empty:Nn \l_@@_chap_tl { 3 }
- \@@_tl_set_if_empty:Nn \l_@@_sec_tl { 4 }
- \@@_tl_set_if_empty:Nn \l_@@_subsec_tl { 4 }
- \@@_tl_set_if_empty:Nn \l_@@_subsubsec_tl { 4 }
- \@@_tl_set_if_empty:Nn \l_@@_para_tl { 4 }
- \@@_tl_set_if_empty:Nn \l_@@_subpara_tl { 4 }
+ \@@_tl_set_if_empty:Nn \l_@@_chap_tl { 3 }
+ \@@_tl_set_if_empty:Nn \l_@@_sec_tl { 4 }
+ \@@_tl_set_if_empty:Nn \l_@@_subsec_tl { 4 }
+ \@@_tl_set_if_empty:Nn \l_@@_subsubsec_tl { 4 }
+ \@@_tl_set_if_empty:Nn \l_@@_para_tl { 4 }
+ \@@_tl_set_if_empty:Nn \l_@@_subpara_tl { 4 }
\ctexset
{
chapter / format = { \@@_zh_t:nnn { sf } { chap } { c } },
@@ -2343,20 +2642,20 @@
}
}
{
- \@@_tl_set_if_empty:Nn \l_@@_chap_tl { 4 }
- \@@_tl_set_if_empty:Nn \l_@@_sec_tl { -4 }
+ \@@_tl_set_if_empty:Nn \l_@@_chap_tl { 3 }
+ \@@_tl_set_if_empty:Nn \l_@@_sec_tl { 4 }
\@@_tl_set_if_empty:Nn \l_@@_subsec_tl { -4 }
\@@_tl_set_if_empty:Nn \l_@@_subsubsec_tl { -4 }
\@@_tl_set_if_empty:Nn \l_@@_para_tl { -4 }
\@@_tl_set_if_empty:Nn \l_@@_subpara_tl { -4 }
\ctexset
{
- chapter / format = { \@@_en_t:nn { chap } { 0 } },
- section / format = { \@@_en_t:nn { sec } { 4 } },
- subsection / format = { \@@_en_t:nn { subsec } { 8 } },
- subsubsection / format = { \@@_en_t:nn { subsubsec } { 12 } },
- paragraph / format = { \@@_en_t:nn { para } { 16 } },
- subparagraph / format = { \@@_en_t:nn { subpara } { 20 } }
+ chapter / format = { \@@_en_t:nn { chap } { c } },
+ section / format = { \@@_en_t:nn { sec } { l } },
+ subsection / format = { \@@_en_t:nn { subsec } { l } },
+ subsubsection / format = { \@@_en_t:nn { subsubsec } { l } },
+ paragraph / format = { \@@_en_t:nn { para } { l } },
+ subparagraph / format = { \@@_en_t:nn { subpara } { l } }
}
}
}
@@ -2628,6 +2927,25 @@
}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{longtable}
+% \changes{v1.3.0.0}{2022/04/20}{设置\envx{longtable}环境字号是否为五号}
+% 设置\envx{longtable}环境字号是否为五号。
+% \begin{macrocode}
+\ctex_at_end_preamble:n
+ {
+ \@ifpackageloaded { longtable }
+ {
+ \bool_if:NT \l_@@_tab_small_bool
+ {
+ \ctex_gadd_ltxhook:nn
+ { env/longtable/begin }
+ { \small }
+ }
+ }
+ { }
+ }
+% \end{macrocode}
+% \end{macro}
% \subsection{超链接和PDF元数据}
% \begin{macro}{\hyperref}
% 配置超链接和PDF元数据。
@@ -2712,10 +3030,14 @@
% \changes{v0.3.1.0}{2022/04/04}{修正附录中图表编号样式}
% \changes{v0.10.2.0}{2022/04/14}{修正附录中算法编号样式}
% \changes{v0.10.4.0}{2022/04/14}{修正附录中\pkgx{algorithm2e}算法编号样式}
+% \changes{v1.2.2.0}{2022/04/20}{修正英文附录编号}
% \begin{macrocode}
\RequirePackage { environ }
\NewEnviron { appendixes }
{
+ \cs_set:Npn \appendixname { \@@_lang_switch:nn { 附录 } { Appendix } }
+ \tl_set_eq:NN \l_@@_chaptername \appendixname
+ \cs_set_eq:NN \@@_Roman: \@@_Alph:
\appendix
\renewcommand { \thefigure } { \thechapter \arabic { figure } }
\renewcommand { \thetable } { \thechapter \arabic { table } }
@@ -2728,6 +3050,7 @@
% \end{macrocode}
% \end{macro}
% \subsection{封面}
+% \subsubsection{本科生}
% \begin{macro}{\@@_cover_i:nn}
% 绘制班级和学号。
% \begin{arguments}
@@ -2872,7 +3195,7 @@
% \begin{macro}{\frontmatter}
% 排版正文前部分。
% \begin{macrocode}
-\renewcommand{\frontmatter}
+\renewcommand { \frontmatter }
{
\loadgeometry { cover }
\pagestyle { empty }
@@ -2949,13 +3272,19 @@
\pagestyle { plain }
\pagenumbering { Roman }
% \end{macrocode}
+% \changes{v1.2.1.0}{2022/04/19}{修正英文论文下中文摘要标题样式}
% 中文摘要,宋体小四号。
% \begin{macrocode}
- \@@_n_chapter_head:nn
- { 摘要 }
- { 摘 { \quad } 要 }
+ \@@_lang_switch:nn
+ { \@@_n_chapter_head:nn { 摘要 } { 摘 { \quad } 要 } }
+ {
+ \@@_n_chapter_head_ii:nnn
+ { 摘要 }
+ { 摘 { \quad } 要 }
+ { \@@_sf_family: \zihao { 3 } \centering }
+ }
{
- \dim_set:Nn \parindent { 2\ccwd }
+ \dim_set:Nn \parindent { 2 \ccwd }
\rmfamily \zihao { -4 }
\file_if_exist_input:n { \l_@@_abstract_zh_tl }
}
@@ -2971,9 +3300,9 @@
% 英文摘要,Times New Roman字体,小四号。
% \changes{v0.4.3.0}{2022/04/05}{修正英文摘要标题字体}
% \begin{macrocode}
- \@@_n_chapter_head_ii:nn {ABSTRACT} { \rmfamily \zihao{3} \bfseries \centering }
+ \@@_n_chapter_head_ii:nn {ABSTRACT} { \rmfamily \zihao { 3 } \bfseries \centering }
{
- \dim_set:Nn \parindent { 2\ccwd }
+ \dim_set:Nn \parindent { 2 \ccwd }
\rmfamily \zihao { -4 }
\file_if_exist_input:n { \l_@@_abstract_en_tl }
}
@@ -2999,17 +3328,42 @@
}
% \end{macrocode}
% \end{macro}
+% \begin{macrocode}
+%</xduugthesis>
+%<*xdupgthesis>
+% \end{macrocode}
+% \subsubsection{研究生}
+% \begin{macro}{\frontmatter}
+% \changes{v1.5.0.0}{2022/05/01}{设置封面页边距}
+% \changes{v1.6.0.0}{2022/05/02}{设置页脚页码}
+% 排版正文前部分。
+% \begin{macrocode}
+\renewcommand { \frontmatter }
+ {
+ \loadgeometry { cover }
+ \pagestyle { empty }
+ \@@_load_main_geometry:
+ \pagestyle { front }
+ \pagenumbering { Roman }
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</xdupgthesis>
+%<*xduugthesis>
+% \end{macrocode}
% \subsection{正文}
+% \subsubsection{本科生}
% \begin{macro}{\mainmatter}
% \changes{v0.8.0.0}{2022/04/12}{支持对称页边距}
% 排版正文部分。
% \begin{macrocode}
-\renewcommand{\mainmatter}
+\renewcommand { \mainmatter }
{
\@@_load_main_geometry:
\pagestyle { plain }
\pagenumbering { arabic }
- \dim_set:Nn \parindent { 2\ccwd }
+ \dim_set:Nn \parindent { 2 \ccwd }
\rmfamily \zihao { -4 }
}
% \end{macrocode}
@@ -3017,7 +3371,7 @@
% \begin{macro}{\backmatter}
% 排版正文后部分。
% \begin{macrocode}
-\renewcommand{\backmatter}
+\renewcommand { \backmatter }
{
% \end{macrocode}
% \changes{v1.1.4.0}{2022/04/16}{为致谢章节标题增加间距}
@@ -3027,7 +3381,7 @@
{ \@@_lang_switch:nn { 致谢 } { Acknowledgements } }
{ \@@_lang_switch:nn { 致 { \quad } 谢 } { Acknowledgements } }
{
- \dim_set:Nn \parindent { 2\ccwd }
+ \dim_set:Nn \parindent { 2 \ccwd }
\rmfamily \zihao { -4 }
\file_if_exist_input:n { \l_@@_ack_tl }
}
@@ -3035,16 +3389,21 @@
% 参考文献。
% \changes{v0.2.1.0}{2022/04/04}{参考文献添加至目录}
% \changes{v0.5.2.0}{2022/04/07}{修正参考文献列表字体字号}
+% \changes{v1.3.1.0}{2022/04/21}{修复参考文献列表字体字号}
+% \changes{v1.4.1.0}{2022/04/27}{修复bibtex产生的多余参考文献列表章节}
% \begin{macrocode}
- \@@_add_toc:n { \@@_lang_switch:nn { 参考文献 } { Bibliography } }
+ \cs_set:Npn \bibname { \@@_lang_switch:nn { 参考文献 } { Bibliography } }
+ \@@_n_chapter_head_toc:n { \bibname }
{
\tl_if_eq:NnTF \l_@@_bib_tool_tl { bibtex }
{
+ \cs_set:Npn \bibsection { }
\@@_rm_family: \zihao { 5 }
\bibliography { \l_@@_bib_file_clist }
}
{
- \renewcommand { \bibfont } { \@@_rm_family: \zihao { 5 } }
+ \defbibheading { bibliography } [ ] { }
+ \cs_set:Npn \bibfont { \@@_rm_family: \zihao { 5 } }
\printbibliography
}
}
@@ -3055,6 +3414,26 @@
%</xduugthesis>
% \end{macrocode}
% \begin{macrocode}
+%<*xdupgthesis>
+% \end{macrocode}
+% \subsubsection{研究生}
+% \begin{macro}{\mainmatter}
+% \changes{v1.5.0.0}{2022/05/01}{设置正文页边距}
+% \changes{v1.6.0.0}{2022/05/02}{设置页脚页码}
+% 排版正文部分。
+% \begin{macrocode}
+\renewcommand { \mainmatter }
+ {
+ \@@_load_main_geometry:
+ \pagestyle { plain }
+ \pagenumbering { arabic }
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%</xdupgthesis>
+% \end{macrocode}
+% \begin{macrocode}
%<@@=>
% \end{macrocode}
% \Finale