summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/bithesis/bithesis.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/bithesis/bithesis.dtx')
-rw-r--r--Master/texmf-dist/source/latex/bithesis/bithesis.dtx132
1 files changed, 129 insertions, 3 deletions
diff --git a/Master/texmf-dist/source/latex/bithesis/bithesis.dtx b/Master/texmf-dist/source/latex/bithesis/bithesis.dtx
index ffad61b11d4..cfbdbb5aa8d 100644
--- a/Master/texmf-dist/source/latex/bithesis/bithesis.dtx
+++ b/Master/texmf-dist/source/latex/bithesis/bithesis.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2022
+% Copyright (C) 2023
% Association of Bit Network Pioneer and any individual authors listed elsewhere in this file.
% -----------------------------------
%
@@ -21,7 +21,7 @@
%<thesis>\ProvidesExplClass{bithesis}
%<report>\ProvidesExplClass{bitreport}
%<beamer>\ProvidesExplClass{bitbeamer}
-%<cls>{2022-12-30}{3.2.3}{BIT Thesis Templates}
+%<cls>{2023-02-02}{3.3.0}{BIT Thesis Templates}
%
%<oldcls>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
%<book>\ProvidesClass{bitbook}
@@ -30,7 +30,7 @@
%<oldcls> [2022/05/09 v2.1.1 BIT Thesis Templates]
%
%<*driver>
-\ProvidesFile{bithesis.dtx}[2022/12/30 3.2.3 BIT Thesis Templates]
+\ProvidesFile{bithesis.dtx}[2023/02/02 3.3.0 BIT Thesis Templates]
\documentclass[letterpaper]{l3doc}
\usepackage{dtx-style}
@@ -297,6 +297,21 @@
% 需要注意的是,Github 和 Overleaf 的模板中包含了当前版本的 |*.cls| 文件,
% 因此不会因为 CTAN 上的更新而导致模板无法编译。(但代价当然是需要手动升级)
%
+% \subsection{版本号与升级}
+%
+% \BIThesisLaTeX 的版本号遵循 \href{https://semver.org/lang/zh-CN/}{语义化版本},
+% 也就是说,每个版本号由三个数字组成,分别表示主版本号、次版本号和修订号。
+% 例如,版本号 |1.2.3| 表示主版本号为 1,次版本号为 2,修订号为 3。
+%
+% \BIThesisLaTeX 的主版本号会在有重大变化时(且无法前向兼容时)更新,
+% 例如,模板的结构发生了变化、宏命令的使用方式发生了改变。
+% 次版本号会在有新功能添加时更新,例如,添加了新的功能和宏命令。
+% 修订号会在有 bug 修复时更新,例如,修复了某些宏命令的 bug、补充了某些文档。
+%
+% 因此对于用户来说,主版本号的更新是不兼容的,次版本号与修订号的更新是向前兼容的。
+% 进行兼容性升级时,你只需要将新版本的 |*.cls| 文件替换到你原有模板的工作目录中即可。
+% 进行不兼容性升级时,你需要将旧模板中的写作内容复制到新模板中(记得要做好备份哦)。
+%
% \section{安装}
%
% \subsection{\BIThesis 宏包的安装和更新}
@@ -460,6 +475,29 @@
% 此选项用于输出符合盲审要求的论文。所有可能暴露个人信息的页面都将隐藏,
% 比如封面、信息页、原创性声明、个人简介、致谢等等。
% \end{function}
+%
+% \begin{function}[added=2023-02-02]{quirks}
+% \begin{bitsyntax}[emph={[1]quirks}]
+% quirks = (*<(false)|true>*)
+% \end{bitsyntax}
+%
+% 此选项用于开启针对北理工官方示例的兼容模式。
+%
+% 具体包括:
+% \begin{itemize}
+% \item \pkg{biblatex} 中的 |patent| 类型将不再采用国标 GB/T 7714-2015 的格式,
+% 而是采用北理工官方示例的格式。
+% \end{itemize}
+%
+% 之所以需要此选项,是因为北理工官方示例中的格式
+% 与国标 GB/T 7714-2015 中的格式不一致;
+% 而这部分改动可能引入潜在的兼容性问题。
+% 而这些差异其实比较细微,所以我们将其作为一个默认不开启的选项。
+%
+% 在未来,如果持续有用户反馈问题,亦或是没有边界问题,
+% 我们可能会将其中的功能移入默认效果中。
+%
+% \end{function}
%
% \begin{function}{twoside}
% \begin{bitsyntax}[emph={[1]twoside}]
@@ -1658,6 +1696,17 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{variable}{\g_@@_quirks_mode_bool}
+% 是否兼容更符合北理工官方模板或规范,但不太符合一般排版要求的模式。默认为 false。
+% 目前此选项包括:
+% \begin{itemize}
+% \item \pkg{biblatex} 的专利格式不再使用国标格式,而采用北理工自定义格式。
+% \end{itemize}
+% \begin{macrocode}
+\bool_new:N \g_@@_quirks_mode_bool
+% \end{macrocode}
+% \end{variable}
+%
% \begin{variable}{\g_@@_label_divide_char_tl}
% 用于分隔标签的字符。默认为「-」或者「.」。
% \begin{macrocode}
@@ -2012,6 +2061,7 @@
twoside .bool_gset:N = \g_@@_twoside_bool,
blindPeerReview .bool_gset:N = \g_@@_blind_mode_bool,
ctex .tl_set:N = \l_@@_options_to_ctex_tl,
+ quirks .bool_gset:N = \g_@@_quirks_mode_bool,
}
% \end{macrocode}
%
@@ -2336,6 +2386,82 @@
\cs_if_exist:NT \DeclareBibliographyCategory {
\DeclareBibliographyCategory{mypub}
}
+
+ % 修改 biblatex 中「专利」(patent)部分的著录格式。
+ % 主要根据北理工自定义的规范,参考 biblatex 和
+ % biblatex-gb7714-2015 的实现修改而成。
+ %
+ % 默认不开启,因为此修改可能会产生其他边界问题。
+ \bool_if:NT \g_@@_quirks_mode_bool {
+ \cs_if_exist:NT \DeclareBibliographyDriver {
+ %
+ % 重设专利title的输出,将文献类型标识符输出出去
+ %
+ \newbibmacro*{patenttitle}{%原输出来自biblatex.def文件
+ \ifboolexpr{%
+ test{\iffieldundef{title}}%
+ and%
+ test{\iffieldundef{subtitle}}%
+ }%
+ {}%
+ {\printtext[title]{\bibtitlefont%
+ \printfield[titlecase]{title}%
+ \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题
+ {}{\setunit{\subtitlepunct}%
+ \printfield[titlecase]{subtitle}}%
+ \iftoggle{bbx:gbtype}{\printfield[gbtypeflag]{usera}}{}%
+ \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格
+ {\setunit{\subtitlepunct}\printfield{titleaddon}}%
+ % :地区
+ \setunit{\subtitlepunct}\iflistundef{location}
+ {}
+ {\setunit*{\subtitlepunct}%
+ \printtext{%[parens]
+ \printlist[][-\value{listtotal}]{location}}}%
+ % ,专利号
+ \setunit{\addcomma\addspace}\printfield{number}%写专利号
+ \setunit{\addcomma\addspace}
+ \usebibmacro{newsdate}%
+ }%
+ }%
+ }
+
+ %
+ % 重定义专利文献驱动
+ %
+ \DeclareBibliographyDriver{patent}{%源来自standard.BBX
+ \usebibmacro{bibindex}%
+ \usebibmacro{begentry}%
+ \usebibmacro{author}%
+ \ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
+ \usebibmacro{patenttitle}%给出专利专用的标题输出
+ \iftoggle{bbx:gbstrict}{}{%
+ \newunit%
+ \printlist{language}%
+ \newunit\newblock
+ \usebibmacro{byauthor}
+ }%
+ \newunit\newblock
+ \printfield{type}%
+ \setunit*{\addspace}%
+ \newunit\newblock
+ \usebibmacro{byholder}%
+ \newunit\newblock
+ \printfield{note}%
+ \newunit\newblock
+ \usebibmacro{doi+eprint+url}%
+ \newunit\newblock
+ \usebibmacro{addendum+pubstate}%
+ \setunit{\bibpagerefpunct}\newblock
+ \usebibmacro{pageref}%
+ \newunit\newblock
+ \iftoggle{bbx:related}
+ {\usebibmacro{related:init}%
+ \usebibmacro{related}}
+ {}%
+ \usebibmacro{annotation}\usebibmacro{finentry}}
+ }
+ }
}
% \end{macrocode}
%