From 0d9a6aa67da4d9c452ed37a963365f4698db6f6d Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Wed, 27 Mar 2024 18:50:54 +0100 Subject: [PATCH] classic: fix templating bugs --- rendercv/themes/classic/EducationEntry.j2.tex | 13 +++---- .../themes/classic/ExperienceEntry.j2.tex | 39 ++++++++++++++----- rendercv/themes/classic/NormalEntry.j2.tex | 23 +++++------ .../themes/classic/PublicationEntry.j2.tex | 5 ++- 4 files changed, 47 insertions(+), 33 deletions(-) diff --git a/rendercv/themes/classic/EducationEntry.j2.tex b/rendercv/themes/classic/EducationEntry.j2.tex index ec3776d..15e42cc 100644 --- a/rendercv/themes/classic/EducationEntry.j2.tex +++ b/rendercv/themes/classic/EducationEntry.j2.tex @@ -1,7 +1,7 @@ ((* if section_title in design.show_timespan_in *)) - ((* set date_and_location_strings = [entry.location, entry.date_string, entry.time_span_string] *)) + ((* set date_and_location_strings = [entry.location, entry.date_string, entry.time_span_string]|select("!=", "") *)) ((* else *)) - ((* set date_and_location_strings = [entry.location, entry.date_string] *)) + ((* set date_and_location_strings = [entry.location, entry.date_string]|select("!=", "") *)) ((* endif *)) ((* if not is_first_entry *)) \vspace{<>} @@ -23,7 +23,9 @@ & \textbf{<>}, <> +((* if entry.highlights != "" *)) \vspace{<>} +((* endif *)) ((* for item in entry.highlights *)) ((* if loop.first *)) @@ -35,10 +37,5 @@ ((* endif *)) ((* endfor *)) & -((* for item in date_and_location_strings *)) - <> - ((* if not loop.last *)) - - ((* endif *)) -((* endfor *)) + <> \end{tabularx} diff --git a/rendercv/themes/classic/ExperienceEntry.j2.tex b/rendercv/themes/classic/ExperienceEntry.j2.tex index 3cd5043..b55d594 100644 --- a/rendercv/themes/classic/ExperienceEntry.j2.tex +++ b/rendercv/themes/classic/ExperienceEntry.j2.tex @@ -1,11 +1,36 @@ ((* if section_title in design.show_timespan_in *)) - ((* set date_and_location_strings = [entry.location, entry.date_string, entry.time_span_string] *)) + ((* set date_and_location_strings = [entry.location, entry.date_string, entry.time_span_string]|select("!=", "") *)) ((* else *)) - ((* set date_and_location_strings = [entry.location, entry.date_string] *)) + ((* set date_and_location_strings = [entry.location, entry.date_string]|select("!=", "") *)) ((* endif *)) ((* 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{<>} +} + \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 #)) @@ -17,7 +42,7 @@ K{<>} R{<>} } - \textbf{<>}, <> + \textbf{<>} \vspace{<>} @@ -31,10 +56,6 @@ ((* endif *)) ((* endfor *)) & -((* for item in date_and_location_strings *)) - <> - ((* if not loop.last *)) - - ((* endif *)) -((* endfor *)) + <> \end{tabularx} +((* endif *)) diff --git a/rendercv/themes/classic/NormalEntry.j2.tex b/rendercv/themes/classic/NormalEntry.j2.tex index 03eb128..37ab54c 100644 --- a/rendercv/themes/classic/NormalEntry.j2.tex +++ b/rendercv/themes/classic/NormalEntry.j2.tex @@ -1,7 +1,7 @@ ((* if section_title in design.show_timespan_in *)) - ((* set date_and_location_strings = [entry.location, entry.date_string, entry.time_span_string] *)) + ((* set date_and_location_strings = [entry.location, entry.date_string, entry.time_span_string]|select("!=", "") *)) ((* else *)) - ((* set date_and_location_strings = [entry.location, entry.date_string] *)) + ((* set date_and_location_strings = [entry.location, entry.date_string]|select("!=", "") *)) ((* endif *)) ((* if not is_first_entry *)) \vspace{<>} @@ -46,21 +46,16 @@ \vspace{<>} - ((* for item in entry.highlights *)) - ((* if loop.first *)) +((* for item in entry.highlights *)) + ((* if loop.first *)) \begin{highlights} - ((* endif *)) + ((* endif *)) \item <> - ((* if loop.last *)) + ((* if loop.last *)) \end{highlights} - ((* endif *)) - ((* endfor *)) + ((* endif *)) +((* endfor *)) & - ((* for item in date_and_location_strings *)) - <> - ((* if not loop.last *)) - - ((* endif *)) - ((* endfor *)) + <> \end{tabularx} ((* endif *)) diff --git a/rendercv/themes/classic/PublicationEntry.j2.tex b/rendercv/themes/classic/PublicationEntry.j2.tex index 09d4486..4862e85 100644 --- a/rendercv/themes/classic/PublicationEntry.j2.tex +++ b/rendercv/themes/classic/PublicationEntry.j2.tex @@ -12,10 +12,11 @@ \vspace{<>} <> - + ((* if entry.doi != "" or entry.journal != "" *)) \vspace{<>} - ((*- if entry.doi != "" -*)) + ((* endif *)) + ((* if entry.doi != "" -*)) \href{<>}{<>} ((*- endif -*)) ((*- if entry.doi != "" and entry.journal != "" *)) (((* endif -*))