Advertisement
Ahmed_Negm

Untitled

Dec 16th, 2023
868
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 11.13 KB | None | 0 0
  1. %%%%%%%%%%%%%%%%%
  2. % This is altacv.cls (v1.1.5, 1 December 2018) written by
  3. % LianTze Lim (liantze@gmail.com).
  4. %
  5. %% It may be distributed and/or modified under the
  6. %% conditions of the LaTeX Project Public License, either version 1.3
  7. %% of this license or (at your option) any later version.
  8. %% The latest version of this license is in
  9. %%    http://www.latex-project.org/lppl.txt
  10. %% and version 1.3 or later is part of all distributions of LaTeX
  11. %% version 2003/12/01 or later.
  12. %%
  13. %%
  14. % Contributions:
  15. % - https://github.com/akreuzer Added ragged2e option (5 Nov 2018)
  16. % - https://github.com/stefanogermano Fixed bad boxes and undefined font shape (July 2018)
  17. % - https://github.com/foohyfooh Fixed blank spaces in \cvevent and bad link in README.md (June 2018)
  18.  
  19. %%%%%%%%%%%%%%%%
  20. \NeedsTeXFormat{LaTeX2e}[1995/12/01]
  21. %% v1.4: Detect TL2018 to handle accented characters in class information
  22. \@ifl@t@r\fmtversion{2018/04/01}{\UseRawInputEncoding}{}
  23. \ProvidesClass{altacv}[2018/12/01 AltaCV v1.1.5, yet another alternative class for a résumé/curriculum vitae.]
  24.  
  25. %% v1.1: Optionally load academicons
  26. \newif\if@academicons
  27. \DeclareOption{academicons}{\@academiconstrue}
  28. %% v1.1.3: Choice of round/square photo
  29. \newif\if@normalphoto
  30. \DeclareOption{normalphoto}{\@normalphototrue}
  31. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{extarticle}}
  32. \newif\if@raggedtwoe
  33. \DeclareOption{ragged2e}{\@raggedtwoetrue}
  34. \ProcessOptions\relax
  35.  
  36. \LoadClass{extarticle}
  37.  
  38. \RequirePackage[margin=2cm]{geometry}
  39. \RequirePackage{fontawesome}
  40. \RequirePackage{ifxetex,ifluatex}
  41. \RequirePackage{scrlfile}
  42.  
  43. %% v1.1.5: added for convenience
  44. \newif\ifxetexorluatex
  45. \ifxetex
  46.   \xetexorluatextrue
  47. \else
  48.   \ifluatex
  49.     \xetexorluatextrue
  50.   \else
  51.     \xetexorluatexfalse
  52.   \fi
  53. \fi
  54.  
  55. %% v1.1: Optionally load academicons
  56. %% v1.1.5: Handle different versions of academicons
  57. \if@academicons
  58.   \ifxetexorluatex
  59.     \RequirePackage{fontspec}
  60.     %% academicons in TL2018 doesn't require
  61.    %% Academicons to be installed in OS fonts
  62.    %% so can be loaded directly
  63.    \@ifl@t@r\fmtversion{2018/04/01}{%
  64.      \RequirePackage{academicons}
  65.    }{%
  66.      % TL2017
  67.      \@ifl@t@r\fmtversion{2017/04/01}{%
  68.        \@ifpackagelater{academicons}{2018/03/01}{%
  69.          \RequirePackage{academicons}
  70.        }{%
  71.          \let\ori@newfontfamily\newfontfamily%
  72.          \renewcommand{\newfontfamily}[2]{}
  73.          \RequirePackage{academicons}
  74.          \let\newfontfamily\ori@newfontfamily
  75.          \newfontfamily{\AI}{academicons.ttf}
  76.        }
  77.      }{% TL2016 requires the package to be loaded before
  78.        % the version can be checked. Only added because
  79.        % Overleaf v1 still runs TL2016; will be removed
  80.        % when v1 is completely retired.
  81.          \let\ori@newfontfamily\newfontfamily%
  82.          \renewcommand{\newfontfamily}[2]{}
  83.          \RequirePackage{academicons}
  84.          \let\newfontfamily\ori@newfontfamily
  85.          \newfontfamily{\AI}{academicons.ttf}
  86.      }
  87.    }
  88.  \else
  89.    \ClassError{AltaCV}{academicons unsupported by latex or pdflatex. Please compile with xelatex or lualatex}{Please compile with xelatex or lualatex to use the academicons option}
  90.  \fi
  91. \fi
  92.  
  93. \if@raggedtwoe
  94.  \RequirePackage[newcommands]{ragged2e}
  95. \fi
  96.  
  97. \RequirePackage{xcolor}
  98.  
  99. \colorlet{accent}{blue!70!black}
  100. \colorlet{heading}{black}
  101. \colorlet{emphasis}{black}
  102. \colorlet{body}{black!80!white}
  103. \newcommand{\itemmarker}{{\small\textbullet}}
  104. \newcommand{\ratingmarker}{\faCircle}
  105.  
  106. \RequirePackage{tikz}
  107. \usetikzlibrary{arrows}
  108. \RequirePackage[skins]{tcolorbox}
  109. \RequirePackage{enumitem}
  110. \setlist{leftmargin=*,labelsep=0.5em,nosep,itemsep=0.25\baselineskip,after=\vskip0.25\baselineskip}
  111. \setlist[itemize]{label=\itemmarker}
  112. \RequirePackage{graphicx}
  113. \RequirePackage{etoolbox}
  114. \RequirePackage{dashrule}
  115. \RequirePackage{multirow,tabularx}
  116. \RequirePackage{changepage}
  117. % \RequirePackage{marginfix}
  118.  
  119. \setlength{\parindent}{0pt}
  120. \newcommand{\divider}{\textcolor{body!30}{\hdashrule{\linewidth}{0.6pt}{0.5ex}}\medskip}
  121.  
  122. \newenvironment{fullwidth}{%
  123.  \begin{adjustwidth}{}{\dimexpr-\marginparwidth-\marginparsep\relax}}
  124.  {\end{adjustwidth}}
  125.  
  126. \newcommand{\emailsymbol}{\faAt}
  127. \newcommand{\phonesymbol}{\faPhone}
  128. \newcommand{\homepagesymbol}{\faChain}
  129. \newcommand{\locationsymbol}{\faMapMarker}
  130. \newcommand{\linkedinsymbol}{\faLinkedin}
  131. \newcommand{\twittersymbol}{\faTwitter}
  132. \newcommand{\githubsymbol}{\faGithub}
  133. \newcommand{\orcidsymbol}{\aiOrcid}
  134. \newcommand{\mailsymbol}{\faEnvelope}
  135.  
  136. \newcommand{\printinfo}[2]{\mbox{\textcolor{accent}{\normalfont #1}\hspace{0.5em}#2\hspace{2em}}}
  137.  
  138. \newcommand{\name}[1]{\def\@name{#1}}
  139. \newcommand{\tagline}[1]{\def\@tagline{#1}}
  140. \newcommand{\photo}[2]{\def\@photo{#2}\def\@photodiameter{#1}}
  141. \newcommand{\email}[1]{\printinfo{\emailsymbol}{#1}}
  142. \newcommand{\mailaddress}[1]{\printinfo{\mailsymbol}{#1}}
  143. \newcommand{\phone}[1]{\printinfo{\phonesymbol}{#1}}
  144. \newcommand{\homepage}[1]{\printinfo{\homepagesymbol}{#1}}
  145. \newcommand{\twitter}[1]{\printinfo{\twittersymbol}{#1}}
  146. \newcommand{\linkedin}[1]{\printinfo{\linkedinsymbol}{#1}}
  147. \newcommand{\github}[1]{\printinfo{\githubsymbol}{#1}}
  148. \newcommand{\orcid}[1]{\printinfo{\orcidsymbol}{#1}}
  149. \newcommand{\location}[1]{\printinfo{\locationsymbol}{#1}}
  150.  
  151. \newcommand{\personalinfo}[1]{\def\@personalinfo{#1}}
  152.  
  153. \newcommand{\makecvheader}{%
  154.  \begingroup
  155.    \ifdef{\@photodiameter}{\begin{minipage}{\dimexpr\linewidth-\@photodiameter-2em}}{}%
  156.    \raggedright\color{emphasis}%
  157.    {\Huge\bfseries\MakeUppercase{\@name}\par}
  158.    \medskip
  159.    {\large\bfseries\color{accent}\@tagline\par}
  160.    \medskip
  161.    {\footnotesize\bfseries\@personalinfo\par}
  162.    \ifdef{\@photodiameter}{%
  163.    \end{minipage}\hfill%
  164.    \begin{minipage}{\@photodiameter}
  165.    \if@normalphoto
  166.      \includegraphics[width=\linewidth]{\@photo}
  167.    \else
  168.      \tikz\path[fill overzoom image={\@photo}]circle[radius=0.5\linewidth];
  169.    \fi%
  170.    \end{minipage}\par}{}%
  171.  \endgroup\medskip
  172. }
  173.  
  174. \renewenvironment{quote}{\color{accent}\itshape\large}{\par}
  175.  
  176. \newcommand{\cvsection}[2][]{%
  177.  \bigskip%
  178.  \ifstrequal{#1}{}{}{\marginpar{\vspace*{\dimexpr1pt-\baselineskip}\raggedright\input{#1}}}%
  179.  {\color{heading}\LARGE\bfseries\MakeUppercase{#2}}\\[-1ex]%
  180.  {\color{heading}\rule{\linewidth}{2pt}\par}\medskip
  181. }
  182.  
  183. \newcommand{\cvsubsection}[1]{%
  184.  \smallskip%
  185.  {\color{emphasis}\large\bfseries{#1}\par}\medskip
  186. }
  187.  
  188. % v1.1.4: fixes inconsistent font size
  189. \newcommand{\cvevent}[4]{%
  190.  {\large\color{emphasis}#1\par}
  191.  \smallskip\normalsize
  192.  \ifstrequal{#2}{}{}{
  193.  \textbf{\color{accent}#2}\par
  194.  \smallskip}
  195.  \ifstrequal{#3}{}{}{{\small\makebox[0.5\linewidth][l]{\faCalendar\hspace{0.5em}#3}}}%
  196.  \ifstrequal{#4}{}{}{{\small\makebox[0.5\linewidth][l]{\faMapMarker\hspace{0.5em}#4}}}\par
  197.  \medskip\normalsize
  198. }
  199.  
  200. \newcommand{\cvachievement}[3]{%
  201.  \begin{tabularx}{\linewidth}{@{}p{2em} @{\hspace{1ex}} >{\raggedright\arraybackslash}X@{}}
  202.  \multirow{4}{*}{\Large\color{accent}#1} & \bfseries\textcolor{emphasis}{#2}\\
  203.  & #3
  204.  \end{tabularx}%
  205.  %\smallskip
  206. }
  207.  
  208. \newcommand{\cvproject}[1]{%
  209.  {\textbf{\color{accent}#1}\par}
  210.  \smallskip\normalsize
  211. }
  212.  
  213. \newcommand{\cvtag}[1]{%
  214.  \tikz[baseline]\node[anchor=base,draw=body!30,rounded corners,inner xsep=1ex,inner ysep =0.75ex,text height=1.5ex,text depth=.25ex]{#1};
  215. }
  216.  
  217. \newcommand{\cvskill}[2]{%
  218. \textcolor{emphasis}{\textbf{#1}}\hfill
  219. \foreach \x in {1,...,5}{%
  220.  \space{\ifnumgreater{\x}{#2}{\color{body!30}}{\color{accent}}\ratingmarker}}\par%
  221. }
  222.  
  223. % Adapted from @Jake's answer at http://tex.stackexchange.com/a/82729/226
  224. \newcommand{\wheelchart}[4][0]{%
  225.     \begingroup\centering
  226.     \def\innerradius{#3}%
  227.     \def\outerradius{#2}%
  228.     % Calculate total
  229.     \pgfmathsetmacro{\totalnum}{0}%
  230.     \foreach \value/\colour/\name in {#4} {%
  231.         \pgfmathparse{\value+\totalnum}%
  232.         \global\let\totalnum=\pgfmathresult%
  233.     }%
  234.     \begin{tikzpicture}
  235.  
  236.       % Calculate the thickness and the middle line of the wheel
  237.       \pgfmathsetmacro{\wheelwidth}{\outerradius-\innerradius}
  238.       \pgfmathsetmacro{\midradius}{(\outerradius+\innerradius)/2}
  239.       \pgfmathsetmacro{\totalrot}{-90 + #1}
  240.  
  241.       % Rotate so we start from the top
  242.       \begin{scope}[rotate=\totalrot]
  243.  
  244.       % Loop through each value set. \cumnum keeps track of where we are in the wheel
  245.       \pgfmathsetmacro{\cumnum}{0}
  246.       \foreach \value/\width/\colour/\name in {#4} {
  247.             \pgfmathsetmacro{\newcumnum}{\cumnum + \value/\totalnum*360}
  248.  
  249.             % Calculate the percent value
  250.             \pgfmathsetmacro{\percentage}{\value/\totalnum*100}
  251.             % Calculate the mid angle of the colour segments to place the labels
  252.             \pgfmathsetmacro{\midangle}{-(\cumnum+\newcumnum)/2}
  253.  
  254.             % This is necessary for the labels to align nicely
  255.             \pgfmathparse{
  256.                (-\midangle>180?"west":"east")
  257.             } \edef\textanchor{\pgfmathresult}
  258.             \pgfmathparse{
  259.                (-\midangle>180?"flush left":"flush right")
  260.             } \edef\textalign{\pgfmathresult}
  261.             \pgfmathsetmacro\labelshiftdir{1-2*(-\midangle<180)}
  262.  
  263.             % Draw the color segments. Somehow, the \midrow units got lost, so we add 'pt' at the end. Not nice...
  264.             \filldraw[draw=white,fill=\colour] (-\cumnum:\outerradius) arc (-\cumnum:-(\newcumnum):\outerradius) --
  265.             (-\newcumnum:\innerradius) arc (-\newcumnum:-(\cumnum):\innerradius) -- cycle;
  266.  
  267.             % Draw the data labels
  268.             \draw  [*-,thin,emphasis] node [append after command={(\midangle:\midradius pt) -- (\midangle:\outerradius + 1ex) -- (\tikzlastnode)}] at (\midangle:\outerradius + 1ex) [xshift=\labelshiftdir*0.5cm,inner sep=1ex, outer sep=0pt, text width=\width,anchor=\textanchor,align=\textalign,font=\small,text=body]{\name};
  269.             % Set the old cumulated angle to the new value
  270.             \global\let\cumnum=\newcumnum
  271.         }
  272.       \end{scope}
  273. %      \draw[gray] (0,0) circle (\outerradius) circle (\innerradius);
  274.     \end{tikzpicture}\par
  275.     \endgroup
  276. }
  277.  
  278. \newcommand{\cvref}[3]{%
  279.   \smallskip
  280.   \textcolor{emphasis}{\textbf{#1}}\par
  281.   \begin{description}[font=\color{accent},style=multiline,leftmargin=1.35em]
  282.   \item[\normalfont\emailsymbol] #2
  283.   \item[\small\normalfont\mailsymbol] #3
  284.   \end{description}
  285. %   \medskip
  286. }
  287.  
  288. \newenvironment{cvcolumn}[1]{\begin{minipage}[t]{#1}\raggedright}{\end{minipage}}
  289.  
  290. \RequirePackage[backend=biber,style=authoryear,sorting=ydnt]{biblatex}
  291. %% For removing numbering entirely when using a numeric style
  292. % \setlength{\bibhang}{1em}
  293. % \DeclareFieldFormat{labelnumberwidth}{\makebox[\bibhang][l]{\itemmarker}}
  294. % \setlength{\biblabelsep}{0pt}
  295. \defbibheading{pubtype}{\cvsubsection{#1}}
  296. \renewcommand{\bibsetup}{\vspace*{-\baselineskip}}
  297. \AtEveryBibitem{\makebox[\bibhang][l]{\itemmarker}}
  298. \setlength{\bibitemsep}{0.25\baselineskip}
  299.  
  300. % v1.1.2: make it easier to add a sidebar aligned with top of next page
  301. \RequirePackage{afterpage}
  302. \newcommand{\addsidebar}[2][]{\marginpar{%
  303.   \ifstrequal{#1}{}{}{\vspace*{#1}}%
  304.   \input{#2}}%
  305. }
  306. \newcommand{\addnextpagesidebar}[2][]{\afterpage{\addsidebar[#1]{#2}}}
  307.  
  308. \AtBeginDocument{%
  309.   \pagestyle{empty}
  310.   \color{body}
  311.   \raggedright
  312. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement