classic: fix templating bugs

This commit is contained in:
Sina Atalay 2024-03-27 18:50:54 +01:00
parent bf9e0fd5a0
commit 0d9a6aa67d
4 changed files with 47 additions and 33 deletions

View File

@ -1,7 +1,7 @@
((* if section_title in design.show_timespan_in *)) ((* 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 *)) ((* else *))
((* set date_and_location_strings = [entry.location, entry.date_string] *)) ((* set date_and_location_strings = [entry.location, entry.date_string]|select("!=", "") *))
((* endif *)) ((* endif *))
((* if not is_first_entry *)) ((* if not is_first_entry *))
\vspace{<<design.margins.entry_area.vertical_between>>} \vspace{<<design.margins.entry_area.vertical_between>>}
@ -23,7 +23,9 @@
& &
\textbf{<<entry.institution>>}, <<entry.area>> \textbf{<<entry.institution>>}, <<entry.area>>
((* if entry.highlights != "" *))
\vspace{<<design.margins.highlights_area.top>>} \vspace{<<design.margins.highlights_area.top>>}
((* endif *))
((* for item in entry.highlights *)) ((* for item in entry.highlights *))
((* if loop.first *)) ((* if loop.first *))
@ -35,10 +37,5 @@
((* endif *)) ((* endif *))
((* endfor *)) ((* endfor *))
& &
((* for item in date_and_location_strings *)) <<date_and_location_strings|join("\n\n")>>
<<item>>
((* if not loop.last *))
((* endif *))
((* endfor *))
\end{tabularx} \end{tabularx}

View File

@ -1,11 +1,36 @@
((* if section_title in design.show_timespan_in *)) ((* 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 *)) ((* else *))
((* set date_and_location_strings = [entry.location, entry.date_string] *)) ((* set date_and_location_strings = [entry.location, entry.date_string]|select("!=", "") *))
((* endif *)) ((* endif *))
((* if not is_first_entry *)) ((* if not is_first_entry *))
\vspace{<<design.margins.entry_area.vertical_between>>} \vspace{<<design.margins.entry_area.vertical_between>>}
((* endif *)) ((* endif *))
((* if date_and_location_strings == ["", "", ""] or date_and_location_strings == ["", ""] *))
((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #))
((# width: \textwidth #))
((# preamble: first column #))
((# first column:: K{<<design.margins.entry_area.left_and_right>>}; variable width, justified column #))
\begin{tabularx}{
\textwidth-<<design.margins.entry_area.left_and_right|divide_length_by(0.5)>>-0.13cm
}{
K{<<design.margins.entry_area.left_and_right>>}
}
\textbf{<<entry.company>>}, <<entry.position>>
\vspace{<<design.margins.highlights_area.top>>}
((* for item in entry.highlights *))
((* if loop.first *))
\begin{highlights}
((* endif *))
\item <<item>>
((* if loop.last *))
\end{highlights}
((* endif *))
((* endfor *))
\end{tabularx}
((* else *))
((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #)) ((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #))
((# width: \textwidth #)) ((# width: \textwidth #))
((# preamble: first column, second column #)) ((# preamble: first column, second column #))
@ -17,7 +42,7 @@
K{<<design.margins.entry_area.left_and_right>>} K{<<design.margins.entry_area.left_and_right>>}
R{<<design.margins.entry_area.date_and_location_width>>} R{<<design.margins.entry_area.date_and_location_width>>}
} }
\textbf{<<entry.company>>}, <<entry.position>> \textbf{<<entry.name>>}
\vspace{<<design.margins.highlights_area.top>>} \vspace{<<design.margins.highlights_area.top>>}
@ -31,10 +56,6 @@
((* endif *)) ((* endif *))
((* endfor *)) ((* endfor *))
& &
((* for item in date_and_location_strings *)) <<date_and_location_strings|join("\n\n")>>
<<item>>
((* if not loop.last *))
((* endif *))
((* endfor *))
\end{tabularx} \end{tabularx}
((* endif *))

View File

@ -1,7 +1,7 @@
((* if section_title in design.show_timespan_in *)) ((* 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 *)) ((* else *))
((* set date_and_location_strings = [entry.location, entry.date_string] *)) ((* set date_and_location_strings = [entry.location, entry.date_string]|select("!=", "") *))
((* endif *)) ((* endif *))
((* if not is_first_entry *)) ((* if not is_first_entry *))
\vspace{<<design.margins.entry_area.vertical_between>>} \vspace{<<design.margins.entry_area.vertical_between>>}
@ -46,21 +46,16 @@
\vspace{<<design.margins.highlights_area.top>>} \vspace{<<design.margins.highlights_area.top>>}
((* for item in entry.highlights *)) ((* for item in entry.highlights *))
((* if loop.first *)) ((* if loop.first *))
\begin{highlights} \begin{highlights}
((* endif *)) ((* endif *))
\item <<item>> \item <<item>>
((* if loop.last *)) ((* if loop.last *))
\end{highlights} \end{highlights}
((* endif *)) ((* endif *))
((* endfor *)) ((* endfor *))
& &
((* for item in date_and_location_strings *)) <<date_and_location_strings|join("\n\n")>>
<<item>>
((* if not loop.last *))
((* endif *))
((* endfor *))
\end{tabularx} \end{tabularx}
((* endif *)) ((* endif *))

View File

@ -12,10 +12,11 @@
\vspace{<<design.margins.highlights_area.vertical_between_bullet_points>>} \vspace{<<design.margins.highlights_area.vertical_between_bullet_points>>}
<<entry.authors|map("make_it_nolinebreak")|join(", ")>> <<entry.authors|map("make_it_nolinebreak")|join(", ")>>
((* if entry.doi != "" or entry.journal != "" *))
\vspace{<<design.margins.highlights_area.vertical_between_bullet_points>>} \vspace{<<design.margins.highlights_area.vertical_between_bullet_points>>}
((*- if entry.doi != "" -*)) ((* endif *))
((* if entry.doi != "" -*))
\href{<<entry.doi_url>>}{<<entry.doi>>} \href{<<entry.doi_url>>}{<<entry.doi>>}
((*- endif -*)) ((*- endif -*))
((*- if entry.doi != "" and entry.journal != "" *)) (((* endif -*)) ((*- if entry.doi != "" and entry.journal != "" *)) (((* endif -*))