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,21 +1,20 @@
((* 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⟩} #)) ((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #))
((# width: \textwidth #)) ((# width: \textwidth #))
((# preamble: first column, second column #)) ((# preamble: first column #))
((# first column:: K{<<design.margins.entry_area.left_and_right>>}; variable width, justified column #)) ((# first column:: K{<<design.margins.entry_area.left_and_right>>}; variable width, justified column #))
((# second column: R{<<design.margins.entry_area.date_and_location_width>>}; constant width ragged right column #))
\begin{tabularx}{ \begin{tabularx}{
\textwidth-<<design.margins.entry_area.left_and_right|divide_length_by(0.5)>>-0.13cm \textwidth-<<design.margins.entry_area.left_and_right|divide_length_by(0.5)>>-0.13cm
}{ }{
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>>}
} }
\textbf{<<entry.company>>}, <<entry.position>> \textbf{<<entry.company>>}, <<entry.position>>
@ -30,11 +29,33 @@
\end{highlights} \end{highlights}
((* endif *)) ((* endif *))
((* endfor *)) ((* endfor *))
& \end{tabularx}
((* for item in date_and_location_strings *)) ((* else *))
<<item>> ((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #))
((* if not loop.last *)) ((# width: \textwidth #))
((# preamble: first column, second column #))
((# first column:: K{<<design.margins.entry_area.left_and_right>>}; variable width, justified column #))
((# second column: R{<<design.margins.entry_area.date_and_location_width>>}; constant width ragged right 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>>}
R{<<design.margins.entry_area.date_and_location_width>>}
}
\textbf{<<entry.name>>}
\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 *)) ((* endif *))
((* endfor *)) ((* endfor *))
&
<<date_and_location_strings|join("\n\n")>>
\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>>}
@ -56,11 +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 *)) ((* 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 -*))