Skip to content

Commit

Permalink
titleformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Lujia-Bai committed May 31, 2020
1 parent 1542d73 commit e098357
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 38 deletions.
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"latex-workshop.view.pdf.external.viewer.command": "/usr/local/bin/displayline",
"latex-workshop.view.pdf.external.viewer.args": [
"0",
"%PDF%"
]
}
53 changes: 28 additions & 25 deletions SUFEThesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
\RequirePackage{kvdefinekeys}
\RequirePackage{kvsetkeys}
\RequirePackage{kvoptions}
%%%%%%%%%%从setup文件中读参数%%%%%%%%
\SetupKeyvalOptions{
family=sufe,
prefix=sufe@,
Expand Down Expand Up @@ -81,7 +82,6 @@
}%
}


\sufe@define@key{
title,
author,
Expand All @@ -90,18 +90,11 @@
discipline,
supervisor,
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%Preliminary definitions, needed by the options
\LoadClass[]{ctexart}
\RequirePackage{xcolor}
% \RequirePackage{greycolour}{HTML}{525252}
% \RequirePackage{sharelatexcolour}{HTML}{882B21}
% \RequirePackage{mybluecolour}{HTML}{394773}
%\RequirePackage{inputenc}



\RequirePackage{fontenc}
\RequirePackage{geometry}
\RequirePackage{changepage}
Expand All @@ -127,20 +120,37 @@

%%Body of the class, most of the declarations appear here.

\newcommand{\titleformat}{

\ctexset{
section = {
name={,、 },number={\chinese{section}},format={\centering\heiti\zihao{3}},afterskip={2ex},beforeskip={2ex}, aftername={}
},%出来是 一、标题
subsection = {
name={(,)},number={\chinese{subsection}},format={\heiti\zihao{4}},afterskip={2ex},beforeskip={2ex},aftername={ }
},%出来是 (一) 标题
subsubsection = {
name={,.},number=\arabic{subsubsection},format={\heiti\zihao{5}},afterskip={2ex},beforeskip={2ex},aftername={ }
}%出来是 1.标题
}

}
%%%%%%%%%%%%%%%%%%一些小细节%%%%%%%%%%%%%%%
\numberwithin{figure}{section}% 图片计数是以section为单位,第4章第n个图的意思
\numberwithin{table}{section}%同上

\setmainfont{Arial}
\geometry{a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm}
\renewcommand{\abstractnamefont}{\heiti\zihao{3}}%读汉语拼音就知道在写啥了,摘要标题黑体3号
\renewcommand{\abstracttextfont}{\songti\zihao{4}}%读汉语拼音就知道在写啥了,摘要内容宋体4号

%%%%%%%目录
\renewcommand{\contentsname}{\heiti \zihao{3} 目录~\\~\\}
\renewcommand{\baselinestretch}{1.6}
%就是一些目录里面空格的小问题, subsubsection的序号不要离标题太远
\titlecontents{subsubsection}[4em]{\zihao{5}}{\contentslabel{2ex}}{\hspace*{-2em}}{~\titlerule*[0.6pc]{$.$}~}

%%%%%%代码
%就定义一下代码颜色什么的,然后后面可以直接插入代码文件
\lstset{language=r,
numbers=left, %设置行号位置
Expand All @@ -163,6 +173,7 @@
\renewcommand\thefigure{\thesection-\arabic{figure}}%图4-1:%就是这种东西也要调
\renewcommand\thetable{\thesection-\arabic{table}}%表4-1:%就是这种东西也要调
%%%%%%%%%Define maketitle to output the cover page containing SUFE logo%%%%%%%%%%%%%%%%%%%
\renewcommand\maketitle{
\pagestyle{plain}
\thispagestyle{empty}
Expand Down Expand Up @@ -212,8 +223,6 @@
name = keywords@en,
},
}
\newcommand{\cabstractname}{摘要}
\newcommand{\eabstractname}{Abstract}
\RequirePackage{xparse}
\ExplSyntaxOn
Expand All @@ -231,26 +240,17 @@
}
\ExplSyntaxOff
% \newcommand\sufe@clist@use[2]{%
% \def\sufe@@tmp{}%
% \kv@set@family@handler{sufe@clist}{%
% % \ifx\sufe@@tmp\@empty
% % \def\sufe@@tmp{#2}%
% % \else
% % #2%
% % \fi
% {##1}%
% }%
% %\kvsetkeys@expandafter{sufe@clist}{}%
% \kvsetkeys{sufe@clist}{LaTeX, 1}%
% }
%%%%%%%%%%通过sufesetup命令可以读入关键字并格式化%%%%%
\newbox\sufe@kw
\newcommand\sufe@put@keywords[2]{%
\begingroup
\setbox\sufe@kw=\hbox{#1}
\box\sufe@kw#2\par
\endgroup}
%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%中文摘要%%%%%%%%%%%%%
\newcommand{\cabstractname}{摘要}
\renewenvironment{abstract}{%
% \sufe@chapter*[]{\cabstractname} % no tocline
\section*{\cabstractname}
Expand All @@ -259,6 +259,9 @@
\sufe@clist@use{\sufe@keywords}{;}%
}%
}
%%%%%%%%%%%%%英文摘要%%%%%%%%%%%%%
\newcommand{\eabstractname}{Abstract}
\newenvironment{abstract*}{%
\section*{\eabstractname}
}{%
Expand Down
Binary file added main.pdf
Binary file not shown.
Binary file added main.synctex.gz
Binary file not shown.
16 changes: 3 additions & 13 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@

\begin{document}

\ctexset{
section = {
name={,、 },number={\chinese{section}},format={\centering\heiti\zihao{3}},afterskip={2ex},beforeskip={2ex}, aftername={}
},%出来是 一、标题
subsection = {
name={(,)},number={\chinese{subsection}},format={\heiti\zihao{4}},afterskip={2ex},beforeskip={2ex},aftername={ }
},%出来是 (一) 标题
subsubsection = {
name={,.},number=\arabic{subsubsection},format={\heiti\zihao{5}},afterskip={2ex},beforeskip={2ex},aftername={ }
}%出来是 1.标题
}
\titleformat

\maketitle

Expand Down Expand Up @@ -153,8 +143,8 @@ \subsection{局限性}
不足和未来发展方向

\newpage
\bibliographystyle{gbt7714-numerical}
\bibliography{main}
% \bibliographystyle{gbt7714-numerical}
% \bibliography{main}

\section{附录}
一些不想放在正文的细节。
Expand Down

0 comments on commit e098357

Please sign in to comment.