Skip to content

Commit

Permalink
implement for the difference
Browse files Browse the repository at this point in the history
  • Loading branch information
e71828 committed Mar 30, 2023
1 parent f14d258 commit 0845122
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 53 deletions.
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# https://www.toptal.com/developers/gitignore can generate .gitignore for many filetypes
Tmp/
.idea/
*.acn
*.acr
*.alg
*.aux
*.bbl
*.blg
*.dvi
*.glg
*.glo
*.gls
*.idx
*.ilg
*.ind
*.ist
*.lof
*.log
*.lot
*.maf
*.mtc
*.mtc1
*.out
*.synctex.gz
*.toc
*.pdf
43 changes: 23 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
# nputhesis
西北工业大学学位论文 LaTeX 模板 LaTeX Thesis Template for NPU (静待官方模板)
## TODO
- `Keywords` 改为 `Key Words`
- 文中字体行距:修改 `cls` 中的 `linespread`;小四字体字宽为12 pt,字高约为1.25倍的字宽,拉伸系数为1.389。
- 目录行距:修改 `thesis.tex` 中的 `linespread`
- 章文距离:修改 `cls` 中的 `parskip`
- 目录额外距离: 修改 `cls` 中的`chaptervspace`
- 题注字体;修改 `sty` 中的 `caption`
- 层级标题:修改 `cls` 中的 `structure layout` 部分;
- 文献字体:修改 `sty` 中的 `bibfont`
- 文武线:修改 `sty` 中的 `headrule`,例 `\renewcommand{\headrule}{\hrule width\headwidth height3.4pt \vspace{0.9pt} \hrule width\headwidth height0.6pt}`
- 设置奇数页的页眉文字:修改 `cls` 中的 `\@tile`,例 `\def\@title{\ucas@value@ch@school \ucas@label@ch@thesis@mas}`
- 页面宽度:修改 `cls` 中的 `textwidth`,例 `\setlength{\textwidth}{160mm}`
- 页边距:修改 `cls` 中的 `oddsidemargin``evensidemargin`,例 `0``-0.8`,或 `-0.4``-0.4`
- 页眉英文是否大写: 修改 `cls` 中的 `titlemark`, 使得 `{\MakeUppercase{#1}}}`
- 融合插入 pdf 页面:在 `Thesis.tex` 中引入 `pdfpages`
- 封面:`Frontmatter` 封面处添加 `\includepdf[pages={1-8}]{NPUstyle/yanputhesis-sample.pdf}`
- 声明:`Thesis.tex` 添加 `\AtEndDocument{\includepdf[pages={last}]{NPUstyle/yanputhesis-sample}}`
- 题注和公式的连字符,在导言区添加:
- `\patchcmd\thefigure {.}{-} {}{\fail}`
- `\patchcmd\thetable {.}{-} {}{\fail}`
- `\patchcmd\theequation {.}{-} {}{\fail}`
- [x] 关键字:`cfg` 中的 `Keywords` 改为 `Key Words`
- [x] 文中字体行距:修改 `cls` 中的 `linespread`;小四字体字宽为12 pt,字高约为1.25倍的字宽,拉伸系数为1.389。
- [x] 目录行距:修改 `thesis.tex` 中的 `linespread`
- [x] 章文距离:修改 `cls` 中的 `parskip`
- [x] 目录额外距离: 修改 `cls` 中的`chaptervspace`
- [x] 题注字体;修改 `sty` 中的 `caption`
- [x] 层级标题:修改 `cls` 中的 `structure layout` 部分;
- [x] 文献字体:修改 `sty` 中的 `bibfont`
- [x] 文武线:修改 `sty` 中的 `headrule`,例 `\renewcommand{\headrule}{\hrule width\headwidth height3.4pt \vspace{0.9pt} \hrule width\headwidth height0.6pt}`
- [x] 设置奇数页的页眉文字:修改 `cls` 中的 `\@title`,例 `\def\@title{\ucas@value@ch@school \ucas@label@ch@thesis@mas}`
- [x] 页面宽度:修改 `cls` 中的 `textwidth`,例 `\setlength{\textwidth}{160mm}`
- [x] 页边距:修改 `cls` 中的 `oddsidemargin``evensidemargin`,例 `0``-0.8`,或 `-0.4``-0.4`
- [x] 页眉英文是否大写: 修改 `cls` 中的 `titlemark`, 使得 `{\MakeUppercase{#1}}}`
- [x] 融合插入 pdf 页面:在 `Thesis.tex` 中引入 `pdfpages`
- [x] 封面:`Frontmatter` 封面处添加 `\includepdf[pages={1-8}]{NPUstyle/yanputhesis-sample.pdf}`
- [x] 声明:`Thesis.tex` 添加 `\AtEndDocument{\includepdf[pages={last}]{NPUstyle/yanputhesis-sample}}`
- [x] 题注和公式的连字符,在导言区添加:

