A repository holding my CV.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
4.3 KiB

3 years ago
  1. \ProvidesPackage{simplecv}
  2. % Packages
  3. \usepackage[cm]{fullpage} % Margins
  4. \usepackage[hidelinks]{hyperref} % Hyperlinks
  5. \usepackage{titlesec} % Title formatting
  6. \usepackage{subfiles} % File importing
  7. \usepackage{multicol} % Multiple columns
  8. \usepackage[usenames,dvipsnames]{xcolor} % Coloring
  9. \usepackage{enumitem} % List customization
  10. \usepackage{lastpage} % Page numbering
  11. \usepackage{fancyhdr} % Footers
  12. \usepackage[russian,english]{babel} % Language styles
  13. \usepackage{graphicx} % Importing graphics
  14. \usepackage[export]{adjustbox} % Aligning margins
  15. % % Chinese
  16. % \usepackage{xeCJK}
  17. % \setCJKmainfont{BabelStone Han}
  18. % % Cyrillic/Russian
  19. % \usepackage{hyphenat}
  20. % \babelfont{rm}{Droid Sans}
  21. % Styling
  22. \pagestyle{fancy}
  23. \fancyhf{}
  24. \renewcommand{\headrulewidth}{0pt}
  25. \renewcommand{\footrulewidth}{0pt}
  26. \urlstyle{same}
  27. \raggedbottom
  28. \raggedright
  29. \setlength{\tabcolsep}{0in}
  30. % Quotes
  31. \usepackage[autostyle,english=american]{csquotes}
  32. \MakeOuterQuote{"}
  33. % Hyperlinks
  34. % \newcommand{\link}[2]{\href{#1}{\underline{\smash{#2}}}}
  35. \newcommand{\link}[2]{\href{#1}{#2}}
  36. % Define colors
  37. \definecolor{color-text}{gray}{0.10} % light black
  38. \definecolor{color-detail}{gray}{0.40} % dark gray
  39. \colorlet{color-title}{\theme} % black
  40. % Set text color
  41. \makeatletter
  42. \newcommand{\globalcolor}[1]{\color{#1}\global\let\default@color\current@color}
  43. \makeatother
  44. \AtBeginDocument{\globalcolor{color-text}}
  45. % Shorthand
  46. \newcommand{\github}[1]{\href{https://github.com/#1/}{github.com/#1}}
  47. \newcommand{\email}[1]{\href{mailto:#1}{#1}}
  48. \newcommand{\website}[1]{\href{https://#1/}{#1}}
  49. \newcommand{\linkedin}[1]{\href{https://www.linkedin.com/in/#1/}{#1}}
  50. % Dummy environment
  51. \newenvironment*{dummyenv}{}{}
  52. % Inline heading
  53. \newcommand{\headinginline}[2]{
  54. \begin{minipage}[t]{0.60\textwidth}
  55. \vspace*{\fill}
  56. \Huge \textcolor{color-title}{#1}
  57. \end{minipage}
  58. \begin{minipage}[t]{0.35\textwidth}
  59. \begin{flushright}
  60. #2
  61. \end{flushright}
  62. \end{minipage}
  63. }
  64. % Photo heading
  65. \newcommand{\headingphoto}[3]{
  66. \begin{minipage}[t]{0.60\textwidth}
  67. \begin{dummyenv}
  68. \vspace*{\fill}
  69. \Huge \textcolor{color-title}{#1}
  70. \end{dummyenv}
  71. \vspace{5mm}\\
  72. #2
  73. \end{minipage}
  74. \begin{minipage}[t]{0.35\textwidth}
  75. \begin{flushright}
  76. \includegraphics[width=.5\linewidth,valign=t]{#3}
  77. \end{flushright}
  78. \end{minipage}
  79. }
  80. % Two-columns
  81. \newcommand{\sidebyside}[2]{
  82. \begin{multicols}{2}
  83. #1 \columnbreak
  84. #2 \end{multicols}
  85. }
  86. % Section titles
  87. \titleformat{\section}{
  88. \scshape\raggedright\Large\color{color-title}}{}{0em}{}[\color{color-title}\titlerule
  89. \vspace{-\smallskipamount}]
  90. % Footer
  91. \fancyfoot[R]{Page \thepage \hspace{1pt} of \pageref{LastPage}}
  92. % Lists
  93. \newcommand{\outerlist}[1]{
  94. \begin{itemize}[leftmargin=*] #1 \end{itemize}}
  95. \newcommand{\denseouterlist}[1]{
  96. \begin{itemize}[leftmargin=*,itemsep=0pt] #1 \end{itemize}}
  97. \newcommand{\innerlist}[1]{
  98. \begin{itemize}[topsep=0pt] #1 \end{itemize}}
  99. \newcommand{\orderedouterlist}[1]{
  100. \begin{enumerate}[leftmargin=*] #1 \end{enumerate}}
  101. % List items
  102. \newcommand{\entry}[1]{\item\small{#1}}
  103. \newcommand{\entryextra}[1]{\textcolor{color-detail}{\entry{#1}}}
  104. \newcommand{\entrylabeled}[2][]{\item[#1]\small{#2}}
  105. \newcommand{\entrymid}[4][]{
  106. \item[#1] \small{#2} \hfill \small{#3}
  107. \vspace{-\smallskipamount} \item[]\small{\textit{#4}}}
  108. \newcommand{\entrybig}[5][]{\item[#1]
  109. \begin{tabular*}{0.97\textwidth}{l@{\extracolsep{\fill}}r}
  110. #2 & #3 \\ {\small#4} & {\small #5} \\ \end{tabular*}}
  111. % Fill year
  112. \newcommand{\fillyear}[1]{\phantom{#1}}
  113. % Make author name bold: https://tex.stackexchange.com/a/327046
  114. \newcommand*{\boldname}[3]{%
  115. \def\lastname{#1}%
  116. \def\firstname{#2}%
  117. \def\firstinit{#3}}
  118. \boldname{}{}{}
  119. \renewcommand{\mkbibnamegiven}[1]{%
  120. \ifboolexpr{ ( test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}} ) and test {\ifdefequal{\lastname}{\namepartfamily}} }
  121. {\mkbibbold{#1}}{#1}%
  122. }
  123. \renewcommand{\mkbibnamefamily}[1]{%
  124. \ifboolexpr{ ( test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}} ) and test {\ifdefequal{\lastname}{\namepartfamily}} }
  125. {\mkbibbold{#1}}{#1}%
  126. }