%% Appendix Template
%% Auto-generated by ggen from RDF ontology

\chapter{% raw %}{{{ appendix_title }}}{% endraw %}
\label{% raw %}{app:{{ appendix_id }}}{% endraw %}

{% raw %}{% if appendix_intro %}
{{ appendix_intro }}
{% endif %}{% endraw %}

{% raw %}{% for section in sections %}
\section{{{ section.title }}}
\label{sec:{{ section.id }}}

{{ section.content }}

{% if section.type == "code" %}
\input{code-listing-{{ section.id }}}
{% elif section.type == "proof" %}
\begin{proof}[Extended Proof]
{{ section.proof_content }}
\end{proof}
{% elif section.type == "data" %}
\input{table-{{ section.table_id }}}
{% elif section.type == "derivation" %}
{{ section.derivation_content }}
{% elif section.type == "calculation" %}
\begin{align*}
{% for step in section.calculation_steps %}
{{ step.latex }} && \text{{{ step.explanation }}} {% if not loop.last %}\\{% endif %}
{% endfor %}
\end{align*}
{% endif %}

{% if section.subsections %}
{% for subsection in section.subsections %}
\subsection{{{ subsection.title }}}
\label{subsec:{{ subsection.id }}}

{{ subsection.content }}
{% endfor %}
{% endif %}

{% endfor %}{% endraw %}

{% raw %}{% if supplementary_materials %}
\section{Supplementary Materials}

{% for material in supplementary_materials %}
\subsection{{{ material.title }}}

{% if material.type == "code_repository" %}
Code available at: \url{{{ material.url }}}
{% elif material.type == "dataset" %}
Dataset available at: \url{{{ material.url }}}
{% if material.doi %}
DOI: \texttt{{{ material.doi }}}
{% endif %}
{% elif material.type == "video" %}
Video demonstration: \url{{{ material.url }}}
{% elif material.type == "interactive" %}
Interactive version: \url{{{ material.url }}}
{% endif %}

{% if material.description %}
{{ material.description }}
{% endif %}

{% endfor %}
{% endif %}{% endraw %}
