From 98280c05f3ebfeae87c0d5a3f1301a40588bb6a0 Mon Sep 17 00:00:00 2001 From: Sina Atalay <79940989+sinaatalay@users.noreply.github.com> Date: Sun, 7 Apr 2024 17:40:35 +0000 Subject: [PATCH] engineeringresumes: improve templates and use charter font --- .../engineeringresumes/BulletEntry.j2.tex | 7 +- .../engineeringresumes/EducationEntry.j2.tex | 25 +++- .../engineeringresumes/ExperienceEntry.j2.tex | 25 +++- .../themes/engineeringresumes/Header.j2.tex | 2 +- .../engineeringresumes/NormalEntry.j2.tex | 25 +++- .../engineeringresumes/OneLineEntry.j2.tex | 8 +- .../themes/engineeringresumes/Preamble.j2.tex | 123 ++++++++++++------ .../PublicationEntry.j2.tex | 23 +++- .../engineeringresumes/TextEntry.j2.tex | 7 +- .../themes/engineeringresumes/__init__.py | 72 ++++++++-- 10 files changed, 234 insertions(+), 83 deletions(-) diff --git a/rendercv/themes/engineeringresumes/BulletEntry.j2.tex b/rendercv/themes/engineeringresumes/BulletEntry.j2.tex index 9911e90..981d14c 100644 --- a/rendercv/themes/engineeringresumes/BulletEntry.j2.tex +++ b/rendercv/themes/engineeringresumes/BulletEntry.j2.tex @@ -1,2 +1,7 @@ -$\vcenter{\hbox{\small$\bullet$}}$ <> +((* if not is_first_entry *)) +\vspace{<>} +((* endif *)) +\begin{onecolentry} + \textbullet \hspace{3pt} <> +\end{onecolentry} diff --git a/rendercv/themes/engineeringresumes/EducationEntry.j2.tex b/rendercv/themes/engineeringresumes/EducationEntry.j2.tex index b20316a..12ae21c 100644 --- a/rendercv/themes/engineeringresumes/EducationEntry.j2.tex +++ b/rendercv/themes/engineeringresumes/EducationEntry.j2.tex @@ -1,15 +1,26 @@ ((* if not is_first_entry *)) -\vspace{8pt} +\vspace{<>} ((* endif *)) -\textbf{<>}, ((* if entry.degree *))<> in ((* endif *))<>((* if entry.location *)) -- <>((* endif *)) \hfill <> - +((* if entry.date_string == "" *)) +\begin{onecolentry} +((* else *)) +\begin{twocolentry}{ + <> +} +((* endif *)) + \textbf{<>}, ((* if entry.degree *))<> in ((* endif *))<>((* if entry.location *)) -- <>((* endif *)) ((* for item in entry.highlights *)) ((* if loop.first *)) -\begin{highlights} + \begin{highlights} ((* endif *)) -\item <> + \item <> ((* if loop.last *)) -\end{highlights} + \end{highlights} ((* endif *)) -((* endfor *)) \ No newline at end of file +((* endfor *)) +((* if entry.date_string == "" *)) +\end{onecolentry} +((* else *)) +\end{twocolentry} +((* endif *)) \ No newline at end of file diff --git a/rendercv/themes/engineeringresumes/ExperienceEntry.j2.tex b/rendercv/themes/engineeringresumes/ExperienceEntry.j2.tex index 9780bf1..7f2a1d0 100644 --- a/rendercv/themes/engineeringresumes/ExperienceEntry.j2.tex +++ b/rendercv/themes/engineeringresumes/ExperienceEntry.j2.tex @@ -1,15 +1,26 @@ ((* if not is_first_entry *)) -\vspace{8pt} +\vspace{<>} ((* endif *)) -\textbf{<>}, <>((* if entry.location*)) -- <>((* endif *)) \hfill <> - +((* if entry.date_string == "" *)) +\begin{onecolentry} +((* else *)) +\begin{twocolentry}{ + <> +} +((* endif *)) + \textbf{<>}, <>((* if entry.location *)) -- <>((* endif *)) ((* for item in entry.highlights *)) ((* if loop.first *)) -\begin{highlights} + \begin{highlights} ((* endif *)) -\item <> + \item <> ((* if loop.last *)) -\end{highlights} + \end{highlights} ((* endif *)) -((* endfor *)) \ No newline at end of file +((* endfor *)) +((* if entry.date_string == "" *)) +\end{onecolentry} +((* else *)) +\end{twocolentry} +((* endif *)) \ No newline at end of file diff --git a/rendercv/themes/engineeringresumes/Header.j2.tex b/rendercv/themes/engineeringresumes/Header.j2.tex index a0ab68d..747b204 100644 --- a/rendercv/themes/engineeringresumes/Header.j2.tex +++ b/rendercv/themes/engineeringresumes/Header.j2.tex @@ -18,7 +18,7 @@ \hspace*{<>} ((* endif *)) ((* if cv.location *)) - \mbox{{\small\faMapMarker*}\hspace*{0.13cm}<>} + \mbox{\color{black}{\small\faMapMarker*}\hspace*{0.13cm}<>} \hspace*{<>} ((* endif *)) ((* if cv.website *)) diff --git a/rendercv/themes/engineeringresumes/NormalEntry.j2.tex b/rendercv/themes/engineeringresumes/NormalEntry.j2.tex index e976086..079e97e 100644 --- a/rendercv/themes/engineeringresumes/NormalEntry.j2.tex +++ b/rendercv/themes/engineeringresumes/NormalEntry.j2.tex @@ -1,15 +1,26 @@ ((* if not is_first_entry *)) -\vspace{8pt} +\vspace{<>} ((* endif *)) -\textbf{<>}((* if entry.location *)) -- <>((* endif *)) \hfill <> - +((* if entry.date_string == "" *)) +\begin{onecolentry} +((* else *)) +\begin{twocolentry}{ + <> +} +((* endif *)) + \textbf{<>}((* if entry.location *)) -- <>((* endif *)) ((* for item in entry.highlights *)) ((* if loop.first *)) -\begin{highlights} + \begin{highlights} ((* endif *)) -\item <> + \item <> ((* if loop.last *)) -\end{highlights} + \end{highlights} ((* endif *)) -((* endfor *)) \ No newline at end of file +((* endfor *)) +((* if entry.date_string == "" *)) +\end{onecolentry} +((* else *)) +\end{twocolentry} +((* endif *)) \ No newline at end of file diff --git a/rendercv/themes/engineeringresumes/OneLineEntry.j2.tex b/rendercv/themes/engineeringresumes/OneLineEntry.j2.tex index a14222e..e7b963f 100644 --- a/rendercv/themes/engineeringresumes/OneLineEntry.j2.tex +++ b/rendercv/themes/engineeringresumes/OneLineEntry.j2.tex @@ -1,3 +1,7 @@ +((* if not is_first_entry *)) +\vspace{<>} +((* endif *)) -\textbf{<>:} <> - +\begin{onecolentry} + \textbf{<>:} <> +\end{onecolentry} diff --git a/rendercv/themes/engineeringresumes/Preamble.j2.tex b/rendercv/themes/engineeringresumes/Preamble.j2.tex index 4c2ca21..f3295b3 100644 --- a/rendercv/themes/engineeringresumes/Preamble.j2.tex +++ b/rendercv/themes/engineeringresumes/Preamble.j2.tex @@ -2,15 +2,17 @@ % Packages: \usepackage[ - ignoreheadfoot, % set margins without considering header and footer - top=<>, % seperation between body and page edge from the top - bottom=<>, % seperation between body and page edge from the bottom - left=<>, % seperation between body and page edge from the left - right=<>, % seperation between body and page edge from the right - footskip=<>, % seperation between body and footer - % showframe % for debugging - ]{geometry} % for adjusting page geometry + ignoreheadfoot, % set margins without considering header and footer + top=<>, % seperation between body and page edge from the top + bottom=<>, % seperation between body and page edge from the bottom + left=<>, % seperation between body and page edge from the left + right=<>, % seperation between body and page edge from the right + footskip=<>, % seperation between body and footer + % showframe % for debugging +]{geometry} % for adjusting page geometry \usepackage{titlesec} % for customizing section titles +\usepackage{tabularx} % for making tables with fixed width columns +\usepackage{array} % tabularx requires this \usepackage[dvipsnames]{xcolor} % for coloring text \definecolor{primaryColor}{RGB}{<>} % define primary color \usepackage{enumitem} % for customizing lists @@ -26,8 +28,17 @@ \usepackage{calc} % for calculating lengths \usepackage{bookmark} % for bookmarks \usepackage{lastpage} % for getting the total number of pages -% \usepackage{charter} % for using charter font -\usepackage{ifthen} +\usepackage{changepage} % for one column entries (adjustwidth environment) +\usepackage{paracol} % for two and three column entries +\usepackage{ifthen} % for conditional statements +\usepackage{needspace} % for avoiding page brake right after the section title +\usepackage{charter} % for using charter font + +% Ensure that generate pdf is machine readable/ATS parsable: +\ifpdf + \input{glyphtounicode} + \pdfgentounicode=1 +\fi % Some settings: \pagestyle{empty} % no header or footer @@ -42,6 +53,8 @@ "PAGE_NUMBER": "\\thepage{}", "TOTAL_PAGES": "\pageref*{LastPage}" } *)) +\setlength{\columnsep}{0.15cm} % set column seperation + \makeatletter \let\ps@customFooterStyle\ps@plain % Copy the plain style to customFooterStyle \patchcmd{\ps@customFooterStyle}{\thepage}{ @@ -51,42 +64,76 @@ \pagestyle{customFooterStyle} ((* endif *)) -\titleformat{\section}{\bfseries\large}{}{0pt}{}[\vspace{1pt}\titlerule] +\titleformat{\section}{\needspace{4\baselineskip}\bfseries\large}{}{0pt}{}[\vspace{1pt}\titlerule] \titlespacing{\section}{ - % left space: - 0pt - }{ - % top space: - <> - }{ - % bottom space: - <> - } % section title spacing + % left space: + 0pt +}{ + % top space: + <> +}{ + % bottom space: + <> +} % section title spacing - \renewcommand\labelitemi{$\vcenter{\hbox{\small$\bullet$}}$} +\renewcommand\labelitemi{$\vcenter{\hbox{\small$\bullet$}}$} \newenvironment{highlights}{ - \begin{itemize}[ - topsep=0pt, - partopsep=0pt, - itemsep=0pt, - % after=\vspace{-1\baselineskip}, - leftmargin=10pt - ] + \begin{itemize}[ + topsep=<>, + parsep=<>, + partopsep=0pt, + itemsep=0pt, + leftmargin=<> + 10pt + ] +}{ + \end{itemize} +} % new environment for highlights + + +\newenvironment{onecolentry}{ + \begin{adjustwidth}{ + <> + 0.00001 cm }{ - \end{itemize} - } % new environment for highlights + <> + 0.00001 cm + } +}{ + \end{adjustwidth} +} % new environment for one column entries + +\newenvironment{twocolentry}[2][]{ + \onecolentry + \def\secondColumn{#2} + \setcolumnwidth{\fill, 4.2cm} + \begin{paracol}{2} +}{ + \switchcolumn \raggedleft \secondColumn + \end{paracol} + \endonecolentry +} % new environment for two column entries + +\newenvironment{threecolentry}[3][]{ + \onecolentry + \def\thirdColumn{#3} + \setcolumnwidth{1cm, \fill, 4.2cm} + \begin{paracol}{3} + \raggedright #2 \switchcolumn +}{ + \switchcolumn \raggedleft \thirdColumn + \end{paracol} + \endonecolentry +} % new environment for three column entries \newenvironment{header}{ - \setlength{\topsep}{0pt}\par\kern\topsep\centering\linespread{1.5} - }{ - \par\kern\topsep - } % new environment for the header + \setlength{\topsep}{0pt}\par\kern\topsep\centering\linespread{1.5} +}{ + \par\kern\topsep +} % new environment for the header \newcommand{\placelastupdatedtext}{% \placetextbox{}{}{} \AddToShipoutPictureFG*{% Add to current page foreground \put( - \LenToUnit{\paperwidth-<>+0.05cm}, + \LenToUnit{\paperwidth-<>-<>+0.05cm}, \LenToUnit{\paperheight-<>} ){\vtop{{\null}\makebox[0pt][c]{ \small\color{gray}\textit{Last updated in <>}\hspace{\widthof{Last updated in <>}} @@ -97,8 +144,4 @@ % save the original href command in a new command: \let\hrefWithoutArrow\href % new command for external links: -\renewcommand{\href}[2]{\hrefWithoutArrow{#1}{\mbox{\ifthenelse{\equal{#2}{}}{ }{#2 }\raisebox{.15ex}{\footnotesize \faExternalLink*}}}} - -% Ensure that generate pdf is machine readable/ATS parsable -\input{glyphtounicode} -\pdfgentounicode=1 \ No newline at end of file +\renewcommand{\href}[2]{\hrefWithoutArrow{#1}{\mbox{\ifthenelse{\equal{#2}{}}{ }{#2 }\raisebox{.15ex}{\footnotesize \faExternalLink*}}}} \ No newline at end of file diff --git a/rendercv/themes/engineeringresumes/PublicationEntry.j2.tex b/rendercv/themes/engineeringresumes/PublicationEntry.j2.tex index 855fa80..8f0c0d8 100644 --- a/rendercv/themes/engineeringresumes/PublicationEntry.j2.tex +++ b/rendercv/themes/engineeringresumes/PublicationEntry.j2.tex @@ -1,12 +1,20 @@ ((* if not is_first_entry *)) -\vspace{8pt} +\vspace{<>} ((* endif *)) -\textbf{<>} -- <> -\begin{highlights} - \item <> - ((*- if entry.doi or entry.journal *)) \item ((* endif -*)) - ((*- if entry.doi -*)) +\begin{twocolentry}{ + <> +} + \textbf{<>} + + \vspace{<>} + + <> + ((* if entry.doi or entry.journal *)) + \vspace{<>} + + ((* endif *)) + ((* if entry.doi -*)) \href{<>}{<>} ((*- endif -*)) ((*- if entry.doi and entry.journal *)) (((* endif -*)) @@ -14,4 +22,5 @@ <> ((*- endif -*)) ((*- if entry.doi and entry.journal *)))((* endif -*)) -\end{highlights} + +\end{twocolentry} diff --git a/rendercv/themes/engineeringresumes/TextEntry.j2.tex b/rendercv/themes/engineeringresumes/TextEntry.j2.tex index 7651cc8..bc9df0e 100644 --- a/rendercv/themes/engineeringresumes/TextEntry.j2.tex +++ b/rendercv/themes/engineeringresumes/TextEntry.j2.tex @@ -1,6 +1,7 @@ ((* if not is_first_entry *)) -\vspace{8pt} +\vspace{<>} ((* endif *)) -<> - +\begin{onecolentry} + This is an example resume to showcase the capabilities of the open-source LaTeX CV generator, \href{https://github.com/sinaatalay/rendercv}{RenderCV}. A substantial part of the content is taken from \href{https://www.careercup.com/resume}{here}, where a \textit{clean and tidy CV} pattern is proposed by \textbf{Gayle L. McDowell}. +\end{onecolentry} \ No newline at end of file diff --git a/rendercv/themes/engineeringresumes/__init__.py b/rendercv/themes/engineeringresumes/__init__.py index ce0a704..fbf0c19 100644 --- a/rendercv/themes/engineeringresumes/__init__.py +++ b/rendercv/themes/engineeringresumes/__init__.py @@ -2,20 +2,76 @@ from typing import Literal from typing import ClassVar as NotUsedInput import pydantic +import pydantic_extra_types.color as pydantic_color -from .. import ThemeOptions, LaTeXDimension -from .. import Margins as MarginsBase +from .. import ( + ThemeOptions, + EntryAreaMargins, + HighlightsAreaMargins, + Margins, + LaTeXDimension, +) -class Margins(MarginsBase): +class EntryAreaMarginsForEngineeringresumes(EntryAreaMargins): + """This class is a data model for the entry area margins.""" + + left_and_right: LaTeXDimension = pydantic.Field( + default="0 cm", + title="Left Margin", + description="The left margin of entry areas. The default value is 0 cm.", + ) + + vertical_between: LaTeXDimension = pydantic.Field( + default="0.1 cm", + title="Vertical Margin Between Entry Areas", + description=( + "The vertical margin between entry areas. The default value is 0.1 cm." + ), + ) + + date_and_location_width: NotUsedInput + + +class HighlightsAreaMarginsForEngineeringresumes(HighlightsAreaMargins): + """This class is a data model for the highlights area margins.""" + + top: LaTeXDimension = pydantic.Field( + default="0.10 cm", + title="Top Margin", + description="The top margin of highlights areas. The default value is 0.10 cm.", + ) + left: LaTeXDimension = pydantic.Field( + default="0 cm", + title="Left Margin", + description="The left margin of highlights areas. The default value is 0 cm.", + ) + vertical_between_bullet_points: LaTeXDimension = pydantic.Field( + default="0.10 cm", + title="Vertical Margin Between Bullet Points", + description=( + "The vertical margin between bullet points. The default value is 0.10 cm." + ), + ) + + +class MarginsForEngineeringresumes(Margins): """This class is a data model for the margins.""" - entry_area: NotUsedInput - highlights_area: NotUsedInput + entry_area: EntryAreaMarginsForEngineeringresumes = pydantic.Field( + default=EntryAreaMarginsForEngineeringresumes(), + title="Entry Area Margins", + description="Entry area margins.", + ) + highlights_area: HighlightsAreaMarginsForEngineeringresumes = pydantic.Field( + default=HighlightsAreaMarginsForEngineeringresumes(), + title="Highlights Area Margins", + description="Highlights area margins.", + ) class EngineeringresumesThemeOptions(ThemeOptions): - """This class is the data model of the theme options for the engineeringresumes + """This class is the data model of the theme options for the `engineeringresumes` theme. """ @@ -28,8 +84,8 @@ class EngineeringresumesThemeOptions(ThemeOptions): " 25 pt." ), ) - margins: Margins = pydantic.Field( - default=Margins(), + margins: MarginsForEngineeringresumes = pydantic.Field( + default=MarginsForEngineeringresumes(), title="Margins", description="Page, section title, entry field, and highlights field margins.", )