From 806c8c4a95908829481c793b24232d7a87ca5f7a Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 1 Jul 2019 19:40:34 +0200 Subject: [PATCH] Add resume-modern files --- Makefile | 81 +++++++- sample_resume.yml | 60 ++++++ template.tex | 457 ++++++++++++++++++++++++++++++---------------- 3 files changed, 433 insertions(+), 165 deletions(-) create mode 100644 sample_resume.yml diff --git a/Makefile b/Makefile index 4c0238e..331ac9f 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,75 @@ -TEX = pandoc -src = details.yml -FLAGS = --pdf-engine xelatex --template template.tex +## ---- user config ---- -CV-Amin-Kasrou-Aouam.pdf : $(src) - $(TEX) $(src) -o $@ $(FLAGS) +# Set to anything non-empty to suppress most of latex's messaging. To diagnose +# LaTeX errors, you may want to do `make latex_quiet=""` to get verbose output +latex_quiet := true -.PHONY: clean -clean : - rm output.pdf +# Set to anything non-empty to reprocess TeX files every time we make a PDF. +# Otherwise these files will be regenerated only when the source markdown +# changes; in that case, if you change other dependencies (e.g. a +# bibliography), use the -B option to make in order to force regeneration. +# always_latexmk := true +always_latexmk := true + +# Set to anything non-empty to use xelatex rather than pdflatex. I always do +# this in order to use system fonts and better Unicode support. pdflatex is +# faster, and there are some packages with which xelatex is incompatible. +xelatex := true + +# list of markdown files that are not to be made into PDFs +EXCLUDE := README.md + +# Extra options to pandoc (e.g. "-H mypreamble.tex") +PANDOC_OPTIONS := + +## ---- special external file ---- + +# Normally this does not need to be changed: +# works if the template is local or in ~/.pandoc/templates +PANDOC_TMPL := resume.template + +## ---- subdirectories (normally, no need to change) ---- + +# source of YAML spec files +yml_dir := . + +# temporary file subdirectory; will be removed after every latex run +temp_dir := tmp + +# name of output directory for .tex and .pdf files +out_dir := out + +## ---- commands ---- + +# Change these only to really change the behavior of the whole setup + +PANDOC := pandoc --template $(PANDOC_TMPL) $(PANDOC_OPTIONS) + +LATEXMK := latexmk $(if $(xelatex),-xelatex,-pdflatex="pdflatex %O %S") \ + $(if $(latex_quiet),-silent,-verbose) + +## ---- build rules ---- + +ymls := $(filter-out $(addprefix $(yml_dir)/,$(EXCLUDE)),$(wildcard $(yml_dir)/*.yml)) +texs := $(patsubst %.yml,%.tex,$(ymls)) +pdfs := $(patsubst %.yml,%.pdf,$(ymls)) +bibs := $(wildcard $(yml_dir)/*.bib) + +$(texs): %.tex: %.yml $(bibs) $(PANDOC_TMPL) + $(PANDOC) -o $@ $< # pandoc template > .tex + +phony_pdfs := $(if $(always_latexmk),$(pdfs) $(notes_pdf)) + +.PHONY: $(phony_pdfs) all clean + +$(pdfs): %.pdf: %.tex + @echo $(bibs) + $(LATEXMK) $< + +all: $(pdfs) + +# clean up everything except final pdfs +clean: + latexmk -c + +.DEFAULT_GOAL := all diff --git a/sample_resume.yml b/sample_resume.yml new file mode 100644 index 0000000..5b13f49 --- /dev/null +++ b/sample_resume.yml @@ -0,0 +1,60 @@ +--- +# Personal details +name: Isaac Newton +phone: +44 1223 338400 +email: isaac.newton@trin.cam.ac.uk +linkedin: 'in/isaacnewton' +publications: '\*' + +headline: | + Natural Philosopher + +about: | + I invented calculus and gravity. I also wrote a few important papers on optics, planetary motion, and math. + +education: +- year: 1667 + degree: MA + focus: Mathematics and Physics + institution: Cambridge + department: "Trinity College" +- year: 1665 + degree: BA + focus: Philosophy + institution: Cambridge + department: "Trinity College" + +skills: + - calculus + - optics + - writing papers + - "casual ocular needle insertion" + - mechanics + - heliocentricity + - astronomy + - planetary motion + - "finding roots of functions" + - alchemy + - latin + - public speaking + +experience: +- company: Trinity College, Cambridge + years: + start: '1669' + end: '1702' + position: Lucasian Professor of Mathematics + description: "Mainly mathematical sciences, but also the study of alchemy and biblical chronology. I generalized the binomial theorem to allow real exponents other than nonnegative integers. Also devised a method for finding successively better approximations to the roots (or zeroes) of a real-valued function, it's called ``Newton's method''" +- company: Trinity College + years: + start: '1661' + end: '1664' + position: Valet + description: "Tending to my employer as his personal assistant. I was a subsizar to help pay for studies at Trinity College." +- company: Farm + years: + start: '1659' + end: '1661' + position: Farmer + description: "Tedious and laborious farm work. I hated it. My mother made me do it after my dumb step-father died again." +--- diff --git a/template.tex b/template.tex index cfccfcc..d6a7cf6 100644 --- a/template.tex +++ b/template.tex @@ -1,168 +1,311 @@ -%!TEX TS-program = xelatex -%!TEX encoding = UTF-8 Unicode +% !TEX encoding = UTF-8 Unicode -\documentclass[$fontsize$, a4paper]{article} +\documentclass[letterpaper,12pt]{article} -% LAYOUT -%-------------------------------- -% Margins -\usepackage{geometry} -\geometry{$geometry$} - -% Do not indent paragraphs -\setlength\parindent{0in} - -% Enable multicolumns -\usepackage{multicol} -\setlength{\columnsep}{-3.5cm} - -% Uncomment to suppress page numbers -\pagenumbering{gobble} - -% LANGUAGE -%-------------------------------- -% Set the main language -$if(lang)$ -\usepackage{polyglossia} -\setmainlanguage{$lang$} -$endif$ - -% TYPOGRAPHY -%-------------------------------- -\usepackage{fontspec} -\usepackage{xunicode} -\usepackage{xltxtra} -\usepackage{fontawesome} -% converts LaTeX specials (quotes, dashes etc.) to Unicode -\defaultfontfeatures{Mapping=tex-text} -\setromanfont [Ligatures={Common}, Numbers={OldStyle}]{$mainfont$} -% Cool ampersand -\newcommand{\amper}{{\fontspec[Scale=.95]{$mainfont$}\selectfont\itshape\&}} - -% MARGIN NOTES -%-------------------------------- -\usepackage{marginnote} -\newcommand{\note}[1]{\marginnote{\scriptsize #1}} -\renewcommand*{\raggedleftmarginnote}{} -\setlength{\marginparsep}{7pt} -\reversemarginpar - -% HEADINGS -%-------------------------------- -\usepackage{sectsty} -\usepackage[normalem]{ulem} -\sectionfont{\rmfamily\mdseries} -\subsectionfont{\rmfamily\mdseries\scshape\normalsize} -\subsubsectionfont{\rmfamily\bfseries\upshape\normalsize} - -% PROFILE PICTURE -%-------------------------------- +%A Few Useful Packages +%\usepackage{marvosym} +\usepackage{fontspec} %for loading fonts +\usepackage{xunicode,xltxtra,url,parskip} %other packages for formatting \usepackage{graphicx} +\usepackage[usenames,dvipsnames]{xcolor} +\usepackage[left=1.3cm, + top=1.2cm, + right=1.3cm, + bottom=1.2cm, + nohead, + nofoot + ]{geometry} +\usepackage{tabularx} +\usepackage{titlesec} +%\usepackage{tabto} % tab spacing -% SIDE BLOCK -%-------------------------------- +\usepackage{setspace} % line spacing +\usepackage{booktabs,colortbl} % thicker rules between table cells +\usepackage{bibentry} % bibliography - -% PDF SETUP -%-------------------------------- -\usepackage{hyperref} -\hypersetup -{ - pdfauthor={$name$}, - pdfsubject={$name$'s CV}, - pdftitle={$name$'s CV}, - colorlinks, breaklinks, xetex, bookmarks, - filecolor=black, - urlcolor=[rgb]{0.117,0.682,0.858}, - linkcolor=[rgb]{0.117,0.682,0.858}, - linkcolor=[rgb]{0.117,0.682,0.858}, - citecolor=[rgb]{0.117,0.682,0.858} +% SORTED LISTS +\usepackage{paralist} +\usepackage{datatool}% http://ctan.org/pkg/datatool +\newcommand{\sortitem}[1]{% + \DTLnewrow{list}% Create a new entry + \DTLnewdbentry{list}{description}{#1}% Add entry as description +} +\newenvironment{sortedlist}{% + \DTLifdbexists{list}{\DTLcleardb{list}}{\DTLnewdb{list}}% Create new/discard old list +}{% + \DTLsort{description}{list}% Sort list + \begin{inparaitem}[]% + \DTLforeach*{list}{\theDesc=description}{% + \item \theDesc, }% Print each item + \end{inparaitem}% } -% DOCUMENT -%-------------------------------- +%Setup hyperref package, and colours for links +\usepackage[colorlinks, + breaklinks, + pagebackref=false, + debug=true, + xetex, + bookmarks=false, + pdfpagelabels=false, + hyperfootnotes=false, + hyperindex=false, + pageanchor=false]{hyperref} +\definecolor{linkcolor}{gray}{0.2} +\hypersetup{ + pdfauthor={$name$}, + pdfsubject={$name$ - Resume}, + pdftitle={$name$ - Resume}, + urlcolor=linkcolor, + linkcolor=linkcolor +} + +% colors +\definecolor{dark-gray}{gray}{0.15} +\definecolor{light-gray}{gray}{0.55} + +%FONTS +\setmainfont{EB Garamond} +\newfontfamily{\hlight}[UprightFont={* Light}]{EB Garamond} +%\defaultfontfeatures{Mapping=tex-text} % converts LaTeX specials (``quotes'' --- dashes etc.) to unicode +\defaultfontfeatures{ + Path = /usr/local/texlive/2017/texmf-dist/fonts/opentype/public/fontawesome/ } +\usepackage{fontawesome} % glyphs for contact info + +% CUSTOM COMMANDS + \newcommand{\titlerulethick}{{% + {\color{dark-gray} \titlerule[0.7mm] }% + }} + + % old section title format + \titleformat{\section}{\fontsize{34pt}{40pt}\color{dark-gray}\normalfont}{}{0mm}{}[\titlerulethick] + %\titlespacing{\section}{0pt}{3pt}{3pt} + + \newcommand{\namefont}[1]{{% + \fontsize{42pt}{50pt}\normalfont\textbf{#1}% + }} + + \newcommand{\spacerule}{ + \addlinespace[0.5em] + \midrule[0.5mm] + \addlinespace[0.5em] + } + + \newcommand{\bigfont}[1]{{% + \fontsize{32pt}{38pt}\normalfont{#1} % + }} + + \newcommand{\lightfont}[1]{{% + {\hlight\color{light-gray}#1} + }} + + \newcommand{\contactinfo}{% + {\hlight\color{dark-gray}} + } + + \newcommand{\lightsmall}[1]{{% + {\fontsize{11pt}{14pt}\hlight\color{light-gray}#1} + }} + + \newcommand{\pubstyle}[1]{{% + {\fontsize{10pt}{13pt}\hlight\color{light-gray}#1} + }} + + \newcommand{\lightbf}[1]{{% + \textbf{\lightfont{#1}} + }} + + \newcommand{\emphasized}[1]{{% + {\fontsize{14pt}{18pt}\textbf{#1}} + }} + + \newcommand{\position}[1]{{% + {\fontsize{14pt}{18pt} \hlight{#1}} + }} + + \newcommand{\company}[1]{{% + {\fontsize{14pt}{18pt} \textbf{#1}} + }} + + \newcommand{\headline}{ + {\fontsize{14pt}{17pt}\bfseries\color{dark-gray}$headline$} + } + + \newcommand{\name}{ + \raggedright\fontsize{42pt}{42pt}\bfseries\flushleft\color{dark-gray}{$name$} + } + + \newcommand{\lighthrule}{ + {\color{light-gray}\par\rule[0mm]{\hsize}{0.5mm}\par\vspace{0.5em}} + } + + \newcommand\Mybox[1]{% + \setlength\fboxsep{0pt}\fcolorbox{red}{white}{#1} + } + +% hack to remove bibliography numbering +\makeatletter +\renewcommand\@biblabel[1]{} +\renewenvironment{thebibliography}[1] + {\section*{\refname}% + \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}% + \list{}% + {\leftmargin0pt + \@openbib@code + \usecounter{enumiv}}% + \sloppy + \clubpenalty4000 + \@clubpenalty \clubpenalty + \widowpenalty4000% + \sfcode`\.\@m} + {\def\@noitemerr + {\@latex@warning{Empty `thebibliography' environment}}% + \endlist} +\makeatother +% +% +% +% +% +% +% +% +% +%-------------------- BEGIN DOCUMENT ---------------------- \begin{document} -\hfill \includegraphics[width = 70pt]{./photo.png} - -{\LARGE $name$}\\[.2cm] - -$if(urls)$ -\begin{multicols}{2} -$endif$ - -$for(address)$ -$address$\\ -$endfor$ -\vspace{-10pt} - -\faPhone \hspace{2 mm} $phone$\\ -\faEnvelope \hspace{2 mm} \href{mailto:$email$}{$email$}\\ - -$if(urls)$ -\columnbreak - -$for(urls)$ -\href{https://$urls$}{$urls$}\\ -$endfor$ -\end{multicols} -$endif$ - -\vspace{30pt} - -$if(intro)$ -$intro$ -$endif$ - -\section*{Lenguajes de ProgramaciĆ³n} -$if(programming)$ -\begin{itemize} - $for(programming)$ - \item $programming$ - $endfor$ -\end{itemize} -$endif$ - -\section*{Software} -$if(technologies)$ -\begin{itemize} - $for(technologies)$ -\item $technologies$ - $endfor$ -\end{itemize} -$endif$ -% \vfill - -\vspace{25pt} - -%\section*{Experiencia Laboral} -%\noindent -%$for(experience)$ -%\note{$experience.years$}\textsc{$experience.employer$}\\ -%\emph{$experience.job$}\\ -%$experience.city$\\[.2cm] -%$endfor$ - -$if(education)$ -\section*{EducaciĆ³n} -\noindent +\nocite{$publications$} +\pagestyle{empty} % non-numbered pages +\font\fb=''[cmr10]'' %for use with \LaTeX command +%---------- SPECIFY LENGTHS ---------- +\newlength{\leftwide} +\setlength{\leftwide}{0.34\textwidth} +% +\newlength{\centerwide} +\setlength{\centerwide}{0.33\textwidth} +% +\newlength{\rightwide} +\setlength{\rightwide}{0.28\textwidth} +%---------- TOP SECTION ---------- +\begin{tabular}[b]{@{}p{\leftwide}@{}p{\centerwide}@{}p{\rightwide}@{}} + % NAME (left) + \noindent + \begin{minipage}[b]{\leftwide} + \name + \end{minipage} & % + % + % HEADLINE (middle) + \begin{minipage}[b]{\centerwide} + \parbox[b][][b]{4.5cm}{\raggedright\headline} + \end{minipage} & % + % + % CONTACT INFO (right) + \begin{minipage}[b]{\rightwide} + \renewcommand\arraystretch{1.25} + \contactinfo + \begin{tabular}[b]{@{}cl@{}} + \faEnvelopeO & \href{mailto:$email$}{$email$}\\ %{} + \faPhone & $phone$\\ + \faLinkedin & \href{http://www.linkedin.com/$linkedin$}{$linkedin$} + \end{tabular} + \end{minipage} +\end{tabular} +\lighthrule +%---------- MAIN BODY ---------- +%---------- LEFT SIDE ---------- +%\Mybox{ +\begin{minipage}[t]{0.31\textwidth} + \raggedright + \begin{flushleft} + % ABOUT + \section{about} + \parbox[t][][t]{\textwidth}{ + \lightsmall{ + \begin{flushleft} + $about$ + \end{flushleft} + } + } +% +% +% EDUCATION +\section{education} +% +%\setlength{\parskip}{1mm} $for(education)$ -\note{$education.year$}\textbf{$education.subject$}$if(education.degree)$, $education.degree$$endif$\\ -\emph{$education.institute$}$if(education.city)$, $education.city$$endif$\\[.2cm] + \lightbf{$education.year$} \\ + \smallskip + \emphasized{$education.degree$} \\ + \emphasized{$education.focus$} \\ + \smallskip + \lightfont{\textbf{$education.institution$} \\ + \emph{$education.department$}} \\ % + % + \bigskip % $endfor$ -$endif$ - -$if(languages)$ -\section*{Idiomas} -$for(languages)$ -\emph{$languages.language$} ($languages.proficiency$)\\ -$endfor$ -$endif$ - -$if(courses)$ -\section*{Cursos} -$for(courses)$ -\emph{$courses.name$} ($courses.intitution$)\\ -$endfor$ -$endif$ - +% +% + % SKILLS + \section{skills} + \hlight + \begin{sortedlist} + $for(skills)$ + \sortitem{$skills$} + $endfor$ + \end{sortedlist} +\end{flushleft} +\end{minipage}% +% +%---------- RIGHT SIDE ---------- +\newlength{\hwide} +\newlength{\hwideright} +\newlength{\buffer} +\setlength{\buffer}{4pt plus 1pt minus 1pt} +% +% +\begin{minipage}[t]{0.64\textwidth} + \section{experience} + % + \setlength{\hwide}{\dimexpr.5\hsize-4\tabcolsep} + \setlength{\hwideright}{\dimexpr\hwide+5\tabcolsep} + % + % POSITIONS + \begin{tabular}{@{}p{\hwide}p{\hwideright}} + \arrayrulecolor{light-gray} + $for(experience)$ + \parbox[t][][t]{\hwide}{% + \raggedright + \company{$experience.company$}\\ + \vspace{\buffer} + \lightfont{% + $experience.years.start$ \textendash{} $experience.years.end$\\ + $if(experience.location)$ + $experience.location$\\ + $endif$ + \vspace{\buffer}} + $if(experience.group)$ + \lightsmall{\emph{$experience.group$}}% + $endif$ + } & % + \parbox[t][][t]{\hwideright}{% + \raggedright + \position{$experience.position$}\\ + \vspace{\buffer} + \lightsmall{$experience.description$} + }\\ + \spacerule + $endfor$ + \end{tabular} +% +\section{publications} +\vspace{-0.5em} +\begingroup +\renewcommand{\section}[2]{}% +\pubstyle{ + \bibliography{pubs} + \bibliographystyle{cvbib} +} +\endgroup +\end{minipage} +% ========================================================== +%-------------------- END OF DOCUMENT ---------------------- \end{document}