From 76932c1a2a8299d2d7fdfe2c194468120b4e5cb4 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 14 Apr 2018 22:56:59 +0800 Subject: Add resume class together with fontawesome style file This template is based on the [YACC: Another Awesome CV](https://github.com/darwiin/yaac-another-awesome-cv) by Christophe Roger, which is further based on the [Plasmati Graduate CV](https://www.latextemplates.com/template/plasmati-graduate-cv) by Alessandro Plasmati. --- resume.cls | 497 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 497 insertions(+) create mode 100644 resume.cls (limited to 'resume.cls') diff --git a/resume.cls b/resume.cls new file mode 100644 index 0000000..6ded24d --- /dev/null +++ b/resume.cls @@ -0,0 +1,497 @@ +%% +%% Copyright (c) 2018 Weitian LI +%% Copyright (c) 2016 Christophe Roger +%% +%% Resume LaTeX template. +%% Based on +%% YACC: Another Awesome CV by Christophe Roger +%% https://github.com/darwiin/yaac-another-awesome-cv +%% which is further based on +%% Plasmati Graduate CV by Alessandro Plasmati +%% https://www.latextemplates.com/template/plasmati-graduate-cv +%% + +\ProvidesClass{resume}[2018/04/11 v2.0.0 'Resume' Class] +\LoadClass[a4paper]{article} + +%% +%% Class options +%% + +\DeclareOption{monochrome}{\def\@monochrome{true}} +\DeclareOption{zh}{\def\@zh{true}} + +\ProcessOptions + +%% +%% Packages +%% + +\RequirePackage{xparse} +\RequirePackage{etoolbox} +\RequirePackage{fontspec} +\RequirePackage{fontawesome} +\RequirePackage{parskip} +\RequirePackage{fullpage} +\RequirePackage[margin=1.5cm]{geometry} +\RequirePackage{titlesec} +\RequirePackage{setspace} +\RequirePackage{array} +\RequirePackage{enumitem} +\RequirePackage{longtable} +\RequirePackage[usenames,dvipsnames]{xcolor} +\RequirePackage[skins]{tcolorbox} +\RequirePackage{tikz} +\RequirePackage{xeCJK} +\RequirePackage{ulem} +\RequirePackage{CJKulem} +\RequirePackage{csquotes} + +% +% Hyperref +% +% Delay the execution of \hypersetup at \begin{document}. +% NOTE: Should be set before hyperref uses it. +\AtBeginDocument{% + \hypersetup{% + pdfborder={0 0 0},% No border around links + pdfauthor={% + \ifdef{\@zh}{% + \@lastname{} \@firstname% + }{% + \@firstname{} \@lastname% + }% + },% + pdftitle={% + \ifdef{\@zh}{% + 简历 | \@lastname{} \@firstname{} | \@tagline% + }{% + Resume | \@firstname{} \@lastname{} | \@tagline% + }% + },% + pdfsubject={\@tagline},% + pdfkeywords={\@keywords},% + }% +} +\RequirePackage{hyperref} + +%% +%% General settings +%% + +% Fonts +\defaultfontfeatures{Mapping=tex-text} +\setmainfont{TeX Gyre Pagella} +\setsansfont{Roboto} +\setmonofont{M+ 1mn} + +% Chinese setup +\xeCJKsetup{PunctStyle=hangmobanjiao} +\setCJKmainfont{Noto Serif CJK SC}[BoldFont=Noto Sans CJK SC] +\setCJKsansfont{Noto Sans CJK SC} +\setCJKmonofont{Noto Sans Mono CJK SC} + +% Color setup +\ifdef{\@monochrome}% + {\definecolor{basecolor}{HTML}{000000}}% + {\definecolor{basecolor}{HTML}{000066}} % blue +% +\definecolor{darkGrey}{HTML}{989898} +% +\colorlet{linkcolor}{basecolor} +\colorlet{accentcolor}{linkcolor!90} +\colorlet{symbolcolor}{linkcolor!85} + +% Font Awesome icons aliases +\newcommand*{\birthdaySymbol}{\faBirthdayCake} +\newcommand*{\degreeSymbol}{\faGraduationCap} +\newcommand*{\githubSymbol}{\faGithub} +\newcommand*{\homeSymbol}{\faHome} +\newcommand*{\infoSymbol}{\faInfoCircle} +\newcommand*{\mailSymbol}{\faEnvelope} +\newcommand*{\mobileSymbol}{\faPhone} % \faMobilePhone is too narrow +\newcommand*{\linkedinSymbol}{\faLinkedin} +\newcommand*{\locationSymbol}{\faMapMarker} +\newcommand*{\phoneSymbol}{\faPhone} +\newcommand*{\universitySymbol}{\faUniversity} + +% Date format: yyyy.mm.dd +\newcommand*{\twodigits}[1]{\ifnum#1<10 0\fi\the#1} +\renewcommand*{\today}{% + \leavevmode\hbox{\the\year.\twodigits\month.\twodigits\day} +} + +% Non-numbered pages +\pagestyle{empty} + +% Last-page style +\def\ps@lastpage{% + \def\@oddfoot{\textcolor{lightgray}{\footnotesize\@fileinfo}\hfil}% + \def\@evenfoot{\textcolor{lightgray}{\footnotesize\@fileinfo}\hfil}% +} +\AtEndDocument{\thispagestyle{lastpage}} + +% Line spacing +\linespread{1.1} + +% Setup resume sections +\titleformat{\section}{\Large\raggedright}{}{0.2em}{}[\titlerule] +\titlespacing{\section}{0em}{0.2em}{0.2em} + +% Configure list via 'enumitem' +\setlist[itemize,1]{label=\faAngleRight, nosep, leftmargin=2em} +\setlist[description,1]{style=sameline} + +% New length definition +\newlength{\leftcolwidth} +\setlength{\leftcolwidth}{6em} +\newlength{\rightcolwidth} +\setlength{\rightcolwidth}{\dimexpr \textwidth - \leftcolwidth - 4\tabcolsep} + +%% +%% Generic commands +%% + +\newcommand*{\creativecommons}[2]{% + \href{http://creativecommons.org/licenses/#1/#2/}% + {\faCreativeCommons{} \uppercase{#1} #2}% +} + +\newcommand*{\link}[2]{\textcolor{linkcolor}{\href{#1}{#2}}} +\newcommand*{\important}[1]{\textbf{#1}} + +% Render an icon +\newcommand*{\icon}[1]{% + \makebox[1em][c]{\textcolor{symbolcolor}{#1}}% + \hspace{0.5em}% +} + +% Test whether the command argument is given and is not empty +% Credit: https://tex.stackexchange.com/a/63233 +\ExplSyntaxOn +\DeclareExpandableDocumentCommand{\IfNoValueOrEmptyTF}{mmm}{% + \IfNoValueTF{#1}{#2}{% + \tl_if_empty:nTF {#1} {#2} {#3} + } +} +\ExplSyntaxOff + +%% +%% Tags +%% + +% Create a tag: \tag{