# {{ title }}

{% if author %}**Author:** {{ author }}{% endif %}
{% if date %}**Date:** {{ date }}{% endif %}

---

{% if abstract %}
## Abstract

{{ abstract }}

---
{% endif %}

## Introduction

This systematic review synthesizes evidence from **{{ paper_count }} papers**.

{% if fields %}
### Extracted Data Points

The following information was extracted from each paper:

{% for field in fields %}
- **{{ field.key }}**: {{ field.description }}{% if field.type != 'text' %} *({{ field.type }})*{% endif %}
{% endfor %}
{% endif %}

---

{% if include_matrix and matrix %}
## Evidence Matrix

| {% for cell in matrix[0] %}{{ cell }} | {% endfor %}
| {% for _ in matrix[0] %}--- | {% endfor %}
{% for row in matrix[1:] %}| {% for cell in row %}{{ cell | truncate_chars(40) }} | {% endfor %}
{% endfor %}

---
{% endif %}

{% if include_summaries %}
## Paper Summaries

{% for paper in papers %}
### {{ loop.index }}. {{ paper.title }}

{% if paper.bibtex_key %}*Citation key: {{ paper.bibtex_key }}*{% endif %}

{% if paper.one_pager %}
{{ paper.one_pager }}
{% else %}
*Summary not available.*
{% endif %}

{% if paper.extractions %}
#### Key Data Points

{% for key, data in paper.extractions.items() %}
- **{{ key }}**: {{ data.value if data.value else 'N/A' }}{% if data.quote %}
  > "{{ data.quote | truncate_chars(150) }}"{% if data.page %} (p. {{ data.page }}){% endif %}{% endif %}
{% endfor %}
{% endif %}

---

{% endfor %}
{% endif %}

{% if include_appendix %}
## Appendix: Paper Contributions

Brief contribution statements for each paper:

{% for paper in papers %}
{{ loop.index }}. **{{ paper.title | truncate_chars(50) }}**: {% if paper.appendix_row %}{{ paper.appendix_row }}{% else %}*Contribution statement not available.*{% endif %}

{% endfor %}

---
{% endif %}

## References

{% if bibliography %}
{% for bib in bibliography %}
- {{ bib.authors | join(', ') if bib.authors else 'Unknown' }} ({{ bib.year if bib.year else 'n.d.' }}). *{{ bib.title if bib.title else 'Untitled' }}*. {% if bib.journal %}{{ bib.journal }}.{% endif %} {% if bib.doi %}DOI: {{ bib.doi }}{% endif %}
{% endfor %}
{% else %}
*Bibliography not available.*
{% endif %}

---

*Generated by Papercutter Factory*
