diff --git a/rendercv/themes/classic/BulletEntry.j2.tex b/rendercv/themes/classic/BulletEntry.j2.tex index a142e02..981d14c 100644 --- a/rendercv/themes/classic/BulletEntry.j2.tex +++ b/rendercv/themes/classic/BulletEntry.j2.tex @@ -1,11 +1,7 @@ ((* if not is_first_entry *)) \vspace{<>} ((* endif *)) -\begingroup((* if design.text_alignment == "left-aligned" *))\raggedright((* endif *)) -\leftskip=<> -\advance\csname @rightskip\endcsname <> -\advance\rightskip <> - -\textbullet \hspace{3pt} <> -\par\endgroup +\begin{onecolentry} + \textbullet \hspace{3pt} <> +\end{onecolentry} diff --git a/rendercv/themes/classic/EducationEntry.j2.tex b/rendercv/themes/classic/EducationEntry.j2.tex index 25d0d78..eeab11f 100644 --- a/rendercv/themes/classic/EducationEntry.j2.tex +++ b/rendercv/themes/classic/EducationEntry.j2.tex @@ -6,27 +6,11 @@ ((* if not is_first_entry *)) \vspace{<>} ((* endif *)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column, second column, third column #)) - ((# first column: p{0.55cm}; constant width, ragged left column #)) - ((# second column: K{<>}; variable width, justified column #)) - ((# third column: R{<>}; constant widthm ragged right column #)) -\begin{tabularx}{ - \textwidth-<>-0.13cm -}{ - L{0.85cm} - K{<>} - R{<>} + +\begin{threecolentry}{\textbf{<>}}{ + <> } - \textbf{<>} - & \textbf{<>}, <> - -((* if entry.highlights *)) - \vspace{<>} -((* endif *)) - ((* for item in entry.highlights *)) ((* if loop.first *)) \begin{highlights} @@ -36,6 +20,4 @@ \end{highlights} ((* endif *)) ((* endfor *)) - & - <> -\end{tabularx} +\end{threecolentry} \ No newline at end of file diff --git a/rendercv/themes/classic/ExperienceEntry.j2.tex b/rendercv/themes/classic/ExperienceEntry.j2.tex index 70c94e4..77df931 100644 --- a/rendercv/themes/classic/ExperienceEntry.j2.tex +++ b/rendercv/themes/classic/ExperienceEntry.j2.tex @@ -6,46 +6,10 @@ ((* if not is_first_entry *)) \vspace{<>} ((* endif *)) + ((* if date_and_location_strings == ["", "", ""] or date_and_location_strings == ["", ""] *)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column #)) - ((# first column:: K{<>}; variable width, justified column #)) -\begin{tabularx}{ - \textwidth-<>-0.13cm -}{ - K{<>} -} +\begin{onecolentry} \textbf{<>}, <> - - \vspace{<>} - - ((* for item in entry.highlights *)) - ((* if loop.first *)) - \begin{highlights} - ((* endif *)) - \item <> - ((* if loop.last *)) - \end{highlights} - ((* endif *)) - ((* endfor *)) -\end{tabularx} -((* else *)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column, second column #)) - ((# first column:: K{<>}; variable width, justified column #)) - ((# second column: R{<>}; constant width ragged right column #)) -\begin{tabularx}{ - \textwidth-<>-0.13cm -}{ - K{<>} - R{<>} -} - \textbf{<>}, <> - - \vspace{<>} - ((* for item in entry.highlights *)) ((* if loop.first *)) \begin{highlights} @@ -55,7 +19,20 @@ \end{highlights} ((* endif *)) ((* endfor *)) - & +\end{onecolentry} +((* else *)) +\begin{twocolentry}{ <> -\end{tabularx} -((* endif *)) +} + \textbf{<>}, <> +((* for item in entry.highlights *)) + ((* if loop.first *)) + \begin{highlights} + ((* endif *)) + \item <> + ((* if loop.last *)) + \end{highlights} + ((* endif *)) +((* endfor *)) +\end{twocolentry} +((* endif *)) \ No newline at end of file diff --git a/rendercv/themes/classic/NormalEntry.j2.tex b/rendercv/themes/classic/NormalEntry.j2.tex index 37ab54c..1116a79 100644 --- a/rendercv/themes/classic/NormalEntry.j2.tex +++ b/rendercv/themes/classic/NormalEntry.j2.tex @@ -6,46 +6,10 @@ ((* if not is_first_entry *)) \vspace{<>} ((* endif *)) + ((* if date_and_location_strings == ["", "", ""] or date_and_location_strings == ["", ""] *)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column #)) - ((# first column:: K{<>}; variable width, justified column #)) -\begin{tabularx}{ - \textwidth-<>-0.13cm -}{ - K{<>} -} +\begin{onecolentry} \textbf{<>} - - \vspace{<>} - - ((* for item in entry.highlights *)) - ((* if loop.first *)) - \begin{highlights} - ((* endif *)) - \item <> - ((* if loop.last *)) - \end{highlights} - ((* endif *)) - ((* endfor *)) -\end{tabularx} -((* else *)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column, second column #)) - ((# first column:: K{<>}; variable width, justified column #)) - ((# second column: R{<>}; constant width ragged right column #)) -\begin{tabularx}{ - \textwidth-<>-0.13cm -}{ - K{<>} - R{<>} -} - \textbf{<>} - - \vspace{<>} - ((* for item in entry.highlights *)) ((* if loop.first *)) \begin{highlights} @@ -55,7 +19,20 @@ \end{highlights} ((* endif *)) ((* endfor *)) - & +\end{onecolentry} +((* else *)) +\begin{twocolentry}{ <> -\end{tabularx} -((* endif *)) +} + \textbf{<>} +((* for item in entry.highlights *)) + ((* if loop.first *)) + \begin{highlights} + ((* endif *)) + \item <> + ((* if loop.last *)) + \end{highlights} + ((* endif *)) +((* endfor *)) +\end{twocolentry} +((* endif *)) \ No newline at end of file diff --git a/rendercv/themes/classic/OneLineEntry.j2.tex b/rendercv/themes/classic/OneLineEntry.j2.tex index e72f1f9..e7b963f 100644 --- a/rendercv/themes/classic/OneLineEntry.j2.tex +++ b/rendercv/themes/classic/OneLineEntry.j2.tex @@ -1,10 +1,7 @@ ((* if not is_first_entry *)) \vspace{<>} ((* endif *)) -\begingroup((* if design.text_alignment == "left-aligned" *))\raggedright((* endif *)) -\leftskip=<> -\advance\csname @rightskip\endcsname <> -\advance\rightskip <> -\textbf{<>:} <> -\par\endgroup \ No newline at end of file +\begin{onecolentry} + \textbf{<>:} <> +\end{onecolentry} diff --git a/rendercv/themes/classic/Preamble.j2.tex b/rendercv/themes/classic/Preamble.j2.tex index 60b91e4..6c28f49 100644 --- a/rendercv/themes/classic/Preamble.j2.tex +++ b/rendercv/themes/classic/Preamble.j2.tex @@ -2,14 +2,14 @@ % 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[explicit]{titlesec} % for customizing section titles \usepackage{tabularx} % for making tables with fixed width columns \usepackage{array} % tabularx requires this @@ -29,7 +29,16 @@ \usepackage{bookmark} % for bookmarks \usepackage{lastpage} % for getting the total number of pages \usepackage[default, type1]{sourcesanspro} % for using source sans 3 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 + +% Ensure that generate pdf is machine readable/ATS parsable: +\ifpdf + \input{glyphtounicode} + \pdfgentounicode=1 +\fi % Some settings: \pagestyle{empty} % no header or footer @@ -44,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}{ @@ -54,66 +65,80 @@ ((* endif *)) \titleformat{\section}{ - % make the font size of the section title large and color it with the primary color - \Large\color{primaryColor} - }{ - }{ - }{ - % print bold title, give 0.15 cm space and draw a line of 0.8 pt thickness - % from the end of the title to the end of the body - \textbf{#1}\hspace{0.15cm}\titlerule[0.8pt]\hspace{-0.1cm} - }[] % section title formatting + % avoid page braking right after the section title + \needspace{4\baselineskip} + % make the font size of the section title large and color it with the primary color + \Large\color{primaryColor} +}{ +}{ +}{ + % print bold title, give 0.15 cm space and draw a line of 0.8 pt thickness + % from the end of the title to the end of the body + \textbf{#1}\hspace{0.15cm}\titlerule[0.8pt]\hspace{-0.1cm} +}[] % section title formatting \titlespacing{\section}{ - % left space: - 0pt - }{ - % top space: - <> - }{ - % bottom space: - <> - } % section title spacing + % left space: + 0pt +}{ + % top space: + <> +}{ + % bottom space: + <> +} % section title spacing -\newcolumntype{L}[1]{ - >{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p{#1} -} % left-aligned fixed width column type -\newcolumntype{R}[1]{ - >{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}p{#1} -} % right-aligned fixed width column type -((* if design.text_alignment == "justified" *)) -\newcolumntype{K}[1]{ - >{\let\newline\\\arraybackslash\hspace{0pt}}X -} % justified flexible width column type -((* elif design.text_alignment == "justified-with-no-hyphenation" *)) -\newcolumntype{K}[1]{ - >{\let\newline\\\arraybackslash\hspace{0pt}}X -} % justified flexible width column type -\usepackage[none]{hyphenat} % for disabling hyphenation -((* elif design.text_alignment == "left-aligned" *)) -\newcolumntype{K}[1]{ - >{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}X -} % left-aligned flexible width column type -((* endif *)) -\setlength\tabcolsep{-1.5pt} % no space between columns \newenvironment{highlights}{ - \begin{itemize}[ - topsep=0pt, - parsep=<>, - partopsep=0pt, - itemsep=0pt, - after=\vspace{-1\baselineskip}, - leftmargin=<> + 3pt - ] + \begin{itemize}[ + topsep=<>, + parsep=<>, + partopsep=0pt, + itemsep=0pt, + leftmargin=<> + 3pt + ] +}{ + \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\color{primaryColor}\linespread{1.5} - }{ - \par\kern\topsep - } % new environment for the header + \setlength{\topsep}{0pt}\par\kern\topsep\centering\color{primaryColor}\linespread{1.5} +}{ + \par\kern\topsep +} % new environment for the header \newcommand{\placelastupdatedtext}{% \placetextbox{}{}{} \AddToShipoutPictureFG*{% Add to current page foreground @@ -129,17 +154,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*}}}} - -\let\originalTabularx\tabularx -\let\originalEndTabularx\endtabularx - -\renewenvironment{tabularx}{\bgroup\centering\originalTabularx}{\originalEndTabularx\par\egroup} - -% For TextEntrys (see https://tex.stackexchange.com/a/600/287984): -\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1\topsep=0pt\itemsep=0pt\parsep=0pt\parskip=0pt\labelwidth=0pt\itemindent=0pt\labelsep=0pt}\item[]} -\let\endchangemargin=\endlist - -% 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/classic/PublicationEntry.j2.tex b/rendercv/themes/classic/PublicationEntry.j2.tex index f2204d6..8f0c0d8 100644 --- a/rendercv/themes/classic/PublicationEntry.j2.tex +++ b/rendercv/themes/classic/PublicationEntry.j2.tex @@ -1,12 +1,10 @@ ((* if not is_first_entry *)) \vspace{<>} ((* endif *)) -((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) - ((# width: \textwidth #)) - ((# preamble: first column, second column #)) - ((# first column:: K{<>}; variable width, justified column #)) - ((# second column: R{<>}; constant width ragged right column #)) -\begin{tabularx}{\textwidth-<>-0.13cm}{K{<>} R{<>}} + +\begin{twocolentry}{ + <> +} \textbf{<>} \vspace{<>} @@ -24,6 +22,5 @@ <> ((*- endif -*)) ((*- if entry.doi and entry.journal *)))((* endif -*)) - & - <> -\end{tabularx} + +\end{twocolentry} diff --git a/rendercv/themes/classic/TextEntry.j2.tex b/rendercv/themes/classic/TextEntry.j2.tex index 21e8f79..bc9df0e 100644 --- a/rendercv/themes/classic/TextEntry.j2.tex +++ b/rendercv/themes/classic/TextEntry.j2.tex @@ -1,10 +1,7 @@ ((* if not is_first_entry *)) \vspace{<>} ((* endif *)) -\begingroup((* if design.text_alignment == "left-aligned" *))\raggedright((* endif *)) -\leftskip=<> -\advance\csname @rightskip\endcsname <> -\advance\rightskip <> -<> -\par\endgroup +\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/classic/__init__.py b/rendercv/themes/classic/__init__.py index 77fa100..adefd2e 100644 --- a/rendercv/themes/classic/__init__.py +++ b/rendercv/themes/classic/__init__.py @@ -6,7 +6,7 @@ from .. import ThemeOptions class ClassicThemeOptions(ThemeOptions): - """This class is the data model of the theme options for the classic theme.""" + """This class is the data model of the theme options for the `classic` theme.""" theme: Literal["classic"] show_timespan_in: list[str] = pydantic.Field(