Skip to content

Commit

Permalink
New Release
Browse files Browse the repository at this point in the history
  • Loading branch information
HuangruiMo committed Feb 4, 2018
1 parent 95e6948 commit 6a80d63
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 78 deletions.
11 changes: 6 additions & 5 deletions README.md
Expand Up @@ -13,19 +13,19 @@ Clone or download -> Download Zip

* 考虑到大多数用户并无 LaTeX 使用经验,本模板将 LaTeX 的复杂性尽可能地进行了封装,开放出简单的接口,以便于使用者可以轻易地使用。同时,对使用 LaTeX 撰写论文所遇到的一些主要难题,如插入图片、文献索引等,进行了详细的说明,并提供了相应的代码样本,理解了上述问题后,对于初学者而言,使用此模板撰写其学文论文将不存在实质性的困难。所以,如果您是初学者,请不要直接放弃,因为同样作为初学者的我,十分明白让 LaTeX 变得简单易用的重要性,而这正是本模板所体现的。

* 此中国科学院大学学位论文模板 ucasthesis 基于中科院数学与系统科学研究院吴凌云研究员的 CASthesis 模板发展而来。当前 ucasthesis 模板满足最新的中国科学院大学学位论文撰写要求和封面设定。模板兼顾不同操作系统 (Windows, Linux, Mac OS) 并兼容 pdflatex 和 xelatex 编译方式,完美地支持中文书签、中文渲染、中文粗体显示、拷贝 PDF 中的文本到其他文本编辑器等特性,此外,对模板的文档结构进行了精心设计,撰写了编译脚本提高模板的易用性和使用效率。
此中国科学院大学学位论文模板 ucasthesis 基于中科院数学与系统科学研究院吴凌云研究员的 CASthesis 模板发展而来。当前 ucasthesis 模板满足最新的中国科学院大学学位论文撰写要求和封面设定。模板兼顾不同操作系统 (WindowsLinux,MacOS) 和 LaTeX 编译引擎(pdflatex,xelatex,lualatex),完美地支持中文书签、中文渲染、中文粗体显示、拷贝 PDF 中的文本到其他文本编辑器等特性,此外,对模板的文档结构进行了精心设计,撰写了编译脚本提高模板的易用性和使用效率。

* 宏包的目的是简化学位论文的撰写,模板文档的默认设定是十分规范的,从而论文作者可以将精力集中到论文的内容上,而不需要在版面设置上花费精力。 同时,在编写模板的 LaTeX 文档代码过程中,作者对各结构和命令进行了十分详细的注解,并提供了整洁一致的代码结构,对文档的仔细阅读可以为初学的您提供一个学习 LaTeX 的窗口。除此之外,整个模板的架构十分注重通用性,事实上,本模板不仅是中国科学院大学学文论文模板,同时,也是使用 LaTeX 撰写中英文 Article 或 Book 的通用模板,并为使用者的个性化设定提供了接口和相应的代码。

* 此模板有着完善的定期维护,时刻追踪学校官方的规则发布和用户的使用反馈。提供了简单明了的**模板使用说明.pdf**。无论你是否具有 LaTeX 使用经验,都可轻松使用该模板完成学位论文的撰写和排版。

## 重要通知

* `2018-01-30` 模板样式进行了修改,请查看下面的修改描述,以决定是否需要更新。
* `2018-02-04` 模板样式进行了修改,请查看下面的修改描述,以决定是否需要更新。

## 更新记录

* `2018-02-03` 提供了关于 Windows,Linux,MacOS 的字体调用和字体加粗异常的解决方案,修改的文件为:模板使用说明.pdf
* `2018-02-04` 在ctex开发人员的帮助下修复了错用字体调用命令导致的宋体加粗异常。然后,将模板扩展为兼容操作系统 Windows,Linux,MacOS 和 LaTeX 编译引擎 pdflatex,xelatex,lualatex。修改的文件为:artratex.sty,ucasthesis.cfg,ucasthesis.cls

