\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[margin=0.4in, landscape]{geometry}
\usepackage{ebgaramond}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{array}
\usepackage{colortbl}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{fancyhdr}
\usepackage{amsmath}

% Colors
\definecolor{headerblue}{HTML}{1E3A5F}
\definecolor{rowgray}{HTML}{F8F9FA}
\definecolor{textgray}{HTML}{374151}
\definecolor{categoryblue}{HTML}{E8F4FD}

\hypersetup{colorlinks=true, linkcolor=headerblue, urlcolor=headerblue}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\small\textcolor{textgray}{Literature Summary}}
\fancyhead[R]{\small\textcolor{textgray}{\today}}
\fancyfoot[C]{\small\thepage}
\renewcommand{\headrulewidth}{0.4pt}

\title{\textbf{\color{headerblue}Literature Summary}}
\author{}
\date{<< paper_count >> papers $\cdot$ \today}

\begin{document}

\maketitle
\thispagestyle{empty}

\vspace{-0.5em}

\renewcommand{\arraystretch}{1.4}
\begin{longtable}{|p{5.5cm}|p{5cm}|p{5cm}|p{4.5cm}|}

\hline
\rowcolor{headerblue}
\textcolor{white}{\textbf{Paper}} &
\textcolor{white}{\textbf{Theory \& Data}} &
\textcolor{white}{\textbf{Estimation}} &
\textcolor{white}{\textbf{Results}} \\
\hline
\endfirsthead

\hline
\rowcolor{headerblue}
\textcolor{white}{\textbf{Paper}} &
\textcolor{white}{\textbf{Theory \& Data}} &
\textcolor{white}{\textbf{Estimation}} &
\textcolor{white}{\textbf{Results}} \\
\hline
\endhead

\hline
\endfoot

<% set current_category = namespace(value="") %>
<% for paper in papers %>
<% if paper.category is defined and paper.category != current_category.value %>
<% set current_category.value = paper.category %>
\rowcolor{categoryblue}
\multicolumn{4}{|l|}{\textbf{\textcolor{headerblue}{<< paper.category | latex_escape >>}}} \\
\hline
<% endif %>
<% if loop.index is odd %>
\rowcolor{rowgray}
<% endif %>
\textbf{<< paper.authors | latex_escape >>} (<< paper.year | latex_escape >>) says << paper.condensed_says | latex_escape >> &
<< paper.condensed_theory_data | latex_escape >> &
<< paper.condensed_estimation | preserve_latex_math >> &
<< paper.condensed_result | preserve_latex_math >> \\
\hline
<% endfor %>

\end{longtable}

\end{document}
