((* from "components/highlights.tex.j2" import highlights as print_higlights with context *))
((* from "components/date_and_location_strings.tex.j2" import date_and_location_strings as print_date_and_locations with context *))

((* macro education(study_type, institution, area, highlights, date_and_location_strings)*))
((# \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{<<theme_options.margins.entry_area.left>>}; variable width, ragged left column #))
        ((# third column: R{<<theme_options.date_and_location_width>>}; constant widthm ragged right column #))
\begin{tabularx}{\textwidth}{p{0.55cm} K{<<theme_options.margins.entry_area.left>>} R{<<theme_options.date_and_location_width>>}}
    \textbf{<<study_type if study_type is not none>>}
    & 
    \textbf{<<institution>>}, <<area>>
    <<print_higlights(highlights)|indent(4)->>
    &
    <<print_date_and_locations(date_and_location_strings)|indent(4)->>
\end{tabularx}
((* endmacro *))

((* macro experience(company, position, highlights, date_and_location_strings)*))
((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #))
    ((# width: \textwidth #))
    ((# preamble: first column, second column #))
        ((# first column:: K{<<theme_options.margins.entry_area.left>>}; variable width, ragged left column #))
        ((# second column: R{<<theme_options.date_and_location_width>>}; constant width ragged right column #))
\begin{tabularx}{\textwidth}{K{<<theme_options.margins.entry_area.left>>} R{<<theme_options.date_and_location_width>>}}
    \textbf{<<company>>}, <<position>>
    <<print_higlights(highlights)|indent(4)->>
    &
    <<print_date_and_locations(date_and_location_strings)|indent(4)->>
\end{tabularx}
((* endmacro *))

((* macro normal(name, highlights, date_and_location_strings, markdown_url=none, link_text=none)*))
((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #))
    ((# width: \textwidth #))
    ((# preamble: first column, second column #))
        ((# first column:: K{<<theme_options.margins.entry_area.left>>}; variable width, ragged left column #))
        ((# second column: R{<<theme_options.date_and_location_width>>}; constant width ragged right column #))
\begin{tabularx}{\textwidth}{K{<<theme_options.margins.entry_area.left>>} R{<<theme_options.date_and_location_width>>}}
    ((* if markdown_url is not none *))
        ((* if link_text is not none *))
        ((* set markdown_url = "["+link_text+"]("+ markdown_url|markdown_link_to_url +")" *))
    \textbf{<<name>>}, <<markdown_url|markdown_to_latex>>
        ((* else *))
    \textbf{<<name>>}, <<markdown_url|markdown_to_latex>>
        ((* endif *))
    ((* else *))
    \textbf{<<name>>}
    ((* endif *))
    <<print_higlights(highlights)|indent(4)->>
    &
    <<print_date_and_locations(date_and_location_strings)|indent(4)->>
\end{tabularx}
((* endmacro *))

((* macro publication(title, authors, journal, date, doi, doi_url)*))
((# \begin{tabularx}{⟨width⟩}[⟨pos⟩]{⟨preamble⟩} #))
    ((# width: \textwidth #))
    ((# preamble: first column, second column #))
        ((# first column:: K{<<theme_options.margins.entry_area.left>>}; variable width, ragged left column #))
        ((# second column: R{<<theme_options.date_and_location_width>>}; constant width ragged right column #))
\begin{tabularx}{\textwidth}{K{<<theme_options.margins.entry_area.left>>} R{<<theme_options.date_and_location_width>>}}
    \textbf{<<title>>}
    
    <<authors|join(", ")|make_it_italic(cv.name)>>

    DOI: \hrefExternal{<<doi_url>>}{<<doi>>}
    &
    <<date>>
\end{tabularx}
((* endmacro *))

((* macro one_line(name, details, markdown_url=none, link_text=none)*))
    \setlength{\leftskip}{<<theme_options.margins.entry_area.left>>}
    \setlength{\rightskip}{<<theme_options.margins.entry_area.right>>}

    ((* if markdown_url is not none *))
        ((* if link_text is not none *))
            ((* set markdown_url = "["+link_text+"]("+ markdown_url|markdown_link_to_url +")" *))
    \textbf{<<name>>:} <<details>> (<<markdown_url|markdown_to_latex>>)
        ((* else *))
    \textbf{<<name>>:} <<details>> (<<markdown_url|markdown_to_latex>>)
        ((* endif *))
    ((* else *))
    \textbf{<<name>>:} <<details>>
    ((* endif *))

    \setlength{\leftskip}{0cm}
    \setlength{\rightskip}{0cm}
((* endmacro *))