* `2018-02-02` 回答 LaTeX 初级用户的一些软件使用问题,修改的文件为:模板使用说明.pdf。

Expand Down Expand Up @@ -57,14 +57,15 @@ Clone or download -> Download Zip

## 用户指南

模板每次发布前,都已在 Windows,Linux,MacOS 系统的最近两个发行版的 Texlive 上测试通过。下载模板后,若编译出现错误,则请遵从如下的用户指南:
模板每次发布前,都已在 Windows,Linux,MacOS 系统上测试通过。下载模板后,若编译出现错误,则请遵从如下的用户指南:

* 请仔细阅读并理解“模板使用说明.pdf”文档,根据说明文档的引导对模板进行测试。
* 按照 `模板使用说明.pdf` 的 `先试试效果` 一节提供的方法编译模板,若出现错误,则原因可能为:
1. 路径中存在特殊字符:请确保软件的安装路径以及模板路径中不存在奇怪的字符,
尽量避免在路径中使用中文字符和空格。
2. LaTeX 编译系统安装失败:请暂时抛开 ucasthesis,而是测试一个基本的中文
LaTeX 文档,若编译无法通过,则请卸载并重新安装编译软件的最新版本。
注:安装完 MikTeX 后须在 CMD 内运行 `initexmf --mkmaps` 才能正常使用 pdflatex。
3. LaTeX 编译系统缺乏必要的宏包或字体:编译生成的 `.log` 文件会给出
缺乏的宏包或字体的名称和错误提示。并且编译过程中一般会提示是否自动下载,
请选择自动下载,即可解决大部分宏包缺乏的问题。若没能自动下载,
Expand All @@ -75,6 +76,6 @@ Clone or download -> Download Zip
则是你的编译系统版本过旧或是其宏包库太久没有更新,
请或是更新宏包库或是卸载安装最新版本。
* 使用脚本编译无错,但使用 LaTeX 文本编辑器时编译出现异常:
1. 请确保你选择了正确的文本编译器:xelatex(推荐)或 pdflatex
1. 请确保你选择了正确的文本编译器:xelatex(推荐)或 pdflatex 或 lualatex(推荐)
2. 请确保你选择了正确的文献编译器:bibtex
* 若按照上述步骤仍无法解决问题,请将你编译生成的完整的 `.log` 文件反馈。
77 changes: 46 additions & 31 deletions Style/artratex.sty
Expand Up @@ -17,7 +17,13 @@
%->> Declare options
%---------------------------------------------------------------------------%
%-
%-> Bibliography processor and package
%-> LaTeX engine <pdflatex>, <lualatex>, <xelatex>
%-
\newif\ifARTRATEX@pdftex \ARTRATEX@pdftexfalse
\newif\ifARTRATEX@luatex \ARTRATEX@luatexfalse
\newif\ifARTRATEX@xetex \ARTRATEX@xetexfalse
%-
%-> Bibliography engine <bibtex>, <biber>
%-
\newif\ifARTRATEX@bibtex \ARTRATEX@bibtextrue
\newif\ifARTRATEX@biber \ARTRATEX@biberfalse
Expand Down Expand Up @@ -140,32 +146,49 @@
%->> Required packages
%---------------------------------------------------------------------------%
%-
%-> Engine depended settings
%-
\RequirePackage{ifxetex,ifluatex}%
\ifxetex%
\ARTRATEX@xetextrue
\else\ifluatex%
\ARTRATEX@luatextrue
\else%
\ARTRATEX@pdftextrue
\fi\fi%
%-
%-> Language settings
%-
\RequirePackage{ifxetex,ifpdf}% packages and settings depending on PDF mode
\ifxetex% running xelatex in PDF mode: call system fonts
\RequirePackage{fontspec}% support calling system fonts
%\defaultfontfeatures{Ligatures=TeX}% set quoting style
%- Set English fonts
%- Roman or Serif - typefaces with strokes, for main contents
%- examples: Times New Roman, Garamond, Adobe Garamond Pro
%\setmainfont[BoldFont=Garamond-Bold,ItalicFont=Garamond-Italic]{Garamond}% set \rmfamily
%- due to \renewcommand*{\familydefault}{\rmdefault}, it also sets \normalfont
%- Sans serif - typefaces without strokes, for heading demanding high readability
%- examples: Helvetica, Gill Sans, Futura
%\setsansfont{Gill Sans MT}% set \sffamily
%- Monospaced - typefaces with same width, for programming, tabulated data, etc
%- examples: Rockwell, Andale Mono, Courier, Monaco
%\setmonofont{Rockwell}% set \ttfamily
\fi
\ifpdf% running pdflatex in PDF mode: call font packages
\ifARTRATEX@pdftex% <pdflatex> call font packages
\RequirePackage[utf8]{inputenc}% set input encoding, document must use utf-8 encoding
\RequirePackage[T1]{fontenc}% set font encoding to enable modern font encoding
%- Call font package options:
%- Text + Math: Adobe Times Roman (Recommended)
\RequirePackage{newtxtext,newtxmath}%
%- Text + Math: Palatino
%\RequirePackage{palatino}%
\else% <xelatex> or <lualatex> call system fonts
\RequirePackage{fontspec}% support calling system fonts
%- Font properties: <family> + <weight> + <shape> + <size>
%- Specify the three default TeX font families: <main>, <sans>, <mono>
%- \setxxxxfont{<font>}[BoldFont=<font-b>,ItalicFont=<font-i>]%
%- <font>: \mdseries\upshape; <font-b>: \bfseries\upshape; <font-i>: \mdseries\itshape
%- <\lfseries|\mdseries|\bfseries>: weight of font, default <\mdseries>
%- <\upshape|\itshape|\scshape>: shape of font, default <\upshape>
%- Roman or Serif - typefaces with strokes - for main content
%- examples: Times New Roman, Garamond, Adobe Garamond Pro
%\setmainfont{Garamond}[BoldFont=Garamond-Bold,ItalicFont=Garamond-Italic]%
%- font switches: {\rmfamily ...}, \textrm{...}, {\normalfont ...}, \textnormal{...}
%- the latter is due to \renewcommand*{\familydefault}{\rmdefault}
%- Sans serif - typefaces without strokes - for headings demanding high readability
%- examples: Helvetica, Gill Sans, Futura
%\setsansfont{Gill Sans MT}% font switches: {\sffamily ...}, \textsf{...}
%- Monospaced - typefaces with same width - for programming, etc
%- examples: Rockwell, Andale Mono, Courier
%\setmonofont{Rockwell}% font switches: {\ttfamily, ...}, \texttt{...}
%- Specify user-defined font families and font switches
%\newfontfamily\<font-switch>{<font>}[<font features>]%
%\newcommand{\text<font-switch>}[1]{{\<font-switch> #1}}%
\fi
%-
%-> Bibliography processor and package
Expand Down Expand Up @@ -295,16 +318,10 @@
%-
%-> Links support
%-
\ifxetex% running xelatex in PDF mode
\RequirePackage[xetex]{hyperref}%
\else
\ifpdf% running pdflatex in PDF mode
\RequirePackage[pdftex]{hyperref}%
\fi
\fi
\RequirePackage{hyperref}%
\hypersetup{% set hyperlinks
%bookmarks=true,% show bookmarks bar
unicode=true,% allows non-Latin based languages in bookmarks
pdfencoding=auto,% allows non-Latin based languages in bookmarks
%pdftitle={},% title
%pdfauthor={},% author
%pdfsubject={},% subject
Expand All @@ -330,12 +347,10 @@
%- Declare graphic extensions for automatic selection when including graphics
%- via avoiding supplying graphic extensions in \includegraphics command,
%- the source file can be more general and adaptive
\ifxetex% running xelatex in PDF mode
\ifARTRATEX@xetex%
\DeclareGraphicsExtensions{.pdf,.png,.jpg,.eps,.tif,.bmp,.gif}%
\else
\ifpdf% running pdflatex in PDF mode
\DeclareGraphicsExtensions{.pdf,.png,.jpg}%
\fi
\else% <pdflatex> or <lualatex>
\DeclareGraphicsExtensions{.pdf,.png,.jpg}%
\fi
\graphicspath{{Img/}}% search path for figures
%-
Expand Down
8 changes: 4 additions & 4 deletions Style/ucasthesis.cfg
Expand Up @@ -103,7 +103,7 @@
%- chapter
\ctexset {
chapter = {
format = \bfseries\zihao{4}\heiti\centering,
format = \zihao{4}\bfseries\sffamily\centering,
number = \arabic{chapter},
aftername = \quad,
beforeskip = {0pt},
Expand All @@ -114,7 +114,7 @@
%- section
\ctexset {
section = {
format = \zihao{-4}\heiti\raggedright,
format = \sffamily\raggedright,
aftername = \quad,
beforeskip = {24pt},
afterskip = {6pt},
Expand All @@ -123,7 +123,7 @@
%- subsection
\ctexset {
subsection = {
format = \zihao{-4}\heiti\raggedright,
format = \sffamily\raggedright,
aftername = \quad,
beforeskip = {12pt},
afterskip = {6pt},
Expand All @@ -132,7 +132,7 @@
%- subsubsection
\ctexset {
subsubsection = {
format = \zihao{-4}\heiti\raggedright,
format = \sffamily\raggedright,
aftername = \quad,
beforeskip = {12pt},
afterskip = {6pt},
Expand Down
35 changes: 17 additions & 18 deletions Style/ucasthesis.cls
Expand Up @@ -69,6 +69,7 @@
%---------------------------------------------------------------------------%
\RequirePackage[usenames,dvipsnames,table]{xcolor}% color packages
\RequirePackage{amsmath,amssymb,amstext}% math packages
\RequirePackage{ulem}% underline package
%---------------------------------------------------------------------------%
%->> Load class configuration
%---------------------------------------------------------------------------%
Expand Down Expand Up @@ -120,10 +121,10 @@
\hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi%
}
%- underline
\renewcommand{\CJKunderlinecolor}{\color[rgb]{0,0,0}}% set underline color
%\renewcommand{\CJKunderlinecolor}{\color[rgb]{0,0,0}}% set underline color
\newcommand{\ulenhance}[2][1pt]{% enhanced underline
\def\ULthickness{#1}% redefine thickness
\CJKunderline{#2}}
\uline{#2}}
\newcommand{\ulhshift}{-3em}% horizontal shift on underline
\newcommand{\ulextend}[2][350pt]{% extend underline length
\hbox to #1{\hfill\hspace*{\ulhshift}#2\hfill}}
Expand Down Expand Up @@ -155,9 +156,9 @@
\cleardoublepage
\thispagestyle{empty}
\begin{center}
\bfseries\zihao{4}\songti
\zihao{4}\bfseries
\ifUCAS@mjinfo
\hfill{} {\bfseries\zihao{4}\songti\UCAS@label@confidential \ulenhance{\ulextend[50pt]{\hspace*{-\ulhshift}\zihao{5}\songti\UCAS@value@confidential}}}
\hfill{} {\UCAS@label@confidential \ulenhance{\ulextend[50pt]{\hspace*{-\ulhshift}\zihao{5}\UCAS@value@confidential}}}
\else
\hfill{} {}
\fi
Expand All @@ -168,18 +169,17 @@

\vspace*{\stretch{2}}

{\bfseries\zihao{1}\heiti \ulenhance[2.5pt]{\UCAS@value@degree\UCAS@label@thesis}}
{\zihao{1}\bfseries\sffamily \ulenhance[2.5pt]{\UCAS@value@degree\UCAS@label@thesis}}

\vspace*{\stretch{3}}

{\bfseries\zihao{-3}\heiti \ulenhance[1.5pt]{\ \UCAS@value@title\ }}
{\zihao{-3}\bfseries\sffamily \ulenhance[1.5pt]{\ \UCAS@value@title\ }}

\vspace*{\stretch{3}}

\def\tabcolsep{1pt}
\def\arraystretch{1.4}
\begin{tabular}{lc}
\bfseries\zihao{4}\songti
\UCAS@label@author & \ulenhance[1.2pt]{\ulextend{\UCAS@value@author}}\\
\UCAS@label@advisor & \ulenhance[1.2pt]{\ulextend{\UCAS@value@advisor}}\\
& \ulenhance[1.2pt]{\ulextend{\UCAS@value@advisorsec}}\\
Expand All @@ -190,7 +190,7 @@

\vspace*{\stretch{5}}

{\bfseries\zihao{4}\songti\UCAS@value@chinesedate}
{\UCAS@value@chinesedate}

\vspace*{\stretch{3}}
\end{center}
Expand Down Expand Up @@ -236,11 +236,11 @@
\thispagestyle{empty}
\begin{center}
\linespread{1.5}
\bfseries\zihao{4}
\zihao{4}\bfseries

\vspace*{50pt}

{\bfseries\zihao{-3} \ulenhance[1.5pt]{\ \UCAS@value@englishtitle\ }}
{\zihao{-3}\bfseries \ulenhance[1.5pt]{\ \UCAS@value@englishtitle\ }}

\vspace*{\stretch{2}}

Expand Down Expand Up @@ -276,12 +276,11 @@
\thispagestyle{empty}
{
\linespread{1.5}
\zihao{-4}\songti

\vspace*{2ex}

\begin{center}
{\bfseries\zihao{4}\heiti \UCAS@value@declare@create}
{\zihao{4}\bfseries\sffamily \UCAS@value@declare@create}
\end{center}

{\UCAS@value@declare@creativity}
Expand All @@ -295,7 +294,7 @@
\vspace*{6ex}

\begin{center}
{\bfseries\zihao{4}\heiti \UCAS@value@declare@right}
{\zihao{4}\bfseries\sffamily \UCAS@value@declare@right}
\end{center}

{\UCAS@value@declare@rights}
Expand All @@ -321,10 +320,10 @@
%---------------------------------------------------------------------------%
%- define chinese keywords
\newcommand{\keywords}[1]{%
\noindent {\bfseries\zihao{-4}\songti \UCAS@label@keywords} #1}
\noindent {\bfseries \UCAS@label@keywords} #1}
%- define engish keywords
\newcommand{\englishkeywords}[1]{%
\noindent {\bfseries\zihao{-4} \UCAS@label@englishkeywords} #1}
\noindent {\bfseries \UCAS@label@englishkeywords} #1}
%---------------------------------------------------------------------------%
%->> Configure table of contents
%---------------------------------------------------------------------------%
Expand All @@ -340,7 +339,7 @@
{\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
\parindent #2\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode \zihao{-4}\heiti
\leavevmode \zihao{-4}\sffamily
\@tempdima #3\relax
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{#4}\nobreak
Expand All @@ -360,7 +359,7 @@
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
{\leavevmode
\large \bfseries #1
\zihao{4}\sffamily #1
\leaders\hbox{$\m@th\mkern \@dotsep \cdot\mkern \@dotsep$}% add dotted toc line
\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
\nobreak
Expand All @@ -378,7 +377,7 @@
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \zihao{4}\heiti
\leavevmode \zihao{4}\sffamily
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak
Expand Down

0 comments on commit 6a80d63

Please sign in to comment.