Skip to content

Commit

Permalink
release 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
polossk committed May 15, 2018
1 parent 279171e commit f576e89
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 85 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![Platfrom](https://img.shields.io/badge/Platfrom-TeXLive2016-3D6117.svg)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
![Status](https://img.shields.io/badge/status-complete-brightgreen.svg)
![Version](https://img.shields.io/badge/version-v1.4.0-alpha-674EA7.svg)
![Version](https://img.shields.io/badge/version-v1.4.0-674EA7.svg)

## Usage

Expand All @@ -15,10 +15,10 @@

## Note

* 本模板使用的是Adobe字体(宋体,黑体,楷体,仿宋),需要另行购买或下载
* 本模板使用的是 **Adobe** 字体(宋体,黑体,楷体,仿宋),需要另行购买或下载
* `cover.tex` 文件为论文的封面页, `translation-cover` 为本科毕业设计的文献翻译封面页
* 所有字体大小的控制命令统一前缀为`s(a.k.a size)`, 所有字体格式的控制命令统一前缀为`f(a.k.a font)`
* `makefile` 中的 `close` 选项为 `windows` 专用, 并且假设使用了 `Acrobat` 打开了当前 pdf 文件
* `makefile` 中的 `close`, `clean` 以及 `wipe` 选项为 `windows` 专用, 并且假设使用了 `Acrobat` 打开了当前 pdf 文件
* 校徽用`tikz`生成矢量图形 `logo.tex`
* 额外制作了西北工业大学的标题的特殊字体 `nwpuname.ttf`
* 如有任何问题,请发[issue](/~https://github.com/NWPUMetaphysicsOffice/LaTeX-Template-For-NPU-Thesis/issues/new)
Expand Down
Binary file modified example.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions example.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
\usepackage{plug-ins/math-symbols}
\input{plug-ins/aerocoeffs}

% 插图目录
\graphicspath{{figures/}}

% 仅用于测试
\usepackage{blindtext}

Expand Down
139 changes: 57 additions & 82 deletions settings/thesis-setting.tex
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
%------------------------------------------------------------------------------%
% %
% LaTeX Template for Bachlor Thesis of Northwestern Polytechnical University %
% Using XeLeTeX + MakeIndex + BibTeX, or Using CTeX v2.9.2.164 %
% Version: 1.3.0 %
% Environment Config: TeXLive 2017 %
% * XeTeX 3.14159265-2.6-0.99998 (TeX Live 2017/W32TeX) %
% * BibTeX 0.99d (TeX Live 2017/W32TeX) %
% Version: 1.4.0 %
% %
%------------------------------------------------------------------------------%
% Copyright 2016 by Shangkun Shen, MIT-LICENSE(see mit-license.polossk.com) %
% Copyright by NWPU Metaphysics Office, MIT-LICENSE %
%------------------------------------------------------------------------------%


Expand Down Expand Up @@ -62,34 +64,27 @@
%---------------------------------设置字体大小---------------------------------%
\usepackage{type1cm}
% 字号与行距,统一前缀s(a.k.a size)
\newcommand{\sChuhao}{\fontsize{42pt}{63pt}\selectfont} % 初号, 1.5倍
\newcommand{\sYihao}{\fontsize{26pt}{36pt}\selectfont} % 一号, 1.4倍
\newcommand{\sErhao}{\fontsize{22pt}{28pt}\selectfont} % 二号, 1.25倍
\newcommand{\sXiaoer}{\fontsize{18pt}{18pt}\selectfont} % 小二, 单倍
\newcommand{\sSanhao}{\fontsize{16pt}{24pt}\selectfont} % 三号, 1.5倍
\newcommand{\sXiaosan}{\fontsize{15pt}{22pt}\selectfont} % 小三, 1.5倍
\newcommand{\sSihao}{\fontsize{14pt}{21pt}\selectfont} % 四号, 1.5倍
\newcommand{\sSHalfXiaosi}{\fontsize{13pt}{19pt}\selectfont} % 半小四, 1.5倍
\newcommand{\sHalfXiaosi}{\fontsize{13pt}{16.25pt}\selectfont} % 半小四, 1.25倍
\newcommand{\sRealHalfXiaosi}{\fontsize{12.5pt}{16.25pt}\selectfont} % 模板中的半小四, 1.25倍
\newcommand{\sXiaosi}{\fontsize{12pt}{14.4pt}\selectfont} % 小四, 1.25倍
\newcommand{\sLargeWuhao}{\fontsize{11pt}{11pt}\selectfont} % 大五, 单倍
\newcommand{\sWuhao}{\fontsize{10.5pt}{10.5pt}\selectfont} % 五号, 单倍
\newcommand{\sXiaowu}{\fontsize{9pt}{9pt}\selectfont} % 小五, 单倍
\newcommand{\sChuhao}{\fontsize{42pt}{63pt}\selectfont} % 初号, 1.5倍
\newcommand{\sYihao}{\fontsize{26pt}{36pt}\selectfont} % 一号, 1.4倍
\newcommand{\sErhao}{\fontsize{22pt}{28pt}\selectfont} % 二号, 1.25倍
\newcommand{\sXiaoer}{\fontsize{18pt}{18pt}\selectfont} % 小二, 单倍
\newcommand{\sSanhao}{\fontsize{16pt}{24pt}\selectfont} % 三号, 1.5倍
\newcommand{\sXiaosan}{\fontsize{15pt}{22pt}\selectfont} % 小三, 1.5倍
\newcommand{\sSihao}{\fontsize{14pt}{21pt}\selectfont} % 四号, 1.5倍
\newcommand{\sSHalfXiaosi}{\fontsize{13pt}{19pt}\selectfont} % 半小四, 1.5倍
\newcommand{\sHalfXiaosi}{\fontsize{13pt}{16.25pt}\selectfont} % 半小四, 1.25倍
\newcommand{\sRealHalfXiaosi}{\fontsize{12.5pt}{16.25pt}\selectfont} % 模板中的半小四, 1.25倍
\newcommand{\sXiaosi}{\fontsize{12pt}{14.4pt}\selectfont} % 小四, 1.25倍
\newcommand{\sLargeWuhao}{\fontsize{11pt}{11pt}\selectfont} % 大五, 单倍
\newcommand{\sWuhao}{\fontsize{10.5pt}{10.5pt}\selectfont} % 五号, 单倍
\newcommand{\sXiaowu}{\fontsize{9pt}{9pt}\selectfont} % 小五, 单倍
%------------------------------------------------------------------------------%


%---------------------------------设置中文字体---------------------------------%
\usepackage{fontspec}
<<<<<<< HEAD:settings/thesis-setting.tex
%\usepackage[SlantFont,BoldFont,CJKchecksingle,CJKnumber]{xeCJK}
\usepackage[SlantFont,BoldFont,CJKchecksingle]{xeCJK}
=======
%xeCJK warning: "option-deprecated"
%The `CJKnumber' option is deprecated.
\usepackage[SlantFont,BoldFont,CJKchecksingle,CJKnumber]{xeCJK}
\usepackage{CJKnumb}
>>>>>>> master:common files/thesis-setting.tex
% 使用 Adobe 字体
\newcommand\adobeSog{Adobe Song Std}
\newcommand\adobeHei{Adobe Heiti Std}
Expand All @@ -103,9 +98,9 @@
\setCJKmonofont{\codeFont}
\setmonofont{\codeFont}
% 设置字体族
\setCJKfamilyfont{song}{\adobeSog} % 宋体
\setCJKfamilyfont{hei}{\adobeHei} % 黑体
\setCJKfamilyfont{kai}{\adobeKai} % 楷体
\setCJKfamilyfont{song}{\adobeSog} % 宋体
\setCJKfamilyfont{hei}{\adobeHei} % 黑体
\setCJKfamilyfont{kai}{\adobeKai} % 楷体
\setCJKfamilyfont{fang}{\adobeFag} % 仿宋体
% 用于页眉学校名,特殊字体,powerby /~https://github.com/ecomfe/fonteditor
\setCJKfamilyfont{nwpu}{nwpuname}
Expand All @@ -127,6 +122,7 @@
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{setspace}
\captionsetup[table]{labelfont=bf,textfont=bf}
%------------------------------------------------------------------------------%


Expand All @@ -142,9 +138,12 @@
\renewcommand\equationautorefname{式}
\newcommand\myreference[1]{[\ref{#1}]}
\newcommand\eqrefe[1]{式(\ref{#1})}
\renewcommand\theequation{\thechapter-\arabic{equation}}
% 增加 \ucite 命令使显示的引用为上标形式
\newcommand{\ucite}[1]{$^{\mbox{\scriptsize \cite{#1}}}$}
\renewcommand\arraystretch{1.4}
\renewcommand\theequation{\thesection.\arabic{equation}}
\renewcommand{\thefigure}{\thechapter-\arabic{figure}}
\renewcommand{\thetable}{\thechapter-\arabic{table}}
%------------------------------------------------------------------------------%


Expand All @@ -156,13 +155,12 @@


%--------------------------设置中文段落缩进与正文版式--------------------------%
\XeTeXlinebreaklocale "zh" %使用中文的换行风格
\XeTeXlinebreakskip = 0pt plus 1pt %调整换行逻辑的弹性大小
% \xeCJKcaption{gb_452}
\usepackage{indentfirst}
\setlength{\parindent}{26pt}
\setlength{\parskip}{3pt plus 1pt minus 1pt} % 段落间距
\renewcommand{\baselinestretch}{1.25} % 行距
\XeTeXlinebreaklocale "zh" % 使用中文的换行风格
\XeTeXlinebreakskip = 0pt plus 1pt % 调整换行逻辑的弹性大小
\usepackage{indentfirst} % 段首空格设置
\setlength{\parindent}{26pt} % 段首空格长度
\setlength{\parskip}{3pt plus 1pt minus 1pt} % 段落间距
\renewcommand{\baselinestretch}{1.25} % 行距
%------------------------------------------------------------------------------%


Expand All @@ -171,20 +169,8 @@
\setcounter{tocdepth}{2}
\usepackage{CJKnumb}

% 正文中标题格式,毋需标号
% \titleformat{\section}[hang]{\fHei \sf \sSihao}
% {\sSihao }{0.5em}{}{}
% \titleformat{\subsection}[hang]{\fHei \sf \sHalfXiaosi}
% {\sHalfXiaosi }{0.5em}{}{}
% \titleformat{\subsubsection}[hang]{\fHei \sf}
% {\thesubsubsection }{0.5em}{}{}
% 正文中标题格式,需要标号

\newcommand\chapterID[1]{第\CJKnumber{#1}章}
\renewcommand{\chaptername}{第~\CJKnumber{\thechapter}~章}
%\newcommand\chapterID[1]{第\zhnumber{#1}章}
%\renewcommand{\chaptername}{第~\zhnumber{\thechapter}~章}
%\renewcommand{\chaptername}{第 \thechapter 章}
\renewcommand{\figurename}{图}
\renewcommand{\tablename}{表}
\renewcommand{\bibname}{参考文献}
Expand All @@ -193,16 +179,13 @@


\titleformat{\chapter}[hang]{\normalfont\sSanhao\filcenter\fHei\bf}%
{\sSanhao{\chaptertitlename}}{20pt}{\sSanhao}
{\sSanhao{\chaptertitlename}}{20pt}{\sSanhao}
\titleformat{\section}[hang]{\fHei \bf \sXiaosan}%
{\sXiaosan \thesection}{0.5em}{}{}
{\sXiaosan \thesection}{0.5em}{}{}
\titleformat{\subsection}[hang]{\fHei \bf \sSHalfXiaosi}%
{\sSHalfXiaosi \thesubsection}{0.5em}{}{}
%\titleformat{\subsubsection}[hang]{\fHei \bf}% %普通的subsubsection:1.2.3.4 标题
% {\thesubsubsection }{0.5em}{}{}
\titleformat{\subsubsection}[hang]{\fHei \bf} %小标题式的subsubsection:(4) 标题
{(\arabic{subsubsection})}{0.5em}{}{}

{\sSHalfXiaosi \thesubsection}{0.5em}{}{}
\titleformat{\subsubsection}[hang]{\fHei \bf}%
{(\arabic{subsubsection})}{0.5em}{}{} % 小标题式的subsubsection:(4) 标题

% 缩小正文中各级标题之间的缩进
\titlespacing{\chapter}{0pt}{-3ex plus .1ex minus .2ex}{0.25em}
Expand All @@ -211,14 +194,13 @@
\titlespacing{\subsubsection}{0pt}{0.25em}{0pt}

% 定义目录中各级标题之间的格式以及缩进
% \dottedcontents{chapter}[0.0em]{\fHei\vspace{0.5em}}{0.0em}{5pt}
\dottedcontents{section}[1.16cm]{}{1.8em}{5pt}
\dottedcontents{subsection}[2.00cm]{}{2.7em}{5pt}
\dottedcontents{subsubsection}[2.86cm]{}{3.4em}{5pt}
\titlecontents{chapter}[0pt]{\fHei\vspace{0.5em}}%
{\contentsmargin{0pt}\fHei\makebox[0pt][l]{\chapterID{\thecontentslabel}}\hspace{3.8em}}%
{\contentsmargin{0pt}\fHei}%
{\titlerule*[.5pc]{.}\contentspage}[\vspace{0em}]
{\contentsmargin{0pt}\fHei\makebox[0pt][l]{\chapterID{\thecontentslabel}}\hspace{3.8em}}%
{\contentsmargin{0pt}\fHei}%
{\titlerule*[.5pc]{.}\contentspage}[\vspace{0em}]
%------------------------------------------------------------------------------%


Expand All @@ -234,16 +216,13 @@
}
\makeatletter
\renewcommand{\headrule}{%
{
\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi
\makeheadrule
}
}
{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi\makeheadrule}}
\pagestyle{fancyplain}
\fancyhf{}
\fancyfoot[C,C]{\sWuhao-~\thepage~-}
% 后续文字可以自行修改
\chead{\sSanhao\raisebox{0.04cm}{ \fNWPU 西北工业大学} \fSong{{\textbf{本科毕业设计论文} }}}
\chead{\sSanhao\raisebox{0.04cm}%
{ \fNWPU 西北工业大学} \fSong{{\textbf{本科毕业设计论文} }}}
%------------------------------------------------------------------------------%


Expand Down Expand Up @@ -271,44 +250,40 @@

% \newitemsep
% 下划线
\newcommand\dlmu@underline[2][5cm]{\hskip1pt\underline{\hb@xt@ #1{\hss#2\hss}}\hskip3pt}
\newcommand\dlmu@underline[2][5cm]%
{\hskip1pt\underline{\hb@xt@ #1{\hss#2\hss}}\hskip3pt}
\let\coverunderline\dlmu@underline
%------------------------------------------------------------------------------%



%----------------------------------添加代码控制--------------------------------%
\usepackage{listings}
\lstset{
basicstyle=\footnotesize\ttfamily,
%numbers=left,
%numberstyle=\tiny,
%numbersep=5pt,
numbers=left,
numberstyle=\tiny,
numbersep=5pt,
tabsize=4,
extendedchars=true,
breaklines=true,
keywordstyle=\color{blue},
keywordstyle=\color{blue}\bfseries,
numberstyle=\color{purple},
commentstyle=\color{olive},
stringstyle=\color{orange}\ttfamily,
commentstyle=\color[rgb]{0, 0.4, 0}\bfseries,
stringstyle=\color{violet}\ttfamily\bfseries,
rulesepcolor=\color{red!20!green!20!blue!20},
showspaces=false,
showtabs=false,
frame=shadowbox,
framexrightmargin=5pt,
framexbottommargin=4pt,
showstringspaces=false
showstringspaces=false,
escapeinside=`', %逃逸字符(1左面的键),用于显示中文
}
\renewcommand{\lstlistingname}{CODE}
\lstloadlanguages{% Check Dokumentation for further languages, page 12
Pascal, C++, Java, Ruby, Python, Matlab, R
Pascal, C++, Java, Ruby, Python, Matlab, R, Haskell
}
%------------------------------------------------------------------------------%

\renewcommand\arraystretch{1.4}
\renewcommand{\thefigure}{\thechapter-\arabic{figure}}
\renewcommand{\thetable}{\thechapter-\arabic{table}}
\captionsetup[table]{labelfont=bf,textfont=bf}
\graphicspath{{figures/}}

\endinput
% 这是简单的 thesis(article) 的导言区设置,不能单独编译。
% 这是简单的 thesis(book) 的导言区设置,不能单独编译。

0 comments on commit f576e89

Please sign in to comment.