aboutsummaryrefslogtreecommitdiff
path: root/demo-standard.md
blob: 72f7d9bd7bf147d21ddd8fb3d0f63941c84c1c21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
---
marp: true
theme: acarp
style: |
  :root {
    --logo-image: url('acarp.png');
    --logo-width: 120px;
    --logo-height: 120px;
    --logo-opacity: 0.8;
  }
---

<!-- _class: title -->
# Academic Marp Theme

Modern presentations with CSS Grid

## Grid-based layouts for academic content

<div class="vspace-large"></div>

![width:120px](acarp.png)

---

<!-- paginate: true -->

### 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

![width:400px](figs/example.png)

---

<!-- _class: layout-2col -->
### Key Features

<div class="left-column">

**Grid-based Design**
- CSS Grid for all layouts
- No hidden behaviors
- Maintainable structure

**Academic Ready**
- Math support: $\Delta x$ 
- Code highlighting
- Clean typography

</div>

<div class="right-column">

**Simple Usage**
- Markdown-only workflow
- No complex classes
- Focus on content

![width:350px](figs/example.png)

</div>

---

## 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\}|}$

<div class="cite">[Sparck Jones, 1972]</div>

---

<!-- _class: layout-2col -->
### Code Examples

<div class="left-column">

<div class="vspace-medium"></div>

```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}")
```

</div>

<div class="right-column">

<div class="vspace-medium"></div>

```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
```

</div>

---

## 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.

---

<!-- _class: layout-2col -->
### Performance Comparison

<div class="left-column">

**Traditional Approach**
- Complex positioning
- Flexbox overrides
- Utility classes
- Hidden behaviors

**Grid-Only Approach**
- Explicit layouts
- Clear structure
- Predictable behavior
- Easy maintenance

</div>

<div class="right-column">

![width:100%](figs/example.png)

</div>

---

## 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:

<div class="vspace-small"></div>

Small vertical space (1em)

<div class="vspace-medium"></div>

Medium vertical space (2em) - good for section breaks

<div class="vspace-large"></div>

Large vertical space (3em) - for major separations

---

## Spacing Examples

<div style="max-width: 300px;">

```python
def calculate():
    result = 42
    return result
```

</div>

<div class="vspace-medium"></div>

The function returns a simple value.

<div class="vspace-small"></div>

![width:300px](figs/example.png)

<div class="push-up"></div>

Images can have custom spacing too.

---

<!-- _class: layout-2col -->
### Full Slide Example

<div class="left-column">

**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:**


<div style="max-width: 300px;">

```python
def score(term, doc):
    tf = freq(term, doc)
    idf = log(N / df)
    return tf * idf
```
</div>

</div>

<div class="right-column">

![width:300px](figs/example.png)

![width:300px](figs/example.png)

<p style="font-size: 0.7em; color: #666;">featuring two column mode for e.g. figs + txt</p>

</div>

<div class="cite">[Also with citation helper class!]</div>

---

## Thank You

This theme provides a clean, academic-focused foundation for your presentations.

Visit the repository for more examples and documentation.