```tex
\patchcmd\thefigure {.}{-} {}{\fail}
\patchcmd\thetable {.}{-} {}{\fail}
\patchcmd\theequation {.}{-} {}{\fail}
```


## 源自 `ucasthesis` 国科大学位论文 LaTeX 模板
Expand Down
5 changes: 3 additions & 2 deletions Style/artratex.sty
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@
%-> Figure environment support
%-
\RequirePackage{graphicx}% packages for including graphics
\RequirePackage[format=plain,hangindent=2.0em,font={small,bf},skip=8pt,labelsep=space]{caption}% options: [margin=10pt,labelfont=bf]
\RequirePackage[format=plain,hangindent=2.0em,font={small},skip=8pt,labelsep=space]{caption}% options: [margin=10pt,labelfont=bf]
\RequirePackage{subcaption}% package for subfigures
\RequirePackage[list=off]{bicaption}% package for binary captions
\DeclareCaptionOption{bi-first}[]{}% 1st language
Expand Down Expand Up @@ -686,7 +686,7 @@
%\setlength\bibitemsep{0.5\baselineskip}% set distance between entries
\setlength\bibitemsep{0.0ex plus 0.2ex minus 0.2ex}% set distance between entrie
\fi
\renewcommand*{\bibfont}{\small}% set font size for bibliography
\renewcommand*{\bibfont}{\normalsize}% set font size for bibliography
%-
%-> Page header and footer Style
%-
Expand Down Expand Up @@ -716,6 +716,7 @@
\fancyfoot[C]{\footnotesize \thepage}% page number
\renewcommand{\headrulewidth}{0.8pt}% header rule
\renewcommand{\footrulewidth}{0pt}% footer rule
\renewcommand{\headrule}{\hrule width\headwidth height3.4pt \vspace{0.9pt} \hrule width\headwidth height0.6pt}%
}
\fancypagestyle{mainmatterstyle}{% style for mainmatter
\fancyhf{}% clear fields
Expand Down
4 changes: 2 additions & 2 deletions Style/ucasthesis.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
\def\ucas@label@ch@submitdate{报告提交日期}
\def\ucas@label@ch@studydatefrom{研究工作起始时间}
\def\ucas@label@ch@studydateto{研究工作期满时间}
\def\ucas@value@ch@school{中国科学院大学}
\def\ucas@value@ch@school{西北工业大学}
\def\ucas@value@ch@academy{中国科学院}
\def\ucas@value@ch@orginization{人事部}
%---------------------------------------------------------------------------%
Expand Down Expand Up @@ -104,7 +104,7 @@
\def\ucas@label@ch@proofname{证明}
\def\ucas@label@en@proofname{Proof}
\def\ucas@label@ch@keywords{关键词:}
\def\ucas@label@en@keywords{Keywords:}
\def\ucas@label@en@keywords{Key Words:}
%---------------------------------------------------------------------------%
%->> Author's declaration
%---------------------------------------------------------------------------%
Expand Down
52 changes: 27 additions & 25 deletions Style/ucasthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@
%- binding side width of [odd, even] page = [left, right] side width
%- left side width of [odd, even] page = 1.0in (fixed) + hoffset + [odd, even]sidemargin
%- assuming A4 paper (210mm x 297mm)
\setlength{\textwidth}{146.6mm}% set required text width first
\setlength{\textwidth}{160mm}% set required text width first
\setlength{\hoffset}{0mm}% set horizontal offset
\ifucas@print% if print layout enabled
\setlength{\oddsidemargin}{12.6mm}% binding side margin
\setlength{\evensidemargin}{0mm}% ensure uniform binding side width for printing
\setlength{\oddsidemargin}{0mm}% binding side margin
\setlength{\evensidemargin}{-0.8mm}% ensure uniform binding side width for printing
\else
\setlength{\oddsidemargin}{6.3mm}% left side margin
\setlength{\evensidemargin}{6.3mm}% ensure uniform left side width for EThesis
\setlength{\oddsidemargin}{-0.4mm}% left side margin
\setlength{\evensidemargin}{-0.4mm}% ensure uniform left side width for EThesis
\fi
\setlength{\marginparwidth}{35pt}% width of margin notes
\setlength{\marginparsep}{10pt}% width of space between body text and margin notes
Expand All @@ -128,9 +128,9 @@
\setlength{\headsep}{17.5pt}% vertical margin between header and body text
\setlength{\footskip}{10.4mm}% vertical margin between footer and body text
%- specifies the amount of space between paragraphs.
\setlength{\parskip}{0.5ex plus 0.25ex minus 0.25ex}
\setlength{\parskip}{0ex plus 0.25ex minus 0.25ex}
%- line spacing
\linespread{1.6}% line space setting
\linespread{1.389}% line space setting
\raggedbottom% prevent adding vertical white space in strange places
%- default pagestyle is page number at bottom without headers and footers
\pagestyle{plain}
Expand Down Expand Up @@ -575,7 +575,8 @@
\def\examplename{\ucas@label@en@examplename}
\def\remarkname{\ucas@label@en@remarkname}
\def\proofname{\ucas@label@en@proofname}
\def\@title{\ucas@value@en@titlemark}
% \def\@title{\ucas@value@en@titlemark}
\def\@title{\ucas@value@ch@school \ucas@label@ch@thesis@mas}
\def\@author{\ucas@value@en@author}
\else
\def\contentsname{\ucas@label@ch@tocname}
Expand All @@ -597,7 +598,8 @@
\def\examplename{\ucas@label@ch@examplename}
\def\remarkname{\ucas@label@ch@remarkname}
\def\proofname{\ucas@label@ch@proofname}
\def\@title{\ucas@value@ch@titlemark}
% \def\@title{\ucas@value@en@titlemark}
\def\@title{\ucas@value@ch@school \ucas@label@ch@thesis@mas}
\def\@author{\ucas@value@ch@author}
\fi
%---------------------------------------------------------------------------%
Expand All @@ -606,45 +608,45 @@
%- chapter
\ctexset {
chapter = {
format = \linespread{1.0}\zihao{4}\bfseries\sffamily\centering,
format = \linespread{1.389}\zihao{3}\sffamily\centering,
nameformat = {},
titleformat = {},
number = \arabic{chapter},
numberformat = \rmfamily,
aftername = \quad,
beforeskip = {7pt},
afterskip = {18pt},
beforeskip = {2.5pt},
afterskip = {12pt},
pagestyle = plain,
}
}
%- section
\ctexset {
section = {
format = \linespread{1.0}\zihao{-4}\sffamily\raggedright,
format = \linespread{1.389}\zihao{4}\sffamily\raggedright,
numberformat = \rmfamily,
aftername = \quad,
beforeskip = {24pt},
afterskip = {6pt},
beforeskip = {10pt},
afterskip = {0pt},
}
}
%- subsection
\ctexset {
subsection = {
format = \linespread{1.0}\zihao{-4}\sffamily\raggedright,
format = \linespread{1.389}\zihao{-4}\sffamily\raggedright,
numberformat = \rmfamily,
aftername = \quad,
beforeskip = {12pt},
afterskip = {6pt},
beforeskip = {10pt},
afterskip = {0pt},
}
}
%- subsubsection
\ctexset {
subsubsection = {
format = \linespread{1.0}\zihao{-4}\sffamily\raggedright,
format = \linespread{1.389}\zihao{-4}\sffamily\raggedright,
numberformat = \rmfamily,
aftername = \quad,
beforeskip = {12pt},
afterskip = {6pt},
beforeskip = {10pt},
afterskip = {0pt},
}
}
%- appendix
Expand All @@ -671,7 +673,7 @@
\def\@dotsep{1.5mu}% separation between dots in mu units
\def\@pnumwidth{2em}% width of a box in which the page number is put
\def\@tocrmarg{2em}% right margin for multiple line entries, \@tocrmarg ≥ \@pnumwidth
\def\@chaptervspace{1ex}% vertical space between chapter titles
\def\@chaptervspace{0ex}% vertical space between chapter titles

%- redefine dottedtocline from classes.dtx and latex.ltx
\renewcommand*{\@dottedtocline}[5]{% [<level>,<indent>,<numwidth>,<title>,<page>]
Expand All @@ -680,7 +682,7 @@
{\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
\parindent #2\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode \zihao{-4}\sffamily
\leavevmode \zihao{-4}\rmfamily
\@tempdima #3\relax
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{#4}\nobreak
Expand All @@ -700,7 +702,7 @@
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
{\leavevmode
\zihao{4}\sffamily #1
\zihao{-4}\rmfamily #1
\leaders\hbox{$\m@th\mkern \@dotsep \cdot\mkern \@dotsep$}% add dotted toc line
\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
\nobreak
Expand All @@ -718,7 +720,7 @@
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \zihao{4}\sffamily
\leavevmode \zihao{-4}\rmfamily
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak
Expand Down
7 changes: 4 additions & 3 deletions Tex/Frontmatter.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
%-
%-> 生成封面
%-
\maketitle% 生成中文封面
\MAKETITLE% 生成英文封面
%\maketitle% 生成中文封面
%\MAKETITLE% 生成英文封面
\includepdf[pages={1-8}]{NPUstyle/yanputhesis-sample.pdf}
%-
%-> 作者声明
%-
\makedeclaration% 生成声明页
%\makedeclaration% 生成声明页
%-
%-> 中文摘要
%-
Expand Down
7 changes: 6 additions & 1 deletion Thesis.tex
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
%- [math]% enable some extra math packages
%- [xlink]% disable link colors
\usepackage{Style/artracom}% user defined commands
\usepackage{pdfpages}
\AtEndDocument{\includepdf[pages={last}]{NPUstyle/yanputhesis-sample}}
\patchcmd\thefigure {.}{-} {}{\fail}
\patchcmd\thetable {.}{-} {}{\fail}
\patchcmd\theequation {.}{-} {}{\fail}

%---------------------------------------------------------------------------%
%->> Document inclusion
Expand All @@ -60,7 +65,7 @@
\frontmatter% initialize the environment
\input{Tex/Frontmatter}% title page, abstract
% content list region
\linespread{1.2}% local line space
\linespread{1.389}% local line space
\intobmk*{\cleardoublepage}{\contentsname}% add link to bookmark
\tableofcontents% content catalog
\intobmk*{\cleardoublepage}{\listfigurename}% add link to bookmark
Expand Down

0 comments on commit 0845122

Please sign in to comment.