Skip to content

Commit

Permalink
merge into one cls file
Browse files Browse the repository at this point in the history
  • Loading branch information
weiquanmao committed Mar 7, 2020
1 parent 76cbbd8 commit b80a511
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 1,046 deletions.
32 changes: 16 additions & 16 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,25 @@

```
BUAAThesis
|- buaa.cls // LaTeX宏模板文件
|- buaa_mac.cls // LaTeX宏模板文件(For Mac with XeLaTeX)
|- GBT7714-2005.bst // 国标参考文献BibTeX样式文件2005版
|- GBT7714-2015.bst // 国标参考文献BibTeX样式文件2015版
|- logo-buaa.eps // 论文封皮北航字样
|- head-doctor.eps // 论文封皮北博士学位论文标题(华文行楷字体替代解决方案)
|- head-master.eps // 论文封皮北学硕学位论文标题(华文行楷字体替代解决方案)
|- head-professional.eps // 论文封皮北专硕学位论文标题(华文行楷字体替代解决方案)
|- Template.tex // LaTeX模板
|- tex/*.tex // LaTeX模板样例中的独立章节
|- ref.bib // LaTeX模板中的参考文献Bib文件
|- Template.docx // Word模板
|- .gitignore // Git忽略规则
+- ReadMe.md // 本文件
|- buaa.cls // LaTeX宏模板文件
|- Template.tex // LaTeX模板
|- Template.docx // Word模板
|- ref.bib // LaTeX模板中的参考文献Bib文件
|- bst/GBT7714-2005.bst // 国标参考文献BibTeX样式文件2005版
|- bst/GBT7714-2015.bst // 国标参考文献BibTeX样式文件2015版
|- pic/logo-buaa.eps // 论文封皮北航字样
|- pic/head-doctor.eps // 论文封皮北博士学位论文标题(华文行楷字体替代解决方案)
|- pic/head-master.eps // 论文封皮北学硕学位论文标题(华文行楷字体替代解决方案)
|- pic/head-professional.eps // 论文封皮北专硕学位论文标题(华文行楷字体替代解决方案)
|- tex/*.tex // LaTeX模板样例中的独立章节
|- ReadMe.md // 本文件
|- .gitignore // Git忽略规则
```

## 模板使用

