summaryrefslogtreecommitdiff
path: root/macros/unicodetex/latex/nwafuthesis/nwafuthesis.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/unicodetex/latex/nwafuthesis/nwafuthesis.dtx')
-rw-r--r--macros/unicodetex/latex/nwafuthesis/nwafuthesis.dtx222
1 files changed, 162 insertions, 60 deletions
diff --git a/macros/unicodetex/latex/nwafuthesis/nwafuthesis.dtx b/macros/unicodetex/latex/nwafuthesis/nwafuthesis.dtx
index 37bb596074..100a1cc039 100644
--- a/macros/unicodetex/latex/nwafuthesis/nwafuthesis.dtx
+++ b/macros/unicodetex/latex/nwafuthesis/nwafuthesis.dtx
@@ -110,7 +110,7 @@
%<class|doc>\NeedsTeXFormat{LaTeX2e}
%<class|doc>\RequirePackage{expl3}
%<*!(driver|install)>
-%<!readme>\GetIdInfo $Id: nwafuthesis.dtx 1.10 2022-03-17 Nan Geng <nangeng@nwafu.edu.cn> $
+%<!readme>\GetIdInfo $Id: nwafuthesis.dtx 1.11 2022-04-03 Nan Geng <nangeng@nwafu.edu.cn> $
%<class> {Thesis template for Northwest A\&F University}
%<class>\ProvidesExplClass{\ExplFileName}
%<definition> {Definition file for nwafuthesis}
@@ -143,7 +143,7 @@
\textbf{\nwafuthesis: 西北农林科技大学学位论文
\xpinyin[font=\sffamily,format=\color{MaterialIndigo800}]{模}{mu2}板}}}
\author{耿楠}
-\date{\today\quad v1.10%
+\date{\today\quad v1.11%
\thanks{\url{https://gitee.com/nwafu_nan/nwafuthesis-l3}.}}
\begin{document}
@@ -242,9 +242,9 @@
%
% \subsection*{\LaTeX{} 入门}
%
-% 本文档并非是一份 \LaTeX{} 零基础教程。如果是完完全全的新手,
+% 本文档并非一份 \LaTeX{} 零基础教程。如果是完完全全的新手,
% 建议先阅读相关入门文档,如刘海洋编著的《\LaTeX{} 入门》
-% \scite{刘海洋2013latex入门} 第一章,或大名鼎鼎的“\pkg{lshort}”
+% \scite{刘海洋2013latex入门} ,或大名鼎鼎的“\pkg{lshort}”
% \scite{lshort} 及其中文翻译版 \scite{lshort-zh-cn}。当然,
% 网络上诸如耿楠录制的\LaTeX{}教学系列视频等入门教程多如牛毛,
% 可以自行选取学习。
@@ -254,22 +254,47 @@
% 本文采用不同字体表示不同内容。无衬线字体表示宏包名称,如
% \pkg{xeCJK} 宏包、\cls{nwafuthesis} 文档类等;等宽字体表示代码或
% 文件名,如 \cs{nwafuset} 命令、\env{abstract} 环境、\TeX{} 文档
-% \file{thesis.tex} 等;带有尖括号的楷体(或西文斜体)表示命令参数,
-% 如 \meta{模板选项}、\meta{English title} 等。在使用时,不必输入参数两侧
+% \file{main.tex} 等;带有尖括号的楷体(或西文斜体)表示命令参数,
+% 如 \meta{模板选项}、\meta{English title} 等。使用时,不必输入参数两侧
% 的尖括号。示例代码进行了语法高亮处理,以方便阅读。
%
% 在用户手册中,带有蓝色侧边线的为 \LaTeX{} 代码,而带有粉色侧边线
-% 的则为电脑命令行代码,请注意区分。模板提供的选项、命令、环境等,
-% 均用横线框起,同时给出使用语法和相关说明。
-%
-% 手册中的代码实现部分主要面向对 \LaTeX{} 宏包开发感兴趣的用户。
-% 如果有任何改进意见或者功能需求,欢迎前往 Gitee 仓库提交issue。
+% 的则为命令行代码,请注意区分。模板提供的选项、命令、环境等,
+% 均用横线框起,同时给出语法和相关说明。
%
+% 手册中代码实现部分主要面向对 \LaTeX{} 模板开发感兴趣的用户。
% 文档的最后还提供了版本历史和代码索引,以供查阅。
%
% \section{安装}
%
-% \changes{v1.00}{2021/08/05}{修改安装说明,提交ctan。}
+% \subsection{模板工作流}
+%
+% 使用{\nwafuthesis}模板排版学位论文的工作流如图\ref{fig:workflow}所示。
+%
+% \begin{figure}[!htb]
+% \centering
+% \includegraphics[width=0.85\textwidth]{logo/workflow}
+% \caption{模板工作流}
+% \label{fig:workflow}
+% \end{figure}
+%
+% 作为普通用户,仅需要通过{\LaTeX}发行版安装和更新模板,完成安装后,即可使用%
+% \verb|\documentclass{nwafuthesis}|载入该模板进行工作了。作为普通用户,
+% 强烈建议只关心学位论文内容,通过与导师的反复沟通修改与完善论文内容即可。
+% 关于学位论文排版格式问题应该交由开发者根据根据相关学校%
+% \emph{指南/规范}进行设计和调整。开发者完成模板开发及功能完善后,会上传到
+% CTAN(\url{www.ctan.org}),然后模板会被部署于{\LaTeX}发行版,此时普通
+% 用户仅需要通过{\LaTeX}发行版的管理工具更新模板即可得到更新后的模板,
+% 模板更新再次编译学位论文即可按最新的格式要求完成排版。
+%
+% 关于{\nwafuthesis}模板的使用的详细说明,一方面可以通过阅读其使用说明书和
+% 写作样例进行学习,另一方面也可以参阅耿楠在B站发布的教学视频%
+% \url{https://www.bilibili.com/video/BV1tY4y1q7RT#reply107826496032}进行学习。
+%
+% 如果有任何改进意见或者功能需求,欢迎前往 Gitee 仓库提交issue。
+% {\nwafuthesis}模板的源代码托管于\url{https://gitee.com/nwafu_nan/nwafuthesis-l3},
+% 欢迎大家多提 issue/PR,以便进一步完善和美化我校学位论文\LaTeX{}模板。
+%
% \subsection{获取 \cls{nwafuthesis}}
%
% \subsubsection{标准安装}
@@ -1330,6 +1355,13 @@
% \cs{dateen} 命令用于输出英文格式的当前月,年。
% \end{function}
%
+% \begin{function}[added=2022-04-04]{\fakebold}
+% \begin{nwafusyntax}[deletetexcs={\fakebold},morekeywords={\fakebold}]
+% \fakebold(*\oarg{加粗系数}\marg{文字内容}*)
+% \end{nwafusyntax}
+% 使用PDF literal通过缩放笔画实现的伪粗命令。
+% \end{function}
+%
% \begin{function}[added=2021-05-12,updated=2021-5-28]{\makecoveri,
% \makecoverii,\makecoveriii, \makecoveriv,
% \makecoverv,\makecovervi,\makecovervii}
@@ -1394,17 +1426,6 @@
% \cs{makefront}命令自动排版。
% \end{function}
%
-% \begin{function}[added=2021-05-29]{\frontmatter,\frontmatter*}
-% \begin{nwafusyntax}[deletetexcs={\frontmatter,\frontmatter*},
-% morekeywords={\frontmatter,\frontmatter*}]
-% \frontmatter(*\oarg{编号格式|(Roman)}*)
-% \frontmatter*(*\oarg{编号格式|(Roman)}*)
-% \end{nwafusyntax}
-% \cs{frontmatter} 为前置区命令,章标题不编号,
-% 页码可设置为例如 \opt{roman}、\opt{Alph} 等格式,
-% 带有星号的命令 \cs{frontmatter*} 不使用清双页命令 \tn{cleardoublepage}。
-% \end{function}
-%
% \begin{function}[added=2021-05-12]{\cleardoublepage}
% \begin{nwafusyntax}[deletetexcs={\cleardoublepage},morekeywords={\cleardoublepage}]
% \cleardoublepage(*\oarg{页面风格|(empty)}*)
@@ -1628,6 +1649,8 @@
% marginpar = 2.25 in
% }
%
+% \changes{v1.11}{2022/04/03}{取消本科黑体加粗。}
+%
% \section{实现细节}
%
% 本模板使用 \LaTeX3 语法编写,依赖 \pkg{expl3} 环境,
@@ -1832,6 +1855,27 @@
% \end{macrocode}
% \end{macro}
%
+% \changes{v1.11}{2022/04/03}{添加PDF literal实现的伪粗命令。}
+%
+% \begin{macro}{\@@_fake_bold:nn,\fakebold}
+% 利用PDF literal实现的伪粗命令。
+% 参考\url{https://zhuanlan.zhihu.com/p/60262200}实现。
+% \#1 加粗系数
+% \#2 加粗内容
+% \begin{macrocode}
+\cs_new:Npn \@@_fake_bold:nn #1#2
+ {
+ \special{pdf:code~q~2~Tr~0~G~#1~w}%
+ #2%
+ \special{pdf:code~Q}%
+ }
+\NewDocumentCommand \fakebold {O{0.2} m }
+ {
+ \@@_fake_bold:nn { #1 }{ #2 }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \changes{v1.10}{2022/03/17}{统一使用 \LaTeX{} 2020/10/01 新钩子机制。}
%
% \begin{macro}{\@@_gadd_ltxhook:nn}
@@ -3432,6 +3476,8 @@
\pagestyle { fancy }
% \end{macrocode}
%
+% \changes{v1.11}{2022/04/02}{删除本科生目录页眉,并修正单面模式目录页眉。}
+%
% \begin{macro}{\frontmatter,\mainmatter}
% 重定义 \tn{frontmatter}和\tn{frontmatter},
% 以根据学校要求定制摘要、目录、主要符号对照表等前置部分的页眉页脚。
@@ -3457,13 +3503,13 @@
% \begin{macrocode}
\bool_if:NTF \g_@@_twoside_bool
{
-% \end{macrocode}
-% 奇数页页眉
-% \begin{macrocode}
- \nwafuhead[OC]{\small \nouppercase{ \leftmark } }
\int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 }
{
% \end{macrocode}
+% 研究生奇数页页眉
+% \begin{macrocode}
+ \nwafuhead[OC]{\small \nouppercase{ \leftmark } }
+% \end{macrocode}
% 研究生偶数页页眉
% \begin{macrocode}
\nwafuhead[EC]{\small \nouppercase{
@@ -3473,17 +3519,22 @@
}
}{
% \end{macrocode}
-% 本科生偶数页页眉
+% 本科生目录无页眉
% \begin{macrocode}
- \nwafuhead[EC]{\small \nouppercase{ \leftmark } }
+ \renewcommand{\headrulewidth}{0.0pt}
}
}{
% \end{macrocode}
-% 单面模式,奇偶页设成一样
+% 单面模式,研究生奇偶页设成一样,本科生无页眉
% \begin{macrocode}
- \nwafuhead [ C ]
+ \int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 }
{
- \small \nouppercase { \l_@@_header_center_mark_tl }
+ \nwafuhead [ C ]
+ {
+ \small \nouppercase { \l_@@_header_center_mark_tl }
+ }
+ }{
+ \renewcommand{\headrulewidth}{0.0pt}
}
}
\nwafufoot[C]{\small\thepage}
@@ -3525,12 +3576,14 @@
% \end{macrocode}
% 本科生偶数页页眉
% \begin{macrocode}
+ \renewcommand{\headrulewidth}{0.4pt}
\nwafuhead[EC]{\small \nouppercase{ \l__@@_info_title_tl } }
}
}{
% \end{macrocode}
% 单面模式
% \begin{macrocode}
+ \renewcommand{\headrulewidth}{0.4pt}
\nwafuhead [ C ]
{
\int_if_odd:nTF \c@page
@@ -3770,6 +3823,8 @@
%
% \subsection{章节标题设置}
%
+% \changes{v1.11}{2022/04/02}{修订本科生subsubsection编号两端括号为中文全角括号。}
+%
% |\keys_set:nn{ctex}| 实际相当于调用 \cs{ctexset}。
%
% 设置章(chapter)、节(section)与小节(sub-section)标题样式。
@@ -3832,7 +3887,7 @@
\bool_if:NT \l_@@_withchap_bool {章} },
number = \@@_arabic:n { chapter },
aftername = \hspace*{\ccwd},
- format = \zihao{3} \normalfont \nwafu@hei \bfseries \centering,
+ format = \zihao{3} \normalfont \nwafu@hei \centering,
beforeskip = 0.25\baselineskip,
afterskip = 0.65\baselineskip,
fixskip = true
@@ -3840,7 +3895,7 @@
section =
{
aftername = \hspace*{0.5\ccwd},
- format = \zihao{4} \normalfont \nwafu@hei \bfseries \raggedright,
+ format = \zihao{4} \normalfont \nwafu@hei \raggedright,
beforeskip = 0.60\baselineskip,
afterskip = 0.65\baselineskip,
fixskip = true,
@@ -3849,7 +3904,7 @@
subsection =
{
aftername = \hspace*{0.5\ccwd},
- format = \zihao{-4} \normalfont \nwafu@hei \bfseries,
+ format = \zihao{-4} \normalfont \nwafu@hei ,
beforeskip = 0.60\baselineskip,
afterskip = 0.65\baselineskip,
fixskip = true,
@@ -3858,8 +3913,8 @@
},
subsubsection =
{
- name = {(,)},
- aftername = \hspace*{0.5\ccwd},
+ name = {(,)},
+ aftername = \hspace*{0.0pt},
number = \@@_arabic:n { subsubsection },
format = \zihao{-4} \normalfont,
beforeskip = 0.60\baselineskip,
@@ -4394,8 +4449,8 @@
% \begin{macrocode}
\DeclareCaptionLabelSeparator{ccwd}{\hspace{0.5\ccwd}}
\DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{~}(#2)}
-\DeclareCaptionFont{nwafu@table@font}{\sffamily\small}
-\DeclareCaptionFont{nwafu@figure@font}{\sffamily\small}
+\DeclareCaptionFont{nwafu@table@font}{\nwafu@hei\small}
+\DeclareCaptionFont{nwafu@figure@font}{\nwafu@hei\small}
\DeclareCaptionFont{nwafu@subtable@font}{\small}
\DeclareCaptionFont{nwafu@subfigure@font}{\small}
% \end{macrocode}
@@ -5073,6 +5128,8 @@
% \end{macrocode}
% \end{macro}
%
+% \changes{v1.11}{2022/04/03}{利用PDF literal添加本科楷体伪粗。}
+%
% \begin{macro}{\@@_cover_type:}
% 论文类型。
% \begin{macrocode}
@@ -5097,13 +5154,20 @@
% \begin{macrocode}
\@@_get_text_width:NV \l__@@_tmpa_dim \l__@@_info_grade_tl
\@@_center_box:Vn \l__@@_tmpa_dim { \l__@@_info_grade_tl }
- \@@_spread_box:nn { 0.50 \textwidth }{
- 届
- \l_@@_tmpa_tl
% \end{macrocode}
-% 本科的论文或设计。
+% 利用PDF literal伪粗显示楷体。
% \begin{macrocode}
- \clist_item:Nn \c__@@_bachelor_type_clist { \l__@@_info_bachelor_type_int }
+ \@@_fake_bold:nn {0.20}
+ {
+ \@@_spread_box:nn { 0.50 \textwidth }
+ {
+ 届
+ \l_@@_tmpa_tl
+% \end{macrocode}
+% 本科的论文或设计选择。
+% \begin{macrocode}
+ \clist_item:Nn \c__@@_bachelor_type_clist { \l__@@_info_bachelor_type_int }
+ }
}
}
}
@@ -6162,13 +6226,12 @@
logo / bottom-skip = -30 pt,% plus 0.3 fill,
logo / align = center,
type / content = \@@_cover_type:,
- type / format = \bfseries\nwafu@kai\zihao { 1 },
+ type / format = \nwafu@kai\zihao { 1 },
type / bottom-skip = -20 pt plus 0.3 fill,
type / align = center,
- title / content =
- \@@_fixed_width_center_box:nn
- { 0.9 \textwidth } { \l_@@_info_title_tl },
- title / format = \nwafu@hei \bfseries\zihao { 2 },
+ title / content = \@@_fixed_width_center_box:nn
+ { 0.9 \textwidth } { \l_@@_info_title_tl },
+ title / format = \nwafu@hei \zihao { 2 },
title / bottom-skip = 80 pt plus 0.3 fill,
title / align = center,
info / content = \@@_cover_info:,
@@ -6510,6 +6573,8 @@
% \end{macrocode}
% \end{macro}
%
+% \changes{v1.11}{2022/04/02}{修复摘要后的所有页面尺寸。}
+%
% \begin{macro}{\makefront}
% 排版摘要、目录等前料。
% \begin{macrocode}
@@ -6518,6 +6583,18 @@
\int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 }
{
% \end{macrocode}
+% 恢复研究生页面尺寸
+% \begin{macrocode}
+ \newgeometry{
+ top = 3.1cm,
+ bottom = 3.3cm,
+ left = 2.6cm,
+ right = 2.6cm,
+ headheight = 0.8cm,
+ headsep = 0.7cm,
+ footskip = 1.4cm,
+ }
+% \end{macrocode}
% 研究生,\cs{frontmatter}命令用于设置页眉页脚,页码格式
% 并于奇数页起排。
% \begin{macrocode}
@@ -6549,7 +6626,6 @@
% \end{macrocode}
% 排版主要符号对照表,需要在奇数页起排。
% \begin{macrocode}
- % \frontmatter
\tl_if_empty:NF \l_@@_notation_file_tl
{
% \end{macrocode}
@@ -6561,6 +6637,18 @@
}
}{
% \end{macrocode}
+% 恢复本科生页面尺寸
+% \begin{macrocode}
+ \newgeometry{
+ top = 3.14cm,
+ bottom = 3.80cm,
+ left = 2.45cm,
+ right = 2.45cm,
+ headheight = 0.80cm,
+ headsep = 0.63cm,
+ footskip = 2.30cm,
+ }
+% \end{macrocode}
% 本科生,无页眉页脚
% \begin{macrocode}
\cleardoublepage
@@ -6680,7 +6768,7 @@
%
% 目录格式设置,研究生与本科生需设置不同参数
% \begin{macrocode}
-\tl_set:Nn \@@_toc_chapter_format_tl { \addvspace{1pt}\nwafu@hei \bfseries }
+\tl_set:Nn \@@_toc_chapter_format_tl { \addvspace{1pt}\nwafu@hei }
\tl_set:Nn \@@_toc_chapter_indent_tl {0pc}
\tl_set:Nn \@@_toc_chapter_rule_tl {\tocrule{$\cdot$}}
\tl_set:Nn \@@_toc_chapter_numsep_tl {0.5\ccwd}
@@ -6945,9 +7033,10 @@
\@@_chapter:V \c_@@_name_abstract_tl
}{
\par \mode_leave_vertical: \par
- \begin{center}\nwafu@hei\bfseries\zihao{3}\l_@@_info_title_tl\end{center}
+ \begin{center}\nwafu@hei\zihao{3}\l_@@_info_title_tl\end{center}
}
}
+\cs_set_eq:NN \my_uppercase:n \uppercase
\cs_new_protected:Npn \@@_abstract_en_begin:
{
\int_compare:nNnTF { \g_@@_thesis_type_int } < { 3 }
@@ -6955,7 +7044,10 @@
\@@_chapter:n \c_@@_name_abstract_en_tl
}{
\par \mode_leave_vertical: \par
- \begin{center}\bfseries\zihao{3}\l_@@_info_title_en_tl\end{center}
+ \begin{center}\bfseries\zihao{3}
+ % \exp_args:Nx \my_uppercase:n {\l_@@_info_title_en_tl}
+ \l_@@_info_title_en_tl
+ \end{center}
}
}
% \end{macrocode}
@@ -7157,7 +7249,14 @@
% \end{macrocode}
% 参考文献引用与著录样式。
% \begin{macrocode}
- \@@_pass_options_to_biblatex:n { style = gb7714-NWAFU }
+ \@@_pass_options_to_biblatex:n { style = gb7714-NWAFU,
+ sortlocale=zh__pinyin, gbtype=false,
+ maxbibnames=99, maxcitenames=2, mincitenames=1,
+ gbpub=false, uniquename=false, uniquelist=false,
+ gbnamefmt=lowercase,
+ doi=false, isbn=false,
+ gbfieldtype=true, gbpunctin=false,
+ }
% \end{macrocode}
% 其它参数。
% \begin{macrocode}
@@ -7214,6 +7313,8 @@
}
% \end{macrocode}
%
+% \changes{v1.11}{2022/04/02}{修订本科生enumerate编号两端括号为中文全角括号。}
+%
% \subsection{\env{enumerate}列表环境设置}
%
% \begin{macrocode}
@@ -7224,10 +7325,10 @@
{ bullet } { \textbullet },
{ endash } { \normalfont\bfseries\textendash },
{ asterisk } { \textasteriskcentered },
- { arabic } { (\arabic*) },
- { alph } { (\alph*) },
- { roman } { (\roman*) },
- { alph } { (\alph*) },
+ { arabic } { (\arabic*) },
+ { alph } { (\alph*) },
+ { roman } { (\roman*) },
+ { alph } { (\alph*) },
{ roman } { \roman*. },
{ outline } { \upshape\ding{111} }
}
@@ -7238,9 +7339,10 @@
\setlist
{
nosep,
- leftmargin = *,
+ leftmargin = *,
labelindent = \dimexpr\parindent+0pt\relax,
- wide=\parindent,
+ labelsep = 0pt,
+ wide = \parindent,
}
\setlist[itemize,1]{label = bullet}
\setlist[itemize,2]{label = endash}