Welcome to the Marp Sandbox! This guide will help you create and manage presentations using Marp.
-
Create a new presentation
- Create a new
.mdfile in thepresentations/directory - Start with the Marp frontmatter:
--- marp: true theme: default paginate: true ---
- Create a new
-
Build your presentation
npm run build # Generate HTML npm run build:pdf # Generate PDF npm run build:pptx # Generate PowerPoint npm run build:all # Generate HTML and PDF
-
Preview your presentation
npm run serve # Start live preview server npm run watch # Auto-rebuild on changes
| Script | Description |
|---|---|
npm run build |
Convert presentation to HTML |
npm run build:pdf |
Convert presentation to PDF |
npm run build:pptx |
Convert presentation to PowerPoint |
npm run watch |
Watch for changes and auto-rebuild HTML |
npm run serve |
Start development server with live preview |
npm run build:all |
Build both HTML and PDF versions |
npm run theme |
Build with custom theme |
Each presentation should start with frontmatter configuration:
---
marp: true
theme: default
paginate: true
backgroundColor: #fff
---
# Your First Slide
Content goes here...
---
# Second Slide
More content...Use --- (three hyphens) to separate slides.
Marp comes with three built-in themes:
defaultgaiauncover
Set in frontmatter:
---
theme: gaia
---- Create your theme in
themes/directory - Apply it using the theme script:
npm run theme
- Or specify in the command:
npx marp presentations/your-presentation.md --theme themes/custom-theme.css
Control individual slides with directives:
<!-- _class: lead -->
<!-- _backgroundColor: #123456 -->
<!-- _color: white -->Background images:

Inline images:
Standard Markdown syntax works:
- Item 1
- Nested item
- Item 2
| Column 1 | Column 2 |
|----------|----------|
| Data 1 | Data 2 |Use triple backticks with language specification:
```javascript
console.log('Hello, Marp!');
```Inline: $E = mc^2$
Block:
$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
$$marp-sandbox/
├── presentations/ # Your presentation files
├── themes/ # Custom themes
├── assets/ # Images and other resources
│ └── images/
├── output/ # Generated presentations (gitignored)
└── package.json # NPM scripts and dependencies
- Use version control: Track your presentations in Git
- Organize assets: Keep images in
assets/images/ - Test exports: Always preview HTML before generating PDF/PPTX
- Custom styling: Create reusable themes for consistent branding
- Keyboard shortcuts: Use arrow keys to navigate during presentation
Issue: Images not loading
- Solution: Use relative paths from the presentation file
Issue: PDF generation fails
- Solution: Ensure Chromium/Chrome is installed (required for PDF export)
Issue: Custom theme not applying
- Solution: Check the theme path and ensure CSS syntax is valid