forked from Emersondjp/liberty_training
-
Notifications
You must be signed in to change notification settings - Fork 1
/
training.cls
99 lines (87 loc) · 2.71 KB
/
training.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{training}[2019/06/24 A temporary training class]
\LoadClass[12pt]{article}
% disable indent globally
\setlength{\parindent}{4pt}
% some general improvements, defines the XeTeX logo
\RequirePackage{xltxtra}
% use ctex
\RequirePackage{ctex}
% use graphics
\RequirePackage{graphics}
% use xifthen
\RequirePackage{xifthen}
% use progress bar for skill
\RequirePackage{progressbar}
% use hyperlink for email and url
\RequirePackage{hyperref}
\RequirePackage{url}
\urlstyle{tt}
% use fontawesome
\RequirePackage{fontawesome}
% use xcolor for customizing color
%\RequirePackage[usenames,dvipsnames]{xcolor}
% loading fonts
\RequirePackage{fontspec}
% Main document font
\RequirePackage[
a4paper,
left=0.8in,
right=0.8in,
top=0.70in,
bottom=0.55in,
nohead
]{geometry}
\RequirePackage{titlesec}
\RequirePackage{CJK}
\RequirePackage{enumitem}
\setlist{noitemsep} % removes spacing from items but leaves space around the whole list
%\setlist{nosep} % removes all vertical spacing within and around the list
\setlist[itemize]{topsep=0.25em, leftmargin=1.5pc}
\setlist[enumerate]{topsep=0.25em, leftmargin=1.5pc}
\RequirePackage[super]{nth}
\titleformat{\section} % Customise the \section command
{\LARGE\scshape\raggedright} % Make the \section headers large (\Large),
% small capitals (\scshape) and left aligned (\raggedright)
{\thesection.}{0.2em} % Can be used to give a prefix to all sections, like 'Section ...'
{} % Can be used to insert code before the heading
[\titlerule] % Inserts a horizontal line after the heading
\titlespacing*{\section}{0cm}{*1.8}{*1.8}
\titleformat{\subsection}
{\Large\raggedright}
{\thesubsection. }{0.2em}
{}
\titlespacing*{\subsection}{0cm}{*1.8}{*1.2}
\titleformat{\subsubsection}
{\large\raggedright}
{\thesubsubsection. }{0.2em}
{}
\titlespacing*{\subsection}{0cm}{*0.6}{*0.0}
% defines email
% usage: \email{<email>}
\newcommand{\email}[1]{\faEnvelope\ \href{mailto:#1}{#1}}
% defines linkedin
% usage: \linkedin{<linkedin>}
\newcommand{\linkedin}[2][]{\faLinkedin\
\ifthenelse{\isempty{#1}}%
{\href{#2}{#2}}
{\href{#2}{#1}}}
% defines GitHub
% usage: \github{<github>}
\newcommand{\github}[2][]{\faGithub\
\ifthenelse{\isempty{#1}}%
{\href{#2}{#2}}
{\href{#2}{#1}}}
% defines progress bar with text
% usage: \pbar[3][width]{Text}{percentage}
\newcommand{\pbar}[3][10em]{{#2}\
\progressbar[heightr=1, width=#1, borderwidth=0pt, roundnessr=0.45, filledcolor=green!40, subdivisions=1]{#3}
}
\newcommand{\basicInfo}[1]{
\centerline{\sffamily\large{#1}}
\vspace{1.5ex}
}
\newcommand{\role}[2]{
{\par \textit{#1} ~ #2 \par}
\vspace{0.85ex}
}