+ Word: 直接在其上进行修改编写,请记得预先备份;
+ LaTeX: 参看LaTeX模板示例template.tex及相应插入章节tex/*.tex;
+ Mac: Mac系统请使用buaa_mac.cls并使用XeLaTeX编译。
+ LaTeX: 参看LaTeX模板示例template.tex及相应插入章节tex/*.tex。

## 关于图书馆查重

Expand All @@ -43,6 +41,8 @@ BUAAThesis

我的环境:Manjaro Linux + TeX Live 2018 + TeXstudio 2.12.10。

+ **已修复Windows系统下从pdf拷贝的西文乱码问题**

## 建议及问题反馈

+ E-mail: [[email protected]]([email protected])
Expand Down
Binary file modified Template.pdf
Binary file not shown.
66 changes: 39 additions & 27 deletions Template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,25 @@
%% %% 北航学位论文模板使用样例
%% %% 请将以下文件与此LaTeX文件放在同一目录中.
%% %%-----------
%% %% buaa.cls : LaTeX宏模板文件
%% %% buaa_mac.cls : LaTeX宏模板文件(For Mac with XeLaTeX)
%% %% GBT7714-2005.bst : 国标参考文献BibTeX样式文件2005(https://github.com/Haixing-Hu/GBT7714-2005-BibTeX-Style)
%% %% GBT7714-2015.bst : 国标参考文献BibTeX样式文件2015(https://github.com/zepinglee/gbt7714-bibtex-style)
%% %% logo-buaa.eps : 论文封皮北航字样
%% %% head-doctor.eps : 论文封皮北博士学位论文标题(华文行楷字体替代解决方案)
%% %% head-master.eps : 论文封皮北学硕学位论文标题(华文行楷字体替代解决方案)
%% %% head-professional.eps : 论文封皮北专硕学位论文标题(华文行楷字体替代解决方案)
%% %% tex/*.tex : 本模板样例中的独立章节
%% %% buaa.cls : LaTeX宏模板文件
%% %% bst/GBT7714-2005.bst : 国标参考文献BibTeX样式文件2005(https://github.com/Haixing-Hu/GBT7714-2005-BibTeX-Style)
%% %% bst/GBT7714-2015.bst : 国标参考文献BibTeX样式文件2015(https://github.com/zepinglee/gbt7714-bibtex-style)
%% %% pic/logo-buaa.eps : 论文封皮北航字样
%% %% pic/head-doctor.eps : 论文封皮北博士学位论文标题(华文行楷字体替代解决方案)
%% %% pic/head-master.eps : 论文封皮北学硕学位论文标题(华文行楷字体替代解决方案)
%% %% pic/head-professional.eps : 论文封皮北专硕学位论文标题(华文行楷字体替代解决方案)
%% %% tex/*.tex : 本模板样例中的独立章节
%% %%-----------
%% %% 请统一使用UTF-8编码.
%% %%=================================================================

%=================================================================
\documentclass[doctor,privacy,twoside]{cls/buaa}

%% Mac系统请使用buaa_mac,并使用XeLaTeX编译。
%\documentclass[doctor,privacy,twoside]{buaa_mac}

% 可加入额外ctexbook文档类的选项,其将会被传递给ctexbook。
% 例如:\documentclass[doctor,privacy,twoside,fontset=founder]{buaa}
% CTeX在Linux下默认使用Fandol字体,为避免某些生僻字无法显示,在系统
% 已安装方正字体的前提下可通过fontset=founder选项常用方正字体。

%=================================================================
% buaa基于ctexbook模板
% 论文样式参考自《研究生手册--二〇一五年八月》
%======================
% 模板导入:
% \documentclass[thesis,permission,printtype,ostype,<ctexbookoptions>]{buaa}
%======================
% 模板选项:
%======================
% I.论文类型(thesis)
Expand Down Expand Up @@ -64,27 +55,48 @@
% a.单面打印(oneside)[缺省值]
% b.双面打印(twoside)
%--------------------
% IV.系统类型(ostype)
%--------------------
% a.win(oneside)[缺省值]
% b.linux (linux)
% c.mac (mac)
%--------------------
% V.ctexbook设置选项(<ctexbookoptions>)
%--------------------
% ...
%======================
% 其他说明:
% 1. Mac系统请使用mac选项,并使用XeLaTeX编译。
% 2. 可加入额外ctexbook文档类的选项,其将会被传递给ctexbook。
% 例如:\documentclass[fontset=founder]{buaa}
% 3. CTeX在Linux下默认使用Fandol字体,为避免某些生僻字无法显示,在系统已安装方正
% 字体的前提下可通过fontset=founder选项常用方正字体。
%=================================================================

\documentclass[master,privacy,twoside,win]{buaa}

%=================================================================
% 开启/关闭引用编号颜色:参考文献,公式,图,表,算法 等……
\refcolor{on} % 开启: on[默认]; 关闭: off;
% 摘要和正文从右侧开始
% 摘要和正文从右侧页开始
\beginright{on} % 开启: on[默认]; 关闭: off;
% 空白页留字
\emptypagewords{[ -- This page is a preset empty page -- ]}

%=================================================================
% buaa模板已内嵌以下LaTeX工具包:
%--------------------
% ifthen, etoolbox, titletoc, remreset, remreset,
% geometry, fancyhdr, setspace, caption,
% ifthen, etoolbox, titletoc, remreset,
% geometry, fancyhdr, setspace,
% float, graphicx, subfigure, epstopdf,
% booktabs, longtable, multirow,
% array, enumitem
% algorithm2e, amsmath, amsthm, listings
% pifont, color, soul, newtxtext, newtxmath
% array, enumitem,
% booktabs, longtable, multirow, caption,
% listings, algorithm2e, amsmath, amsthm,
% hyperref, pifont, color, soul,
% ---
% For Win: times
% For Lin: newtxtext, newtxmath
% For Mac: times, fontspec
%--------------------
% 请在此处添加额外工具包>>

Expand Down
64 changes: 46 additions & 18 deletions cls/buaa.cls → buaa.cls
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %% <UTF-8>
%% %% 北航研究生毕业论文模板 - LaTeX 11-30-2019
%% %% 北航研究生毕业论文模板 - LaTeX 03-07-2020
%% %% 论文样式参考自《研究生手册--二〇一五年八月》
%% %% 基于ctexbook
%% %%
Expand All @@ -10,6 +10,7 @@
%% %% Qiao Junfeng ([email protected])
%% %%
%% %% Versions:
%% %% v3.0 WeiQM (03-07-2020)
%% %% v2.2 WeiQM (11-30-2019)
%% %% v2.1 QiaoJF, WeiQM (12-19-2018)
%% %% v2.0 WeiQM, QiaoJF (11-22-2018)
Expand All @@ -23,8 +24,8 @@

%% 模板标识
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{buaa}[2019/11/30 v2.2 BUAA thesis class]
\typeout{This is LaTeX template buaa. Version 2.2 (based on CTeX) 11-30-2019}
\ProvidesClass{buaa}[2020/03/07 v3.0 BUAA thesis class]
\typeout{This is LaTeX template buaa. Version 3.0 (based on CTeX) 03-07-2020}

%% 选项
%% 论文类型
Expand Down Expand Up @@ -60,6 +61,17 @@
%% 打印设置
\DeclareOption{oneside}{\gdef\@printtype{oneside}} % 单面打印
\DeclareOption{twoside}{\gdef\@printtype{twoside}} % 双面打印
\DeclareOption{printtype}{\ClassWarning{buaa}{%
You have not specified the PRINTTYPE option. The word printtype should be replaced by one of the following thesis type: oneside, twoside.
}}

%% 系统设置
\DeclareOption{win}{\gdef\@ostype{win}} % windows
\DeclareOption{linux}{\gdef\@ostype{linux}} % linux
\DeclareOption{max}{\gdef\@ostype{mac}} % mac
\DeclareOption{ostype}{\ClassWarning{buaa}{%
You have not specified the OSTYPE option. The word ostype should be replaced by one of the following thesis type: win, linux, mac.
}}

%% 适应首字母大写
\DeclareOption{Master}{\gdef\@thesis{master}}
Expand All @@ -84,20 +96,24 @@
\DeclareOption{TopSecret*}{\gdef\@permission{topsecret*}}
\DeclareOption{Oneside}{\gdef\@printtype{oneside}}
\DeclareOption{Twoside}{\gdef\@printtype{twoside}}
\DeclareOption{Win}{\gdef\@ostype{win}}
\DeclareOption{Linux}{\gdef\@ostype{linux}}
\DeclareOption{Max}{\gdef\@ostype{mac}}

%% 选项传递给ctexbook
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}}

%% 默认选项配置
\ExecuteOptions{master,public,oneside,a4paper,sub4section}
\ExecuteOptions{master,public,oneside,win,a4paper,sub4section}
\ProcessOptions\relax

% 引用ctexbook: 小4,1.5倍行距
%% 引用ctexbook: 小4,1.5倍行距
\LoadClass[UTF8,zihao=-4,linespread=1.7]{ctexbook}%1.5+0.2行间距
\setcounter{secnumdepth}{5}

%% BUAAThesis字样及版本信息
\usepackage{graphicx}
\def\BUAAThesisVer{v2.2 11-30-2019}
\def\BUAAThesisVer{v3.0 03-07-2020}
\def\BUAAThesis{%
B%
{\fontsize{0.8em}{\baselineskip}\selectfont
Expand All @@ -115,37 +131,47 @@

%% 预声明
\RequirePackage{ifthen} % ifthenelse/equal/isundefined等判断比较命令
\RequirePackage{etoolbox} % \AtBeginDocument等宏命令
\RequirePackage{titletoc} % 目录
\RequirePackage{remreset} % 计数器设置
\RequirePackage{geometry} % 设置页边距
\RequirePackage{fancyhdr} % 设置页眉页脚
\RequirePackage{setspace} % 设置行间距
%\RequirePackage{times} % Times New Roman字体
\RequirePackage{float} % 图片
\RequirePackage{graphicx} % 图片
\RequirePackage{subfigure} % 图片
\RequirePackage{epstopdf} % 图片
\RequirePackage{array} %
\RequirePackage{enumitem} %
\RequirePackage{array} % 列举
\RequirePackage{enumitem} % 列举
\RequirePackage{booktabs} % 表格上下粗线
\RequirePackage{longtable} % 长表格
\RequirePackage{multirow} % 多行表格
\RequirePackage{caption} % 标题设置
\RequirePackage{algorithm2e} % 算法环境
\RequirePackage{listings} % 代码环境
\RequirePackage{algorithm2e} % 算法环境
\RequirePackage{amsmath} % 数学
\RequirePackage{amsthm} % 定理
\RequirePackage{newtxtext} % Times New Roman字体
\RequirePackage{newtxmath} % 公式的Times New Roman字体,需放置于amsthm之后
\RequirePackage{titletoc} % 目录
\RequirePackage{remreset} % 计数器设置
\RequirePackage{hyperref} % 超链接
\RequirePackage{etoolbox} % \AtBeginDocument等宏命令
\RequirePackage{pifont} % 画五角星
\RequirePackage{color} % To provide color for soul
\RequirePackage{soul} % To highlight text
\RequirePackage[sort&compress]{natbib} % BibTex
\DeclareGraphicsExtensions{.eps,.ps,.png,.jpg,.bmp} % 声明使用图像格式
\newcommand{\highlight}[1]{\colorbox{yellow}{#1}} % 高亮注释

% 根据不同系统调整
\ifthenelse{\equal{\@ostype}{win}}{ % win 配置
\RequirePackage{times} % Times New Roman字体
}{}
\ifthenelse{\equal{\@ostype}{linux}}{ % linux 配置
\RequirePackage{newtxtext} % Times New Roman字体
\RequirePackage{newtxmath} % 公式的Times New Roman字体 (!After package amsthm!)
}{}
\ifthenelse{\equal{\@ostype}{mac}}{ % mac 配置
\RequirePackage{times} % Times New Roman字体
\RequirePackage{fontspec} % 字体设置 (!Only for XeLaTeX!)
}{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 数学环境
% 数学符号:
Expand All @@ -154,8 +180,9 @@
\newcommand*{\diff}{\mathop{}\!\mathrm{d}}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}

% 数学定理:
% 以下定义数学定理环境默认风格为 buaa
% 以下定义数学定理环境默认风格为 buaa
\newtheoremstyle{buaa}%
{0pt}% measure of space to leave above the theorem.
{0pt}% measure of space to leave below the theorem.
Expand All @@ -165,8 +192,8 @@
{.}% punctuation between head and body.
{\ccwd}% space after theorem head; " " = normal interword space
{}% manually specify head (can be left empty, meaning `normal').

\theoremstyle{buaa}

% 定义新的定理
\newcommand{\theoremname}{定理}
\newcommand{\assertionname}{断言}
Expand All @@ -190,6 +217,7 @@
\newtheorem{definition} {\definitionname} [chapter]
\newtheorem{example} {\examplename} [chapter]
\newtheorem*{remark} {\remarkname}

% From MDPI.cls
%\renewcommand{\qed}{\unskip\nobreak\quad\qedsymbol} %% This places the symbol right after the text instead of placing it at the end on the line.
\renewenvironment{proof}[1][\proofname]{\par %% \proofname allows to have "Proof of my theorem"
Expand Down Expand Up @@ -219,7 +247,7 @@
\newcommand{\refcolor}[1]{\gdef\@refcolor{#1}}
\def\@emptypagewords{} % 空白页留字
\newcommand{\emptypagewords}[1]{\gdef\@emptypagewords{#1}}
\def\@beginright{} % 摘要、目录、第一章右侧打开 on/off
\def\@beginright{} % 摘要、目录、第一章右侧页起 on/off
\newcommand{\beginright}[1]{\gdef\@beginright{#1}}

\newcommand{\Title}[2]{\gdef\@titlecn{#1} \gdef\@titleen{#2}}
Expand Down
Loading

0 comments on commit b80a511

Please sign in to comment.