md2pptx is a tool that converts Markdown files to PowerPoint presentations. This cheat sheet provides comprehensive syntax and features for creating presentations with md2pptx.
- Basic File Structure
- Metadata Configuration
- Slide Types
- Content Types
- Text Formatting
- Media and Graphics
- Tables
- Card Slides
- Code Slides
- Funnels
- Dynamic Metadata
- Python Integration
- Navigation and Links
- Advanced Features
- Common Patterns
template: Martin Template.pptx
pageTitleSize: 24
sectionTitleSize: 30
baseTextSize: 18
numbers: yes
# Presentation Title
Subtitle text goes here
## Section One Title
### Content Slide Title
# Always specify these at the start
template: Martin Template.pptx # Template file
pageTitleSize: 24 # Content slide title size
sectionTitleSize: 30 # Section slide title size
baseTextSize: 18 # Base text size
numbers: yes # Show slide numbers
# Title sizes
pageTitleSize: 24 # Content slide titles
pageSubtitleSize: 22 # Content slide subtitles
sectionTitleSize: 30 # Section titles
sectionSubtitleSize: 24 # Section subtitles
presTitleSize: 42 # Presentation title
presSubtitleSize: 28 # Presentation subtitle
# Text sizing
baseTextSize: 18 # Base text size
baseTextDecrement: 2 # Size decrease per bullet level
marginBase: 0.5 # Margin around content (inches)
tableMargin: 0.3 # Table margins
numbersHeight: 0.4 # Space for slide numbers
# Color definitions
BoldColour: ACCENT 1 # Bold text color
ItalicColour: ACCENT 2 # Italic text color
style.fgcolor.highlight: FF0000 # Custom foreground color
style.bgcolor.yellow: FFFF00 # Custom background color
style.emphasis.important: bold underline # Custom emphasis
# Color formats
# Theme colors: ACCENT 1, ACCENT 2, BACKGROUND 1, TEXT 1, etc.
# RGB colors: #FF0000, #00FF00, #0000FF (hex format)
template: MyTemplate.pptx # Custom template
monoFont: Consolas # Monospace font
AdjustTitles: no # Don't auto-adjust titles
# Main Presentation Title
Additional subtitle information
Author details
Date information
## Section Title
Additional section information
### Content Slide Title
---
# Or use:
###
### Bullet Slide Title
* First level bullet
* Second level bullet
* Third level bullet
* Another second level
* Another first level bullet
### Mixed Lists
* Bullet item
1. Numbered sub-item
1. Another numbered sub-item
* Another bullet item
### Multi-Content Slide
<!-- md2pptx: contentSplit: 1 2 -->
<!-- md2pptx: contentSplitDirection: horizontal -->
* Bullet content
* Sub-bullet

**Bold text**
*Italic text*
`Monospace text`
<br/> # Line break
<sup>Superscript</sup>
<sub>Subscript</sub>
<ins>Underlined</ins>
<del>Strikethrough</del>
<span class="highlight">Highlighted text</span>
<span class="warning">Warning text</span>
# Define classes in metadata:
style.bgcolor.highlight: FFFF00
style.fgcolor.warning: FF0000
<span style="color: #FF0000; font-weight: bold;">Red bold text</span>
<span style="background-color: #FFFF00;">Yellow background</span>
<span style="font-size: 20px;">Large text</span>
& # &
< # <
> # >
# Non-breaking space
… # …
→ # →
← # ←
✓ # ✓
× # ×
÷ # ÷
### Graphic Slide Title

 # With tooltip
 # Web image
