texlive[60452] Master/texmf-dist: bithesis (8sep21)

commits+karl at tug.org commits+karl at tug.org
Wed Sep 8 22:41:35 CEST 2021


Revision: 60452
          http://tug.org/svn/texlive?view=revision&revision=60452
Author:   karl
Date:     2021-09-08 22:41:34 +0200 (Wed, 08 Sep 2021)
Log Message:
-----------
bithesis (8sep21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/bithesis/bithesis.pdf
    trunk/Master/texmf-dist/source/latex/bithesis/bithesis.dtx
    trunk/Master/texmf-dist/tex/latex/bithesis/bitart.cls
    trunk/Master/texmf-dist/tex/latex/bithesis/bitbook.cls

Modified: trunk/Master/texmf-dist/doc/latex/bithesis/bithesis.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/bithesis/bithesis.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/bithesis/bithesis.dtx	2021-09-08 02:37:35 UTC (rev 60451)
+++ trunk/Master/texmf-dist/source/latex/bithesis/bithesis.dtx	2021-09-08 20:41:34 UTC (rev 60452)
@@ -20,10 +20,10 @@
 %<cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<book>\ProvidesClass{bitbook}
 %<article>\ProvidesClass{bitart}
-%<cls> [2021/01/06 v1.0.1 BIT Thesis Templates]
+%<cls> [2021/09/07 v1.1.0 BIT Thesis Templates]
 %
 %<*driver>
-\ProvidesFile{bithesis.dtx}[2021/01/06 1.0.1 BIT Thesis Templates]
+\ProvidesFile{bithesis.dtx}[2021/09/07 1.1.0 BIT Thesis Templates]
 \documentclass{ltxdoc}
 \usepackage{dtx-style}
 
@@ -126,6 +126,7 @@
 %     \item 在此期间,冯开宇将原来的 .tex 文件制作成了宏包,并发布到 CTAN 上。
 %     \item 项目代码也随之被拆分成了 \BIThesisMacroPackage,\BIThesisWiki 和 \BIThesisScaffold。
 %   \end{itemize}
+% \item 2021 - 2022 年,2021 级(硕士研究生)的冯开宇针对 2021 年毕业季收到的反馈对该项目进行维护升级(前向兼容)。
 % \end{itemize}
 % \subsection{\BIThesis 是什么?}
 % \BIThesis 之名是英文单词 Beijing Institution of Technology(北京理工大学)的首字母缩写“BIT” 与“Thesis”结合而成。在纯文本环境下,该名字应写作“BIThesis”。
@@ -203,16 +204,33 @@
 %    \end{macrocode}
 %    \begin{macrocode}
 
+% 目前只有本科的模板,但仍旧要为可能预留空间。
 \newif\if at bit@bachelor
+\newif\if at bit@docTranslation
 \newif\if at bit@master
 \newif\if at bit@docter
 
+\RequirePackage{kvoptions}
+
+\SetupKeyvalOptions{
+  family=BIThesis,
+  prefix=BIThesis@
+}
+
+\DeclareStringOption[14pt]{footskip}
+\DeclareBoolOption{titleNumberHeiti}
+\ProcessKeyvalOptions*
+
+
 \DeclareOption{bachelor}{\@bit at bachelortrue}
+\DeclareOption{translation}{\@bit at docTranslationtrue}
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}}
+
 \ExecuteOptions{bachelor}
 
 \ProcessOptions\relax
 
+
 \LoadClass[UTF8,AutoFakeBold,AutoFakeSlant,zihao=-4,oneside,openany]{ctexbook}
 
 \RequirePackage[a4paper,left=3cm,right=2.6cm,top=3.5cm,bottom=2.9cm]{geometry}
@@ -236,7 +254,10 @@
 \RequirePackage{amsmath}
 \RequirePackage{amssymb}
 \RequirePackage{pdfpages}
+\RequirePackage{listings}
 
