{# =============================================================================
   FIGURE TEMPLATE - Figures with captions
   ZERO HARDCODED STRINGS - All content from SPARQL variables
   Uses sparql_results array with ?-prefixed keys
   ============================================================================= #}
{% for row in sparql_results %}
{%- set position = row["?position"] | default(value="htbp") -%}
{%- set width = row["?width"] | default(value="0.8\\textwidth") -%}
{%- set imagePath = row["?imagePath"] | default(value="") -%}
{%- set caption = row["?caption"] | default(value="") -%}
{%- set labelId = row["?labelId"] | default(value="") -%}
\begin{figure}[{{ position }}]
\centering
\includegraphics[width={{ width }}]{ {{- imagePath -}} }
\caption{ {{- caption -}} }
\label{ {{- labelId -}} }
\end{figure}

{% endfor %}
