diff --git a/awesome-cv.cls b/awesome-cv.cls index 5243093..60e3782 100644 --- a/awesome-cv.cls +++ b/awesome-cv.cls @@ -36,7 +36,7 @@ \DeclareOption{draft}{\setlength\overfullrule{5pt}} \DeclareOption{final}{\setlength\overfullrule{0pt}} % Inherit options of article -\DeclareOption*{ +\DeclareOption*{% \PassOptionsToClass{\CurrentOption}{article} } \ProcessOptions\relax @@ -67,15 +67,9 @@ % Needed to change line spacing in specific environment \RequirePackage{setspace} % Needed to manage fonts -\ifxetex - \RequirePackage[quiet]{fontspec} - % To support LaTeX quoting style - \defaultfontfeatures{Ligatures=TeX} -\else - \RequirePackage[T1]{fontenc} - % Replace by the encoding you are using - \RequirePackage[utf8]{inputenc} -\fi +\RequirePackage[quiet]{fontspec} +% To support LaTeX quoting style +\defaultfontfeatures{Ligatures=TeX} % Needed to manage math fonts \RequirePackage[math-style=TeX,vargreek-shape=unicode]{unicode-math} % Needed to use icons from font-awesome @@ -85,7 +79,7 @@ \RequirePackage{parskip} % Needed to deal hyperlink \RequirePackage[hidelinks]{hyperref} -\hypersetup{ +\hypersetup{% pdftitle={}, pdfauthor={}, pdfsubject={}, @@ -109,7 +103,7 @@ \geometry{left=2.0cm, top=1.5cm, right=2.0cm, bottom=2.0cm, footskip=.5cm} %% Header & Footer -% Set offset to each header and offset +% Set offset to each header and footer \fancyhfoffset{0em} % Remove head rule \renewcommand{\headrulewidth}{0pt} @@ -352,7 +346,7 @@ % Defines an enclosure for letter (cover letter only, optional) % Usage: \letterenclosure[]{} \newcommand*{\letterenclname}[1][Enclosure]{\def\@letterenclname{#1}} -\newcommand*{\letterenclosure}[2][]{ +\newcommand*{\letterenclosure}[2][]{% % if an optional argument is provided, use it to redefine \enclname \ifthenelse{\equal{#1}{}}{}{\def\@letterenclname{#1}} \def\@letterenclosure{#2} @@ -362,12 +356,15 @@ %------------------------------------------------------------------------------- % Commands for extra %------------------------------------------------------------------------------- -% Define separator for social informations in header -% Usage: \headersocialsep{} -% Default: \quad\textbar\quad -\newcommand*{\headersocialsep}[1][\quad\textbar\quad]{\def\@headersocialsep{#1}} -\headersocialsep - +% Define helper macros a user can change easily in header +\newcommand{\acvHeaderNameDelim}{\space} +\newcommand{\acvHeaderAfterNameSkip}{.4mm} +\newcommand{\acvHeaderAfterPositionSkip}{.4mm} +\newcommand{\acvHeaderAfterAddressSkip}{-.5mm} +\newcommand{\acvHeaderIconSep}{\space} +\newcommand{\acvHeaderSocialSep}{\quad\textbar\quad} +\newcommand{\acvHeaderAfterSocialSkip}{6mm} +\newcommand{\acvHeaderAfterQuoteSkip}{5mm} %------------------------------------------------------------------------------- % Commands for utilities @@ -377,7 +374,7 @@ \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} -% Use to draw horizontal line with specific tickness +% Use to draw horizontal line with specific thickness \def\vhrulefill#1{\leavevmode\leaders\hrule\@height#1\hfill \kern\z@} % Use to execute conditional statements by checking empty string @@ -389,123 +386,110 @@ %------------------------------------------------------------------------------- % Define a header for CV % Usage: \makecvheader -\newcommand*{\makecvheader}{ +\newcommand*{\makecvheader}{% \begin{center} - \headerfirstnamestyle{ - \@firstname - }\ \headerlastnamestyle{ - \@lastname - } - \\ - \vspace{0.4mm} - \ifthenelse{\isundefined{\@position}}{}{\headerpositionstyle{\@position\\}} - \vspace{0.4mm} - \ifthenelse{\isundefined{\@address}}{}{\headeraddressstyle{\@address\\}} - \vspace{-0.5mm} - \headersocialstyle{ - \newbool{isstart} - \setbool{isstart}{true} - \ifthenelse{\isundefined{\@mobile}} - {} - { - \faMobile\ \@mobile - \setbool{isstart}{false} - } - \ifthenelse{\isundefined{\@email}} - {} - { - \ifbool{isstart} - { - \setbool{istart}{false} - } - {\@headersocialsep} - \href{mailto:\@email}{\faEnvelope\ \@email} - } - \ifthenelse{\isundefined{\@homepage}} - {} - { - \ifbool{isstart} - { - \setbool{istart}{false} - } - {\@headersocialsep} - \href{http://\@homepage}{\faHome\ \@homepage} - } - \ifthenelse{\isundefined{\@github}} - {} - { - \ifbool{isstart} - { - \setbool{istart}{false} - } - {\@headersocialsep} - \href{https://github.com/\@github}{\faGithubSquare\ \@github} - } - \ifthenelse{\isundefined{\@stackoverflowid}} - {} - { - \ifbool{isstart} - { - \setbool{istart}{false} - } - {\@headersocialsep} - \href{https://stackoverflow.com/users/\@stackoverflowid}{\faStackOverflow\ \@stackoverflowname} - } - \ifthenelse{\isundefined{\@linkedin}} - {} - { - \ifbool{isstart} - { - \setbool{istart}{false} - } - {\@headersocialsep} - \href{https://www.linkedin.com/in/\@linkedin}{\faLinkedinSquare\ \@linkedin} - } - \ifthenelse{\isundefined{\@twitter}} - {} - { - \ifbool{isstart} - { - \setbool{istart}{false} - } - {\@headersocialsep} - \href{https://twitter.com/\@twitter}{\faTwitter\ \@twitter} - } - \ifthenelse{\isundefined{\@skype}} - {} - { - \ifbool{isstart} - { - \setbool{istart}{false} - } - {\@headersocialsep} - \faSkype\ \@skype - } - } \\ - \ifthenelse{\isundefined{\@quote}} - {} - {\vspace{6.0mm}\headerquotestyle{\@quote\\}\vspace{5.0mm}} - \end{center} + \headerfirstnamestyle{\@firstname}\headerlastnamestyle{{}\acvHeaderNameDelim\@lastname}% + \\[\acvHeaderAfterNameSkip]% + \ifthenelse{\isundefined{\@position}}{}{\headerpositionstyle{\@position\\[\acvHeaderAfterPositionSkip]}}% + \ifthenelse{\isundefined{\@address}}{}{\headeraddressstyle{\@address\\[\acvHeaderAfterAddressSkip]}}% + \headersocialstyle{% + \newbool{isstart}% + \setbool{isstart}{true}% + \ifthenelse{\isundefined{\@mobile}}% + {}% + {% + \faMobile\acvHeaderIconSep\@mobile% + \setbool{isstart}{false}% + }% + \ifthenelse{\isundefined{\@email}}% + {}% + {% + \ifbool{isstart}% + {% + \setbool{istart}{false}% + }% + {\acvHeaderSocialSep}% + \href{mailto:\@email}{\faEnvelope\acvHeaderIconSep\@email}% + }% + \ifthenelse{\isundefined{\@homepage}}% + {}% + {% + \ifbool{isstart}% + {% + \setbool{istart}{false}% + }% + {\acvHeaderSocialSep}% + \href{http://\@homepage}{\faHome\acvHeaderIconSep\@homepage}% + }% + \ifthenelse{\isundefined{\@github}}% + {}% + {% + \ifbool{isstart}% + {% + \setbool{istart}{false}% + }% + {\acvHeaderSocialSep}% + \href{https://github.com/\@github}{\faGithubSquare\acvHeaderIconSep\@github}% + }% + \ifthenelse{\isundefined{\@stackoverflowid}}% + {}% + {% + \ifbool{isstart}% + {% + \setbool{istart}{false} % + }% + {\acvHeaderSocialSep}% + \href{https://stackoverflow.com/users/\@stackoverflowid}{\faStackOverflow\acvHeaderIconSep\@stackoverflowname}% + }% + \ifthenelse{\isundefined{\@linkedin}}% + {}% + {% + \ifbool{isstart}% + {% + \setbool{istart}{false}% + }% + {\acvHeaderSocialSep}% + \href{https://www.linkedin.com/in/\@linkedin}{\faLinkedinSquare\acvHeaderIconSep\@linkedin}% + }% + \ifthenelse{\isundefined{\@twitter}}% + {}% + {% + \ifbool{isstart}% + {% + \setbool{istart}{false} % + }% + {\acvHeaderSocialSep}% + \href{https://twitter.com/\@twitter}{\faTwitter\acvHeaderIconSep\@twitter}% + }% + \ifthenelse{\isundefined{\@skype}}% + {}% + {% + \ifbool{isstart}% + {% + \setbool{istart}{false} % + }% + {\acvHeaderSocialSep}% + \faSkype\acvHeaderIconSep\@skype% + }% + } \\[\acvHeaderAfterSocialSkip]% + \ifthenelse{\isundefined{\@quote}}% + {}% + {\headerquotestyle{\@quote\\}\vspace{\acvHeaderAfterQuoteSkip}}% + \end{center}% } % Define a footer for CV % Usage: \makecvfooter{}{
}{} -\newcommand*{\makecvfooter}[3]{ +\newcommand*{\makecvfooter}[3]{% \fancyfoot{} - \fancyfoot[L]{ - \footerstyle{#1} - } - \fancyfoot[C]{ - \footerstyle{#2} - } - \fancyfoot[R]{ - \footerstyle{#3} - } + \fancyfoot[L]{\footerstyle{#1}} + \fancyfoot[C]{\footerstyle{#2}} + \fancyfoot[R]{\footerstyle{#3}} } % Define a section for CV % Usage: \cvsection{} -\newcommand{\cvsection}[1]{ +\newcommand{\cvsection}[1]{% \par\addvspace{1.5ex} \phantomsection{} \sectionstyle{#1} @@ -515,52 +499,52 @@ % Define a subsection for CV % Usage: \cvsubsection{} -\newcommand{\cvsubsection}[1]{ +\newcommand{\cvsubsection}[1]{% \phantomsection{} \subsectionstyle{#1} } % Define a paragraph for CV -\newenvironment{cvparagraph}{ +\newenvironment{cvparagraph}{% \vspace{-3mm} \paragraphstyle -}{ +}{% \vspace{1mm} } % Define an environment for cventry -\newenvironment{cventries}{ +\newenvironment{cventries}{% \begin{center} -}{ +}{% \end{center} } % Define an entry of cv information % Usage: \cventry{}{}{<location>}{<date>}{<description>} -\newcommand*{\cventry}[5]{ +\newcommand*{\cventry}[5]{% \setlength\tabcolsep{0pt} \setlength{\extrarowheight}{0pt} - \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{12.5cm} R{4.5cm}} + \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{\textwidth - 4.5cm} R{4.5cm}} \ifempty{#2#3} {\entrypositionstyle{#1} & \entrydatestyle{#4} \\} {\entrytitlestyle{#2} & \entrylocationstyle{#3} \\ \entrypositionstyle{#1} & \entrydatestyle{#4} \\} - \multicolumn{2}{L{17cm}}{\descriptionstyle{#5}} \\ + \multicolumn{2}{L{\textwidth}}{\descriptionstyle{#5}} \\ \end{tabular*} } % Define an environment for cvsubentry -\newenvironment{cvsubentries}{ +\newenvironment{cvsubentries}{% \begin{center} -}{ +}{% \end{center} } % Define a subentry of cv information % Usage: \cvsubentry{<position>}{<title>}{<date>}{<description>} -\newcommand*{\cvsubentry}[4]{ +\newcommand*{\cvsubentry}[4]{% \setlength\tabcolsep{0pt} \setlength{\extrarowheight}{0pt} - \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{12.5cm} R{4.5cm}} + \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{\textwidth - 4.5cm} R{4.5cm}} \setlength\leftskip{0.2cm} \subentrytitlestyle{#2} & \ifthenelse{\equal{#1}{}} {\subentrydatestyle{#3}}{} @@ -574,47 +558,45 @@ } % Define an environment for cvhonor -\newenvironment{cvhonors}{ +\newenvironment{cvhonors}{% \begin{center} \setlength\tabcolsep{0pt} \setlength{\extrarowheight}{0pt} - \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} C{1.5cm} L{13.0cm} R{2.5cm}} -}{ + \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} C{1.5cm} L{\textwidth - 4.0cm} R{2.5cm}} +}{% \end{tabular*} \end{center} } % Define a line of cv information(honor, award or something else) % Usage: \cvhonor{<position>}{<title>}{<location>}{<date>} -\newcommand*{\cvhonor}[4]{ - \honordatestyle{#4} & \honorpositionstyle{#1}, \honortitlestyle{#2} & \honorlocationstyle{#3} - \\ +\newcommand*{\cvhonor}[4]{% + \honordatestyle{#4} & \honorpositionstyle{#1}, \honortitlestyle{#2} & \honorlocationstyle{#3} \\ } % Define an environment for cvskill -\newenvironment{cvskills}{ +\newenvironment{cvskills}{% \begin{center} \setlength\tabcolsep{1ex} \setlength{\extrarowheight}{0pt} - \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} r L{15.2cm}} -}{ + \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} r L{\textwidth * \real{0.9}}} +}{% \end{tabular*} \end{center} } % Define a line of cv information(skill) % Usage: \cvskill{<type>}{<skillset>} -\newcommand*{\cvskill}[2]{ - \skilltypestyle{#1} & \skillsetstyle{#2} - \\ +\newcommand*{\cvskill}[2]{% + \skilltypestyle{#1} & \skillsetstyle{#2} \\ } % Define an environment for cvitems(for cventry) -\newenvironment{cvitems}{ +\newenvironment{cvitems}{% \vspace{-4mm} \begin{justify} \begin{itemize}[leftmargin=2ex, nosep, noitemsep] \setlength{\parskip}{0pt} \renewcommand{\labelitemi}{\bullet} -}{ +}{% \end{itemize} \end{justify} \vspace{-2mm} @@ -625,14 +607,14 @@ % Commands for elements of Cover Letter %------------------------------------------------------------------------------- % Define an environment for cvletter -\newenvironment{cvletter}{ +\newenvironment{cvletter}{% \lettertextstyle -}{ +}{% } % Define a section for the cover letter % Usage: \lettersection{<section-title>} -\newcommand{\lettersection}[1]{ +\newcommand{\lettersection}[1]{% \par\addvspace{2.5ex} \phantomsection{} \lettersectionstyle{#1} @@ -642,11 +624,11 @@ % Define a title of the cover letter % Usage: \makelettertitle -\newcommand*{\makelettertitle}{ +\newcommand*{\makelettertitle}{% \vspace{8.4mm} \setlength\tabcolsep{0pt} \setlength{\extrarowheight}{0pt} - \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{12.5cm} R{4.5cm}} + \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{\textwidth - 4.5cm} R{4.5cm}} \recipienttitlestyle{\@recipientname} & \letterdatestyle{\@letterdate} \end{tabular*} \begin{singlespace} @@ -660,13 +642,13 @@ % Define a closing of the cover letter % Usage: \makeletterclosing -\newcommand*{\makeletterclosing}{ +\newcommand*{\makeletterclosing}{% \vspace{3.4mm} \lettertextstyle{\@letterclosing} \\\\ \letternamestyle{\@firstname\ \@lastname} \ifthenelse{\isundefined{\@letterenclosure}} {\\} - { + {% \\\\\\ \letterenclosurestyle{\@letterenclname: \@letterenclosure} \\ } diff --git a/examples/coverletter.tex b/examples/coverletter.tex index f3f8231..ddf946b 100644 --- a/examples/coverletter.tex +++ b/examples/coverletter.tex @@ -20,27 +20,28 @@ %%% Themes: Awesome-CV \documentclass[11pt, a4paper]{awesome-cv} +%% Page Layout +% Configure page margins with geometry +\geometry{left=1.4cm, top=.8cm, right=1.4cm, bottom=1.8cm, footskip=.5cm} + %%% Override a directory location for fonts(default: 'fonts/') \fontdir[fonts/] -%%% Configure a directory location for sections -\newcommand*{\sectiondir}{cv/} - %%% Override color % Awesome Colors: awesome-emerald, awesome-skyblue, awesome-red, awesome-pink, awesome-orange % awesome-nephritis, awesome-concrete, awesome-darknight %% Color for highlight % Define your custom color if you don't like awesome colors \colorlet{awesome}{awesome-red} -%\definecolor{awesome}{HTML}{CA63A8} +% \definecolor{awesome}{HTML}{CA63A8} %% Colors for text -%\definecolor{darktext}{HTML}{414141} -%\definecolor{text}{HTML}{414141} -%\definecolor{graytext}{HTML}{414141} -%\definecolor{lighttext}{HTML}{414141} +% \definecolor{darktext}{HTML}{414141} +% \definecolor{text}{HTML}{414141} +% \definecolor{graytext}{HTML}{414141} +% \definecolor{lighttext}{HTML}{414141} %%% Override a separator for social informations in header(default: ' | ') -%\headersocialsep[\quad\textbar\quad] +% \renewcommand{\acvHeaderSocialSep}{\quad\textbar\quad} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/examples/cv.tex b/examples/cv.tex index 84ea03f..03d3734 100644 --- a/examples/cv.tex +++ b/examples/cv.tex @@ -20,6 +20,10 @@ %%% Themes: Awesome-CV \documentclass[11pt, a4paper]{awesome-cv} +%% Page Layout +% Configure page margins with geometry +\geometry{left=1.4cm, top=.8cm, right=1.4cm, bottom=1.8cm, footskip=.5cm} + %%% Override a directory location for fonts(default: 'fonts/') \fontdir[fonts/] @@ -32,15 +36,15 @@ %% Color for highlight % Define your custom color if you don't like awesome colors \colorlet{awesome}{awesome-red} -%\definecolor{awesome}{HTML}{CA63A8} +% \definecolor{awesome}{HTML}{CA63A8} %% Colors for text -%\definecolor{darktext}{HTML}{414141} -%\definecolor{text}{HTML}{414141} -%\definecolor{graytext}{HTML}{414141} -%\definecolor{lighttext}{HTML}{414141} +% \definecolor{darktext}{HTML}{414141} +% \definecolor{text}{HTML}{414141} +% \definecolor{graytext}{HTML}{414141} +% \definecolor{lighttext}{HTML}{414141} %%% Override a separator for social informations in header(default: ' | ') -%\headersocialsep[\quad\textbar\quad] +% \renewcommand{\acvHeaderSocialSep}{\quad\textbar\quad} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/examples/resume.tex b/examples/resume.tex index 4a23a39..82148fb 100644 --- a/examples/resume.tex +++ b/examples/resume.tex @@ -20,6 +20,10 @@ %%% Themes: Awesome-CV \documentclass[11pt, a4paper]{awesome-cv} +%% Page Layout +% Configure page margins with geometry +\geometry{left=1.4cm, top=.8cm, right=1.4cm, bottom=1.8cm, footskip=.5cm} + %%% Override a directory location for fonts(default: 'fonts/') \fontdir[fonts/] @@ -32,15 +36,15 @@ %% Color for highlight % Define your custom color if you don't like awesome colors \colorlet{awesome}{awesome-red} -%\definecolor{awesome}{HTML}{CA63A8} +% \definecolor{awesome}{HTML}{CA63A8} %% Colors for text -%\definecolor{darktext}{HTML}{414141} -%\definecolor{text}{HTML}{414141} -%\definecolor{graytext}{HTML}{414141} -%\definecolor{lighttext}{HTML}{414141} +% \definecolor{darktext}{HTML}{414141} +% \definecolor{text}{HTML}{414141} +% \definecolor{graytext}{HTML}{414141} +% \definecolor{lighttext}{HTML}{414141} %%% Override a separator for social informations in header(default: ' | ') -%\headersocialsep[\quad\textbar\quad] +% \renewcommand{\acvHeaderSocialSep}{\quad\textbar\quad} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%