---
marp: true
theme: acarp
style: |
:root {
--logo-image: url('acarp.png');
--logo-width: 120px;
--logo-height: 120px;
--logo-opacity: 0.8;
}
---
# Academic Marp Theme
Modern presentations with CSS Grid
## Grid-based layouts for academic content

---
### Overview
A minimal, grid-based setup for Marp presentations:
- **Grid-only layouts** - No flexbox, no utility classes
- **Explicit contracts** - Clear layout structure in CSS
- **Two aspect ratios** - 16:9 (standard) and 4:3 (beamer)
- **Academic focus** - Optimized for technical content

---
### Key Features
**Grid-based Design**
- CSS Grid for all layouts
- No hidden behaviors
- Maintainable structure
**Academic Ready**
- Math support: $\Delta x$
- Code highlighting
- Clean typography
**Simple Usage**
- Markdown-only workflow
- No complex classes
- Focus on content

---
## Mathematical Content
The TF-IDF model for term weighting:
$\quad \text{tf-idf}(t, d, D) = \text{tf}(t, d) \times \text{idf}(t, D)$
Where term frequency is:
$\quad \text{tf}(t, d) = \frac{f_{t,d}}{\sum_{t'\in d} f_{t',d}}$
And inverse document frequency:
$\quad \text{idf}(t, D) = \log \frac{|D|}{|\{d \in D : t \in d\}|}$
[Sparck Jones, 1972]
---
### Code Examples
```python
def tfidf(term, doc, corpus):
tf = term_frequency(term, doc)
idf = inverse_df(term, corpus)
return tf * idf
# Example usage
score = tfidf("grid", doc1, docs)
print(f"TF-IDF: {score:.3f}")
```
```bash
# Build presentation
marp --theme acarp demo.md
# Watch for changes
marp --theme acarp --watch demo.md
# Export to PDF
marp --theme acarp --pdf demo.md
```
---
## Layout Patterns
**Default Layout** - Single column, clean presentation
**Two-Column Layout** - Perfect for code + output or text + image
**Title Layout** - Impactful opening slides
All layouts use CSS Grid with explicit contracts - no positioning hacks needed.
---
### Performance Comparison
**Traditional Approach**
- Complex positioning
- Flexbox overrides
- Utility classes
- Hidden behaviors
**Grid-Only Approach**
- Explicit layouts
- Clear structure
- Predictable behavior
- Easy maintenance

---
## Getting Started
1. Install dependencies: `npm install`
2. Create your markdown file
3. Add `theme: acarp` in frontmatter
4. Use layout classes as needed
5. Build with: `marp --theme acarp file.md`
---
## Vertical Spacing
Use spacing utilities for better content flow:
Small vertical space (1em)
Medium vertical space (2em) - good for section breaks
Large vertical space (3em) - for major separations
---
## Spacing Examples
```python
def calculate():
result = 42
return result
```
The function returns a simple value.

Images can have custom spacing too.
---
### Full Slide Example
**Key Concepts:**
- Grid-based layout
- Explicit CSS contracts
- No hidden behaviors
**Latex math:**
$\quad \text{score} = \text{tf} \times \log\frac{|D|}{|d_t|}$
**And code blocks:**
```python
def score(term, doc):
tf = freq(term, doc)
idf = log(N / df)
return tf * idf
```


featuring two column mode for e.g. figs + txt
[Also with citation helper class!]
---
## Thank You
This theme provides a clean, academic-focused foundation for your presentations.
Visit the repository for more examples and documentation.