diff --git a/awesome-cv.cls b/awesome-cv.cls index c26c7754b..bd850b1a2 100644 --- a/awesome-cv.cls +++ b/awesome-cv.cls @@ -54,7 +54,7 @@ \RequirePackage{ragged2e} % Needed to configure page layout \RequirePackage{geometry} -% Needed to make header & footer effeciently +% Needed to make header & footer efficiently \RequirePackage{fancyhdr} % Needed to manage colors \RequirePackage{xcolor} @@ -75,6 +75,8 @@ % Needed to use icons from font-awesome % (https://github.com/posquit0/latex-fontawesome) \RequirePackage{fontawesome} +% Needed to use icons from academicons +\RequirePackage{academicons} \RequirePackage[default,opentype]{sourcesanspro} % Needed for the photo ID \RequirePackage[skins]{tcolorbox} @@ -88,6 +90,8 @@ pdfsubject={}, pdfkeywords={} } +% Require additional space to be filled by content +\RequirePackage{needspace} %------------------------------------------------------------------------------- @@ -161,7 +165,7 @@ % Configuration for fonts %------------------------------------------------------------------------------- % Set the FontAwesome font to be up-to-date. -\newfontfamily\FA[Path=\@fontdir]{FontAwesome} +% \newfontfamily\FA[Path=\@fontdir]{FontAwesome} % Uncomment if \FA is not defined % Set font for header (default is Roboto) \newfontfamily\headerfont[ Path=\@fontdir, @@ -233,10 +237,21 @@ \newcommand*{\letternamestyle}[1]{{\fontsize{10pt}{1em}\bodyfont\bfseries\color{darktext} #1}} \newcommand*{\letterenclosurestyle}[1]{{\fontsize{10pt}{1em}\bodyfontlight\slshape\color{lighttext} #1}} - %------------------------------------------------------------------------------- % Commands for personal information %------------------------------------------------------------------------------- +% Define a collection of header information +\edef\header{} +\newcommand{\headerAdd}[1]{ + \ifnonprint{\ignorespaces\header}{% + \protected@edef\header{#1}% + }{% + \protected@edef\header{\header{} \acvHeaderSocialSep #1}% + }% +}% +\newcommand{\headerSocial}[3]{ + \headerAdd{\href{#2#3}{#1\acvHeaderIconSep#3}} +} % Define photo ID % Usage: \photo[circle|rectangle,edge|noedge,left|right]{} \newcommand{\photo}[2][circle,edge,left]{% @@ -275,53 +290,61 @@ % Defines writer's mobile (optional) % Usage: \mobile{} -\newcommand*{\mobile}[1]{\def\@mobile{#1}} +\newcommand{\mobile}[1]{\headerAdd{\faMobile\acvHeaderIconSep#1}} % Defines writer's email (optional) % Usage: \email{} -\newcommand*{\email}[1]{\def\@email{#1}} +\newcommand{\email}[1]{\headerSocial{\faEnvelope}{mailto:}{#1}} % Defines writer's homepage (optional) % Usage: \homepage{} -\newcommand*{\homepage}[1]{\def\@homepage{#1}} +\newcommand{\homepage}[1]{\headerSocial{\faHome}{https://#1}{#1}} % Defines writer's github (optional) % Usage: \github{} -\newcommand*{\github}[1]{\def\@github{#1}} +\newcommand{\github}[1]{\headerSocial{\faGithub}{https://github.com/}{#1}} % Defines writer's gitlab (optional) % Usage: \gitlab{} -\newcommand*{\gitlab}[1]{\def\@gitlab{#1}} +\newcommand{\gitlab}[1]{\headerSocial{\faGitlab}{https://gitlab.com/}{#1}} + +% Defines writer's bitbucket (optional) +% Usage: \bitbucket{} +\newcommand{\bitbucket}[1]{\headerSocial{\faBitbucket}{https://bitbucket.com/}{#1}} % Defines writer's stackoverflow profile (optional) % Usage: \stackoverflow{}{} % e.g.https://stackoverflow.com/users/123456/sam-smith % would be \stackoverflow{123456}{sam-smith} -\newcommand*{\stackoverflow}[2]{\def\@stackoverflowid{#1}\def\@stackoverflowname{#2}} +\newcommand{\stackoverflow}[2]{\headerAdd{\href{https://stackoverflow.com/users/#1}{\faStackOverflow\acvHeaderIconSep#2}}} % Defines writer's linked-in (optional) % Usage: \linkedin{} -\newcommand*{\linkedin}[1]{\def\@linkedin{#1}} +\newcommand{\linkedin}[1]{\headerSocial{\faLinkedin}{https://www.linkedin.com/in/}{#1}} % Defines writer's twitter (optional) % Usage: \twitter{} -\newcommand*{\twitter}[1]{\def\@twitter{#1}} +\newcommand{\twitter}[1]{\headerSocial{\faTwitter}{https://twitter.com/}{#1}} + +% Defines writer's ORCID (optional) +% Usage: \orcid{} +\newcommand{\orcid}[1]{\headerSocial{\aiOrcid}{https://orcid.org/}{#1}} % Defines writer's skype (optional) % Usage: \skype{} -\newcommand*{\skype}[1]{\def\@skype{#1}} +\newcommand{\skype}[1]{\headerAdd{\faSkype\acvHeaderIconSep#1}} % Defines writer's reddit (optional) % Usage: \reddit{} -\newcommand*{\reddit}[1]{\def\@reddit{#1}} +\newcommand{\reddit}[1]{\headerSocial{\faReddit}{https://www.reddit.com/user/}{#1}} % Defines writer's xing (optional) % Usage: \xing{} -\newcommand*{\xing}[1]{\def\@xing{#1}} +\newcommand{\xing}[1]{\headerSocial{\faXing}{https://www.xing.com/profile/}{#1}} % Defines writer's medium profile (optional) % Usage: \medium{} -\newcommand*{\medium}[1]{\def\@medium{#1}} +\newcommand{\medium}[1]{\headerSocial{\faMedium}{https://medium.com/}{#1}} % Defines writer's google scholar profile (optional) % Usage: \googlescholar{}{} @@ -329,18 +352,11 @@ % would be \googlescholar{wpZDx1cAAAAJ}{Name-to-display-next-icon} % If 'googlescholar-name' is not provided than it defaults to % '\firstname \lastname' -\newcommand*{\googlescholar}[2]{% - \def\@googlescholarid{#1}% - \ifthenelse{\equal{#2}{}}{% - \def\@googlescholarname{\@firstname~\@lastname}% - }{% - \def\@googlescholarname{#2}% - }% -} +\newcommand{\googlescholar}[2]{\headerAdd{\href{https://scholar.google.com/citations?user=#1}{\faGraduationCap\acvHeaderIconSep#2}}} % Defines writer's extra informations (optional) % Usage: \extrainfo{} -\newcommand*{\extrainfo}[1]{\def\@extrainfo{#1}} +\newcommand{\extrainfo}[1]{\headerAdd{#1}} % Defines writer's quote (optional) % Usage: \quote{} @@ -398,7 +414,6 @@ \newcommand{\acvSectionTopSkip}{3mm} \newcommand{\acvSectionContentTopSkip}{2.5mm} - %------------------------------------------------------------------------------- % Commands for utilities %------------------------------------------------------------------------------- @@ -413,6 +428,14 @@ % Use to execute conditional statements by checking empty string \newcommand*{\ifempty}[3]{\ifthenelse{\isempty{#1}}{#2}{#3}} +% Use to execute conditional statements by checking non-printing string +\newcommand*{\ifnonprint}[3]{ +\setbox0=\hbox{#1\unskip}\ifdim\wd0=0pt + #2 +\else + #3 +\fi +} %------------------------------------------------------------------------------- % Commands for elements of CV structure @@ -453,92 +476,7 @@ \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{isstart}{false}}{\acvHeaderSocialSep}% - \href{mailto:\@email}{\faEnvelope\acvHeaderIconSep\@email}% - }% - \ifthenelse{\isundefined{\@homepage}}% - {}% - {% - \ifbool{isstart}{\setbool{isstart}{false}}{\acvHeaderSocialSep}% - \href{http://\@homepage}{\faHome\acvHeaderIconSep\@homepage}% - }% - \ifthenelse{\isundefined{\@github}}% - {}% - {% - \ifbool{isstart}{\setbool{isstart}{false}}{\acvHeaderSocialSep}% - \href{https://github.com/\@github}{\faGithubSquare\acvHeaderIconSep\@github}% - }% - \ifthenelse{\isundefined{\@gitlab}}% - {}% - {% - \ifbool{isstart}{\setbool{isstart}{false}}{\acvHeaderSocialSep}% - \href{https://gitlab.com/\@gitlab}{\faGitlab\acvHeaderIconSep\@gitlab}% - }% - \ifthenelse{\isundefined{\@stackoverflowid}}% - {}% - {% - \ifbool{isstart}{\setbool{isstart}{false}}{\acvHeaderSocialSep}% - \href{https://stackoverflow.com/users/\@stackoverflowid}{\faStackOverflow\acvHeaderIconSep\@stackoverflowname}% - }% - \ifthenelse{\isundefined{\@linkedin}}% - {}% - {% - \ifbool{isstart}{\setbool{isstart}{false}}{\acvHeaderSocialSep}% - \href{https://www.linkedin.com/in/\@linkedin}{\faLinkedinSquare\acvHeaderIconSep\@linkedin}% - }% - \ifthenelse{\isundefined{\@twitter}}% - {}% - {% - \ifbool{isstart}{\setbool{isstart}{false}}{\acvHeaderSocialSep}% - \href{https://twitter.com/\@twitter}{\faTwitter\acvHeaderIconSep\@twitter}% - }% - \ifthenelse{\isundefined{\@skype}}% - {}% - {% - \ifbool{isstart}{\setbool{isstart}{false}}{\acvHeaderSocialSep}% - \faSkype\acvHeaderIconSep\@skype% - }% - \ifthenelse{\isundefined{\@reddit}}% - {}% - {% - \ifbool{isstart}{\setbool{isstart}{false}}{\acvHeaderSocialSep}% - \href{https://www.reddit.com/user/\@reddit}{\faReddit\acvHeaderIconSep\@reddit}% - }% - \ifthenelse{\isundefined{\@xing}}% - {}% - {% - \ifbool{isstart}{\setbool{isstart}{false}}{\acvHeaderSocialSep}% - \href{https://www.xing.com/profile/\@xing}{\faXingSquare\acvHeaderIconSep\@xing} - }% - \ifthenelse{\isundefined{\@medium}}% - {}% - {% - \ifbool{isstart}{\setbool{isstart}{false}}{\acvHeaderSocialSep}% - \href{https://medium.com/@\@medium}{\faMedium\acvHeaderIconSep\@medium}% - }% - \ifthenelse{\isundefined{\@googlescholarid}}% - {}% - {% - \ifbool{isstart}{\setbool{isstart}{false}}{\acvHeaderSocialSep}% - \href{https://scholar.google.com/citations?user=\@googlescholarid}{\faGraduationCap\acvHeaderIconSep\@googlescholarname}% - }% - \ifthenelse{\isundefined{\@extrainfo}}% - {}% - {% - \ifbool{isstart}{\setbool{isstart}{false}}{\acvHeaderSocialSep}% - \@extrainfo% - }% + \header{} } \\[\acvHeaderAfterSocialSkip]% \ifthenelse{\isundefined{\@quote}}% {}% @@ -561,6 +499,7 @@ % Define a section for CV % Usage: \cvsection{} \newcommand{\cvsection}[1]{% + \needspace{10\baselineskip} \vspace{\acvSectionTopSkip} \sectionstyle{#1} \phantomsection @@ -570,6 +509,7 @@ % Define a subsection for CV % Usage: \cvsubsection{} \newcommand{\cvsubsection}[1]{% + \needspace{5\baselineskip} \vspace{\acvSectionContentTopSkip} \vspace{-3mm} \subsectionstyle{#1} @@ -593,17 +533,20 @@ }{% \end{center} } + % Define an entry of cv information % Usage: \cventry{}{}{<location>}{<date>}{<description>} +% This command formats with <position> above <title> on the left and <location> above <date> +% on the right with <description> below both \newcommand*{\cventry}[5]{% \vspace{-2.0mm} \setlength\tabcolsep{0pt} \setlength{\extrarowheight}{0pt} \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} \\} + \ifempty{#1#3} + {\entrypositionstyle{#2} & \entrydatestyle{#4} \\} + {\entrytitlestyle{#1} & \entrylocationstyle{#3} \\ + \entrypositionstyle{#2} & \entrydatestyle{#4} \\} \multicolumn{2}{L{\textwidth}}{\descriptionstyle{#5}} \end{tabular*}% } @@ -639,7 +582,7 @@ \begin{center} \setlength\tabcolsep{0pt} \setlength{\extrarowheight}{0pt} - \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} C{1.5cm} L{\textwidth - 4.0cm} R{2.5cm}} + \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{3.0cm} L{\textwidth - 6.5cm} R{3.5cm}} }{% \end{tabular*} \end{center} @@ -665,7 +608,7 @@ % Define a line of cv information(skill) % Usage: \cvskill{<type>}{<skillset>} \newcommand*{\cvskill}[2]{% - \skilltypestyle{#1} & \skillsetstyle{#2} \\ + \skilltypestyle{#1} & \skillsetstyle{#2} \\ } % Define an environment for cvitems(for cventry)