[](#target-slide) # Links to another slide
### Two Graphics
|||
### Four Graphics Grid
|||
|||
### Three Graphics
|||
||
### Video Slide
<video width="400" height="300" src="video.mp4"></video>
<video width="400" height="300" src="video.mp4" poster="poster.png"></video>
### Audio Slide
<audio src="audio.mp3"></audio>
<audio src="audio.mp3" poster="album-cover.png"></audio>
- PNG, JPEG (native support)
- SVG (requires CairoSVG)
- EPS (requires Pillow and Ghostscript)
- Data URLs:

### Table Slide
|Left Header|Center Header|Right Header|
|:----------|:----------:|----------:|
|Left data |Center data |Right data |
|More data |More center |More right |
# Number of dashes controls relative width
|Narrow|----Wide----|--Medium--|
|:-----|:-----------|:---------|
|A |B |C |
compactTables: 14 # Compact font size
tableHeadingSize: 20 # Header font size
addTableLines: both # Add borders
addTableRowLines: 1 # Lines after rows
addTableColumnLines: 1 3 # Lines after columns
addTableLineColour: 000000 # Line color
tableShadow: yes # Drop shadow
|A||C| # Empty cell spans columns
|:-:|:-:|:-|
|Spans two||One cell|
|1|2|3|
||A|B| # Empty first cell
### Card Slide Title
#### Card One
* Card content
* More content
#### Card Two
* Different content
* More items
#### Card Three
* Third card
* Content here
#### Card Title

* Card content below image
* More content
# Card appearance
CardColour: ACCENT 1, ACCENT 2, ACCENT 3 # Background colors
CardBorderColour: TEXT 1 # Border color
CardBorderWidth: 2 # Border width
CardTitleSize: 16 # Title font size
CardTitleColour: DARK 1 # Title color
CardTitleAlign: center # Title alignment
CardTitlePosition: above # above or inside
CardShape: rounded # rounded, squared, line
CardLayout: horizontal # horizontal or vertical
CardPercent: 80 # Space used by cards
CardShadow: yes # Drop shadow
CardHorizontalGap: 0.25 # Gap between cards
CardVerticalGap: 0.1 # Vertical gap
CardGraphicSize: 0.75 # Graphic size (inches)
CardGraphicPosition: before # before or after
### Code Slide
```python
def hello_world():
print("Hello, World!")
return True
### Code Example
for i in range(10): print(i)
### HTML Code Element
```markdown
### Code Sample
<code>
function example() {
return "Hello";
}
</code>
### Indented Code
def example():
return "Hello World"
### Highlighted Code
<pre>
<span class="keyword">def</span> <span class="function">example</span>():
<span class="keyword">return</span> <span class="string">"Hello"</span>
</pre>
# Define syntax colors:
style.fgcolor.keyword: 0000FF
style.fgcolor.function: 008000
style.fgcolor.string: 800000
CodeColumns: 80 # Code width
CodeForeground: 000000 # Text color
CodeBackground: FFFFFF # Background color
FPRatio: 1.2 # Height to width ratio
### GraphViz Diagram
```dot
digraph G {
A -> B;
B -> C;
C -> A;
}
### Funnel Slide
``` funnel
1000 Visitors,Website Traffic
100 Leads,Lead Generation
50 Qualified,Sales Qualified
25 Customers,Converted
funnelColours: ACCENT 1, ACCENT 2, ACCENT 3
funnelBorderColour: 000000
funnelTitleColour: FFFFFF
funnelTextColour: 000000
funnelLabelsPercent: 15
funnelLabelsPosition: before # before or after
funnelWidest: left # left, right, top, bottom, pipe
### Special Slide
<!-- md2pptx: baseTextSize: 16 -->
<!-- md2pptx: cardLayout: vertical -->
<!-- md2pptx: compactTables: 12 -->
<!-- md2pptx: backgroundImage: special-bg.png -->
<!-- md2pptx: contentSplit: 1 2 -->
<!-- md2pptx: contentSplitDirection: horizontal -->
<!-- md2pptx: hidden: yes -->
### Multi-Block Slide
<!-- md2pptx: contentSplit: 1 3 -->
<!-- md2pptx: contentSplitDirection: horizontal -->
* First block content
* Sub-bullet

### Next Slide
<!-- md2pptx: baseTextSize: pres --> # Back to presentation default
<!-- md2pptx: cardLayout: default --> # Back to md2pptx default
<!-- md2pptx: compactTables: prev --> # Previous value
### Python Enhanced Slide
``` run-python
# Create a chart from CSV data
chart_csv = RunPython.readCSV("data.csv")
chart_data = RunPython.makeChartData(chart_csv)
chart = RunPython.makeChart(slide, XL_CHART_TYPE.COLUMN_CLUSTERED,
renderingRectangle, chart_data,
"Chart Title", XL_LEGEND_POSITION.BOTTOM)
### Python from File
``` run-python mycode.py
prs
- Presentation objectslide
- Current slide objectrenderingRectangle
- Available drawing area
# CSV and data handling
data = RunPython.readCSV("file.csv")
filtered = RunPython.filterRows(data, filter_func)
transposed = RunPython.transposeArray(data)
# Charts
chart_data = RunPython.makeChartData(data)
chart = RunPython.makeChart(slide, chart_type, rect, data, title, legend)
# Tables
table = RunPython.makeTable(slide, rect, data)
RunPython.applyCellFillRGB(table, row, col, r, g, b)
# Shapes and annotations
shape = RunPython.makeDrawnShape(slide, vertices, filled, text, color)
RunPython.annotationsFromCSV(slide, "annotations.csv")
# Checklists
RunPython.checklistFromCSV(slide, rect, "checklist.csv")
### Source Slide
Link to [target slide](#target-reference)
### Target Slide [target-reference]
Content here
### Target Slide
<a id="target-reference"></a>
### External Links
[Website](https://example.com)
[Company Site](https://company.com)
[](#target-slide)
[Run Macro](ppaction://macro?name=myMacro)
- USER: Complete user documentation @due(2024-01-15) @tags(docs,priority)
- DEV: Implement feature @done(2024-01-10)
- MANAGER: Review progress @tags(review)
The <abbr title="Application Programming Interface">API</abbr> is important.
This has a footnote[^1].
[^1]: This is the footnote text.
### Slide Title
Slide content here
This is a slide note. It appears in PowerPoint's notes section.
More note content here.
backgroundImage: background.png
# Or per slide:
### Special Slide
<!-- md2pptx: backgroundImage: special-bg.png -->
transition: ripple
# Available transitions:
# ripple, reveal, honeycomb, shred, wipe, vortex, fracture, split, push
### Topics
* [Section One](#section-one)
* [Section Two](#section-two)
* [Section Three](#section-three)
# Configure TOC style:
tocStyle: chevron # chevron, circle, plain
tocTitle: Agenda # Custom TOC title
tocLinks: yes # Enable live links
Hidden Slides
hidden: no # Default for all slides
### Hidden Slide
<!-- md2pptx: hidden: yes -->
leftFooterText: Section <section>
middleFooterText: <presTitle>
rightFooterText: Page <pageNumber>
footerFontSize: 10
template: Martin Template.pptx
pageTitleSize: 24
sectionTitleSize: 30
baseTextSize: 18
numbers: yes
# Presentation Title
Subtitle and author information
## Introduction
### Overview
* Key points
* Objectives
* Agenda
## Main Content
### Key Concepts
* Concept 1
* Concept 2
* Concept 3
### Supporting Details
* Detail 1
* Detail 2
## Conclusion
### Summary
* Summary points
* Next steps
### Rich Content Slide
<!-- md2pptx: contentSplit: 1 1 -->
<!-- md2pptx: contentSplitDirection: horizontal -->
* Key bullet points
* Supporting information
* Context details

### Technical Implementation
<!-- md2pptx: contentSplit: 1 2 -->
* Overview points
* Key considerations
``` python
def implementation():
return "code example"
chart_data = RunPython.readCSV("metrics.csv")
chart = RunPython.makeChart(slide, XL_CHART_TYPE.LINE,
renderingRectangle, chart_data)
RunPython.checklistFromCSV(slide, renderingRectangle, "status.csv",
colourChecks=True)
template: Martin Template.pptx
pageTitleSize: 24
sectionTitleSize: 30
baseTextSize: 18
numbers: yes
#
for presentation title##
for section slides###
for content slides####
for card titles
- Use appropriate font sizes
- Maintain consistent spacing
- Use bullet points effectively
- Keep slides uncluttered
- Override settings per slide as needed
- Use contentSplit for complex layouts
- Hide slides during development
- Verify image paths and formats
- Test video/audio compatibility
- Use appropriate resolutions
- Images not loading: Check file paths and formats
- Table formatting: Verify column alignment syntax
- Code not highlighting: Check span class definitions
- Cards not displaying: Verify card metadata settings
- Links not working: Check anchor references
- Check the processing summary slide for metadata
- Verify file paths are correct
- Test with simple examples first
- Use the log output for error messages
template: Martin Template.pptx
pageTitleSize: 24
sectionTitleSize: 30
baseTextSize: 18
baseTextDecrement: 2
numbers: yes
BoldColour: ACCENT 1
ItalicColour: ACCENT 2
# Presentation Title
## Section Title
### Content Title
#### Card Title
--- # No title slide
### # No title slide (alternative)
* Bullets
|Table|Headers|

```code```
``` funnel
``` run-python
<!-- md2pptx: key: value -->
This cheat sheet covers the essential syntax and features of md2pptx. Use it as a reference when creating presentations to ensure proper formatting and take advantage of all available features.