+%\PackageError{zzzz}{Main \BIThesis at footskip  hellp}{test}
+
 % 设置参考文献编译后端为 biber,引用格式为 GB/T7714-2015 格式
 % 参考文献使用宏包见 https://github.com/hushidong/biblatex-gb7714-2015
 \RequirePackage[
@@ -260,14 +281,20 @@
 \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]{[STXIHEI.TTF]} % 若希望使用本机字体,也可以用 {STXihei} 来调用
 \newcommand{\xihei}{\CJKfamily{xihei}}
 
+\ifBIThesis at titleNumberHeiti
+  \newcommand{\arabicHeiti}[1]{\xeCJKsetup{CJKspace=true}\xeCJKDeclareCharClass{CJK}{`0 -> `9}{\heiti\raisebox{-0.1ex}{#1}}\normalspacedchars{0,1,2,3,4,5,6,7,8,9}\xeCJKsetup{CJKspace=false}}
+\else
+  \newcommand{\arabicHeiti}[1]{#1}
+\fi
 
 
+
 % 主题页面格式:BIThesis
 \fancypagestyle{BIThesis}{
   % 页眉高度
   \setlength{\headheight}{20pt}
   % 页码高度(不完美,比规定稍微靠下 2mm)
-  \setlength{\footskip}{14pt}
+  \setlength{\footskip}{\BIThesis at footskip}
 
   \fancyhf{}
   % 定义页眉、页码
@@ -277,11 +304,29 @@
   \renewcommand{\headrulewidth}{0.6pt}
 }
 
+\if at bit@docTranslation
+% 主题页面格式:BIThesis
+\fancypagestyle{BIThesis}{
+  % 页眉高度
+  \setlength{\headheight}{20pt}
+  % 页码高度(不完美,比规定稍微靠下 2mm)
+  \setlength{\footskip}{\BIThesis at footskip}
+
+  \fancyhf{}
+  % 定义页码
+  \fancyfoot[C]{\songti\zihao{5} \thepage}
+  % 页眉分割线稍微粗一些
+  \renewcommand{\headrulewidth}{0.6pt}
+
+  % 定义页眉
+  \fancyhead[C]{\zihao{4}\ziju{0.08}\songti{北京理工大学本科生毕业设计(论文)外文翻译}}
+}
+\fi
 % 设置章节格式
 % 一级标题:黑体,三号,加粗;间距:段前 0.5 行,段后 1 行;
 \ctexset{chapter={
     name = {第,章},
-    number = {\arabic{chapter}},
+    number = {\arabicHeiti{ \arabic{chapter} }},
     format = {\heiti \bfseries \centering \zihao{3}},
     aftername = \hspace{9bp},
     pagestyle = BIThesis,
@@ -293,7 +338,7 @@
 
 % 二级标题:黑体,四号,加粗;间距:段前 0.5 行,段后 0 行;
 \ctexset{section={
-    number = {\thechapter.\hspace{4bp}\arabic{section}},
+    number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}}},
     format = {\heiti \raggedright \bfseries \zihao{4}},
     aftername = \hspace{8bp},
     beforeskip = 20bp plus 1ex minus .2ex,
@@ -304,7 +349,7 @@
 
 % 三级标题:黑体、小四、加粗;间距:段前 0.5 行,段后 0 行;
 \ctexset{subsection={
-    number = {\thechapter.\hspace{3bp}\arabic{section}.\hspace{3bp}\arabic{subsection}},
+    number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}}},
     format = {\heiti \bfseries \raggedright \zihao{-4}},
     aftername = \hspace{7bp},
     beforeskip = 17bp plus 1ex minus .2ex,
@@ -354,6 +399,37 @@
 \renewcommand{\thefigure}{\thechapter-\arabic{figure}}
 \captionsetup[figure]{font=small,labelsep=space}
 
+% 设置 listings 源代码高亮的格式
+\AtBeginDocument{
+  \renewcommand{\lstlistingname}{代码}
+  \renewcommand{\thelstlisting}{\arabic{chapter}-\arabic{lstlisting}}
+}
+
+\definecolor{codegreen}{rgb}{0,0.6,0}
+\definecolor{codegray}{rgb}{0.5,0.5,0.5}
+\definecolor{codepurple}{rgb}{0.58,0,0.82}
+\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
+\lstdefinestyle{examplestyle}{
+    backgroundcolor=\color{backcolour},
+    commentstyle=\color{codegreen},
+    keywordstyle=\color{magenta},
+    numberstyle=\tiny\color{codegray},
+    stringstyle=\color{codepurple},
+    basicstyle=\ttfamily\footnotesize,
+    breakatwhitespace=false,
+    breaklines=true,
+    captionpos=b,
+    keepspaces=true,
+    numbers=left,
+    numbersep=5pt,
+    showspaces=false,
+    showstringspaces=false,
+    showtabs=false,
+    tabsize=2
+}
+\lstset{style=examplestyle}
+
+
 % 设置表格的 caption 格式和 caption 与 table 之间的垂直距离
 \renewcommand{\thetable}{\thechapter-\arabic{table}}
 \captionsetup[table]{font=small,labelsep=space,skip=2pt}

Modified: trunk/Master/texmf-dist/tex/latex/bithesis/bitart.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bithesis/bitart.cls	2021-09-08 02:37:35 UTC (rev 60451)
+++ trunk/Master/texmf-dist/tex/latex/bithesis/bitart.cls	2021-09-08 20:41:34 UTC (rev 60452)
@@ -27,7 +27,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesClass{bitart}
- [2021/01/06 v1.0.1 BIT Thesis Templates]
+ [2021/09/07 v1.1.0 BIT Thesis Templates]
 
 
 \newif\if at bit@labreport

Modified: trunk/Master/texmf-dist/tex/latex/bithesis/bitbook.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bithesis/bitbook.cls	2021-09-08 02:37:35 UTC (rev 60451)
+++ trunk/Master/texmf-dist/tex/latex/bithesis/bitbook.cls	2021-09-08 20:41:34 UTC (rev 60452)
@@ -27,15 +27,29 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesClass{bitbook}
- [2021/01/06 v1.0.1 BIT Thesis Templates]
+ [2021/09/07 v1.1.0 BIT Thesis Templates]
 
 
 \newif\if at bit@bachelor
+\newif\if at bit@docTranslation
 \newif\if at bit@master
 \newif\if at bit@docter
 
+\RequirePackage{kvoptions}
+
+\SetupKeyvalOptions{
+  family=BIThesis,
+  prefix=BIThesis@
+}
+
+\DeclareStringOption[14pt]{footskip}
+\DeclareBoolOption{titleNumberHeiti}
+\ProcessKeyvalOptions*
+
 \DeclareOption{bachelor}{\@bit at bachelortrue}
+\DeclareOption{translation}{\@bit at docTranslationtrue}
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}}
+
 \ExecuteOptions{bachelor}
 
 \ProcessOptions\relax
@@ -62,7 +76,9 @@
 \RequirePackage{amsmath}
 \RequirePackage{amssymb}
 \RequirePackage{pdfpages}
+\RequirePackage{listings}
 
+
 \RequirePackage[
   backend=biber,
   style=gb7714-2015,
@@ -81,11 +97,17 @@
 \setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]{[STXIHEI.TTF]} % 若希望使用本机字体,也可以用 {STXihei} 来调用
 \newcommand{\xihei}{\CJKfamily{xihei}}
 
+\ifBIThesis at titleNumberHeiti
+  \newcommand{\arabicHeiti}[1]{\xeCJKsetup{CJKspace=true}\xeCJKDeclareCharClass{CJK}{`0 -> `9}{\heiti\raisebox{-0.1ex}{#1}}\normalspacedchars{0,1,2,3,4,5,6,7,8,9}\xeCJKsetup{CJKspace=false}}
+\else
+  \newcommand{\arabicHeiti}[1]{#1}
+\fi
+
 \fancypagestyle{BIThesis}{
   % 页眉高度
   \setlength{\headheight}{20pt}
   % 页码高度(不完美,比规定稍微靠下 2mm)
-  \setlength{\footskip}{14pt}
+  \setlength{\footskip}{\BIThesis at footskip}
 
   \fancyhf{}
   % 定义页眉、页码
@@ -95,9 +117,26 @@
   \renewcommand{\headrulewidth}{0.6pt}
 }
 
+\if at bit@docTranslation
+\fancypagestyle{BIThesis}{
+  % 页眉高度
+  \setlength{\headheight}{20pt}
+  % 页码高度(不完美,比规定稍微靠下 2mm)
+  \setlength{\footskip}{\BIThesis at footskip}
+
+  \fancyhf{}
+  % 定义页码
+  \fancyfoot[C]{\songti\zihao{5} \thepage}
+  % 页眉分割线稍微粗一些
+  \renewcommand{\headrulewidth}{0.6pt}
+
+  % 定义页眉
+  \fancyhead[C]{\zihao{4}\ziju{0.08}\songti{北京理工大学本科生毕业设计(论文)外文翻译}}
+}
+\fi
 \ctexset{chapter={
     name = {第,章},
-    number = {\arabic{chapter}},
+    number = {\arabicHeiti{ \arabic{chapter} }},
     format = {\heiti \bfseries \centering \zihao{3}},
     aftername = \hspace{9bp},
     pagestyle = BIThesis,
@@ -108,7 +147,7 @@
 }
 
 \ctexset{section={
-    number = {\thechapter.\hspace{4bp}\arabic{section}},
+    number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}}},
     format = {\heiti \raggedright \bfseries \zihao{4}},
     aftername = \hspace{8bp},
     beforeskip = 20bp plus 1ex minus .2ex,
@@ -118,7 +157,7 @@
 }
 
 \ctexset{subsection={
-    number = {\thechapter.\hspace{3bp}\arabic{section}.\hspace{3bp}\arabic{subsection}},
+    number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}}},
     format = {\heiti \bfseries \raggedright \zihao{-4}},
     aftername = \hspace{7bp},
     beforeskip = 17bp plus 1ex minus .2ex,
@@ -160,6 +199,35 @@
 \renewcommand{\thefigure}{\thechapter-\arabic{figure}}
 \captionsetup[figure]{font=small,labelsep=space}
 
+\AtBeginDocument{
+  \renewcommand{\lstlistingname}{代码}
+  \renewcommand{\thelstlisting}{\arabic{chapter}-\arabic{lstlisting}}
+}
+
+\definecolor{codegreen}{rgb}{0,0.6,0}
+\definecolor{codegray}{rgb}{0.5,0.5,0.5}
+\definecolor{codepurple}{rgb}{0.58,0,0.82}
+\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
+\lstdefinestyle{examplestyle}{
+    backgroundcolor=\color{backcolour},
+    commentstyle=\color{codegreen},
+    keywordstyle=\color{magenta},
+    numberstyle=\tiny\color{codegray},
+    stringstyle=\color{codepurple},
+    basicstyle=\ttfamily\footnotesize,
+    breakatwhitespace=false,
+    breaklines=true,
+    captionpos=b,
+    keepspaces=true,
+    numbers=left,
+    numbersep=5pt,
+    showspaces=false,
+    showstringspaces=false,
+    showtabs=false,
+    tabsize=2
+}
+\lstset{style=examplestyle}
+
 \renewcommand{\thetable}{\thechapter-\arabic{table}}
 \captionsetup[table]{font=small,labelsep=space,skip=2pt}
 



More information about the tex-live-commits mailing list.