Skip to content

Commit 12f7e1b

Browse files
authored
Merge pull request #87 from BITNP/paper-translation
Regular Maintainance: year 2021.
2 parents dda3abf + 71cda67 commit 12f7e1b

File tree

4 files changed

+92
-14
lines changed

4 files changed

+92
-14
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
template: [graduation-thesis, proposal-report, lab-report]
15+
template: [graduation-thesis, proposal-report, lab-report, paper-translation]
1616

1717
steps:
1818
- name: Checkout to BIThesis-scaffold

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ clean-dist:
4141
clean-all: clean clean-dist FORCE_MAKE
4242

4343

44-
copy:
44+
copy: cls
4545
cp bitbook.cls $(SCAFFOLDDIR)/graduation-thesis
4646
cp bitart.cls $(SCAFFOLDDIR)/lab-report
4747
cp bitart.cls $(SCAFFOLDDIR)/proposal-report
48+
cp bitbook.cls $(SCAFFOLDDIR)/paper-translation
4849

4950
dev:
5051
ls bithesis.dtx | entr -s 'yes y | make doc && make copy'
@@ -56,4 +57,6 @@ pkg: doc
5657
rm -rf ./bithesis
5758
mkdir bithesis
5859
cp bithesis.{ins,dtx,pdf} *.md ./bithesis
60+
mv ./bithesis/README.md ./bithesis/README-zh.md
61+
mv ./bithesis/README-en.md ./bithesis/README.md
5962
zip -r bithesis.zip bithesis

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
📖 [_非官方本科生毕业设计毕业论文 LaTeX 模板(以及更多)_](https://bithesis.bitnp.net)
55

6-
![BIThesis](./assets/bithesis_badge_solid.svg)
6+
![GitHub all releases](https://img.shields.io/github/downloads/BITNP/BIThesis/total)
77
[![English version](./assets/english.svg)](./README-en.md)
88
[![Latexmk](https://badgen.net/badge/compiler/Latexmk?color=blue&labelColor=2b2b2b)](https://mg.readthedocs.io/latexmk.html)
99
[![License](https://badgen.net/github/license/BITNP/BIThesis?color=008080&labelColor=2b2b2b)](./LICENSE)
@@ -21,8 +21,6 @@
2121

2222
BIThesis 是针对北京理工大学本科同学毕业设计、毕业论文制作的一个非官方的 LaTeX 模板,BIThesis 同时也包括其他本科学习中涉及到的文献综述、实验报告等的 LaTeX 模板。
2323

24-
**我们正在对项目持续更新!目前,你完全可以使用现有的版本开始你的毕业设计开题报告的写作;不过与此同时,我们也在持续推进代码的升级和更新(主要是不影响使用的底层逻辑)。更多开发计划请访问我们的 [Roadmap](https://github.com/BITNP/BIThesis/projects)。想帮助这个项目持续前进?参见我们的[贡献者指南](./contributing-zh.md)**
25-
2624
> 本项目获得了 [北京理工大学教务部](http://jwc.bit.edu.cn/)[北京理工大学计算机学院](http://cs.bit.edu.cn/) 的认可、背书与大力支持。详见:[致谢 - 官方赞助](https://bithesis.bitnp.net/Guide/5-Acknowledgements/Acknowledgements.html#%E5%AE%98%E6%96%B9%E8%B5%9E%E5%8A%A9-official-sponsors)
2725
2826
<h2>Slack 社区</h2>
@@ -86,11 +84,12 @@ ls bithesis.dtx | entr -s 'yes -y y | make doc && make copy'
8684

8785
| CI | Build status |
8886
| :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
89-
| GitHub Release | ![GitHub Release](https://github.com/BITNP/BIThesis/workflows/Release/badge.svg?branch=master) |
90-
| Netlify Deploy | [![Netlify Status](https://api.netlify.com/api/v1/badges/81f7b49b-59a1-46bc-ba52-02f8be71d247/deploy-status)](https://app.netlify.com/sites/vigorous-hoover-a697eb/deploys) |
87+
| GitHub Release | [![GitHub release (latest by date)](https://img.shields.io/github/v/release/BITNP/BIThesis?style=flat-square)](https://github.com/BITNP/BIThesis/releases) |
88+
| Vercel Deploy | [![Vercel Status](https://img.shields.io/github/deployments/fky2015/BIThesis-wiki/production?label=vercel&style=flat-square)](https://vercel.com/fkynjyq/bithesis-wiki/deployments) |
89+
9190

9291
---
9392

9493
📖 **BIThesis** ©BITNP/BIThesis. Released under the [LaTeX Project Public License](LICENSE).
9594

96-
Authored by Spencer Woo. Maintained with help from [contributors](https://github.com/BITNP/BIThesis/graphs/contributors).
95+
Maintained with help from [contributors](https://github.com/BITNP/BIThesis/graphs/contributors).

bithesis.dtx

Lines changed: 82 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
%<cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
2121
%<book>\ProvidesClass{bitbook}
2222
%<article>\ProvidesClass{bitart}
23-
%<cls> [2021/01/06 v1.0.1 BIT Thesis Templates]
23+
%<cls> [2021/09/07 v1.1.0 BIT Thesis Templates]
2424
%
2525
%<*driver>
26-
\ProvidesFile{bithesis.dtx}[2021/01/06 1.0.1 BIT Thesis Templates]
26+
\ProvidesFile{bithesis.dtx}[2021/09/07 1.1.0 BIT Thesis Templates]
2727
\documentclass{ltxdoc}
2828
\usepackage{dtx-style}
2929

@@ -126,6 +126,7 @@
126126
% \item 在此期间,冯开宇将原来的 .tex 文件制作成了宏包,并发布到 CTAN 上。
127127
% \item 项目代码也随之被拆分成了 \BIThesisMacroPackage,\BIThesisWiki 和 \BIThesisScaffold。
128128
% \end{itemize}
129+
% \item 2021 - 2022 年,2021 级(硕士研究生)的冯开宇针对 2021 年毕业季收到的反馈对该项目进行维护升级(前向兼容)。
129130
% \end{itemize}
130131
% \subsection{\BIThesis 是什么?}
131132
% \BIThesis 之名是英文单词 Beijing Institution of Technology(北京理工大学)的首字母缩写“BIT” 与“Thesis”结合而成。在纯文本环境下,该名字应写作“BIThesis”。
@@ -203,16 +204,33 @@
203204
% \end{macrocode}
204205
% \begin{macrocode}
205206

207+
% 目前只有本科的模板,但仍旧要为可能预留空间。
206208
\newif\if@bit@bachelor
209+
\newif\if@bit@docTranslation
207210
\newif\if@bit@master
208211
\newif\if@bit@docter
209212

213+
\RequirePackage{kvoptions}
214+
215+
\SetupKeyvalOptions{
216+
family=BIThesis,
217+
prefix=BIThesis@
218+
}
219+
220+
\DeclareStringOption[14pt]{footskip}
221+
\DeclareBoolOption{titleNumberHeiti}
222+
\ProcessKeyvalOptions*
223+
224+
210225
\DeclareOption{bachelor}{\@bit@bachelortrue}
226+
\DeclareOption{translation}{\@bit@docTranslationtrue}
211227
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}}
228+
212229
\ExecuteOptions{bachelor}
213230

214231
\ProcessOptions\relax
215232

233+
216234
\LoadClass[UTF8,AutoFakeBold,AutoFakeSlant,zihao=-4,oneside,openany]{ctexbook}
217235

218236
\RequirePackage[a4paper,left=3cm,right=2.6cm,top=3.5cm,bottom=2.9cm]{geometry}
@@ -236,6 +254,9 @@
236254
\RequirePackage{amsmath}
237255
\RequirePackage{amssymb}
238256
\RequirePackage{pdfpages}
257+
\RequirePackage{listings}
258+
259+
%\PackageError{zzzz}{Main \BIThesis@footskip hellp}{test}
239260

240261
% 设置参考文献编译后端为 biber,引用格式为 GB/T7714-2015 格式
241262
% 参考文献使用宏包见 https://github.com/hushidong/biblatex-gb7714-2015
@@ -260,14 +281,20 @@
260281
\setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]{[STXIHEI.TTF]} % 若希望使用本机字体,也可以用 {STXihei} 来调用
261282
\newcommand{\xihei}{\CJKfamily{xihei}}
262283

284+
\ifBIThesis@titleNumberHeiti
285+
\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}}
286+
\else
287+
\newcommand{\arabicHeiti}[1]{#1}
288+
\fi
289+
263290

264291

265292
% 主题页面格式:BIThesis
266293
\fancypagestyle{BIThesis}{
267294
% 页眉高度
268295
\setlength{\headheight}{20pt}
269296
% 页码高度(不完美,比规定稍微靠下 2mm)
270-
\setlength{\footskip}{14pt}
297+
\setlength{\footskip}{\BIThesis@footskip}
271298

272299
\fancyhf{}
273300
% 定义页眉、页码
@@ -277,11 +304,29 @@
277304
\renewcommand{\headrulewidth}{0.6pt}
278305
}
279306

307+
\if@bit@docTranslation
308+
% 主题页面格式:BIThesis
309+
\fancypagestyle{BIThesis}{
310+
% 页眉高度
311+
\setlength{\headheight}{20pt}
312+
% 页码高度(不完美,比规定稍微靠下 2mm)
313+
\setlength{\footskip}{\BIThesis@footskip}
314+
315+
\fancyhf{}
316+
% 定义页码
317+
\fancyfoot[C]{\songti\zihao{5} \thepage}
318+
% 页眉分割线稍微粗一些
319+
\renewcommand{\headrulewidth}{0.6pt}
320+
321+
% 定义页眉
322+
\fancyhead[C]{\zihao{4}\ziju{0.08}\songti{北京理工大学本科生毕业设计(论文)外文翻译}}
323+
}
324+
\fi
280325
% 设置章节格式
281326
% 一级标题:黑体,三号,加粗;间距:段前 0.5 行,段后 1 行;
282327
\ctexset{chapter={
283328
name = {第,章},
284-
number = {\arabic{chapter}},
329+
number = {\arabicHeiti{ \arabic{chapter} }},
285330
format = {\heiti \bfseries \centering \zihao{3}},
286331
aftername = \hspace{9bp},
287332
pagestyle = BIThesis,
@@ -293,7 +338,7 @@
293338

294339
% 二级标题:黑体,四号,加粗;间距:段前 0.5 行,段后 0 行;
295340
\ctexset{section={
296-
number = {\thechapter.\hspace{4bp}\arabic{section}},
341+
number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}}},
297342
format = {\heiti \raggedright \bfseries \zihao{4}},
298343
aftername = \hspace{8bp},
299344
beforeskip = 20bp plus 1ex minus .2ex,
@@ -304,7 +349,7 @@
304349

305350
% 三级标题:黑体、小四、加粗;间距:段前 0.5 行,段后 0 行;
306351
\ctexset{subsection={
307-
number = {\thechapter.\hspace{3bp}\arabic{section}.\hspace{3bp}\arabic{subsection}},
352+
number = {\arabicHeiti{\thechapter.\hspace{1bp}\arabic{section}.\hspace{1bp}\arabic{subsection}}},
308353
format = {\heiti \bfseries \raggedright \zihao{-4}},
309354
aftername = \hspace{7bp},
310355
beforeskip = 17bp plus 1ex minus .2ex,
@@ -354,6 +399,37 @@
354399
\renewcommand{\thefigure}{\thechapter-\arabic{figure}}
355400
\captionsetup[figure]{font=small,labelsep=space}
356401

402+
% 设置 listings 源代码高亮的格式
403+
\AtBeginDocument{
404+
\renewcommand{\lstlistingname}{代码}
405+
\renewcommand{\thelstlisting}{\arabic{chapter}-\arabic{lstlisting}}
406+
}
407+
408+
\definecolor{codegreen}{rgb}{0,0.6,0}
409+
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
410+
\definecolor{codepurple}{rgb}{0.58,0,0.82}
411+
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
412+
\lstdefinestyle{examplestyle}{
413+
backgroundcolor=\color{backcolour},
414+
commentstyle=\color{codegreen},
415+
keywordstyle=\color{magenta},
416+
numberstyle=\tiny\color{codegray},
417+
stringstyle=\color{codepurple},
418+
basicstyle=\ttfamily\footnotesize,
419+
breakatwhitespace=false,
420+
breaklines=true,
421+
captionpos=b,
422+
keepspaces=true,
423+
numbers=left,
424+
numbersep=5pt,
425+
showspaces=false,
426+
showstringspaces=false,
427+
showtabs=false,
428+
tabsize=2
429+
}
430+
\lstset{style=examplestyle}
431+
432+
357433
% 设置表格的 caption 格式和 caption 与 table 之间的垂直距离
358434
\renewcommand{\thetable}{\thechapter-\arabic{table}}
359435
\captionsetup[table]{font=small,labelsep=space,skip=2pt}

0 commit comments

Comments
 (0)