Mermaid Diagrams¶
MergDown2TeX renders Mermaid diagrams to PNG images for LaTeX.
How it works¶
graph TD
A[Mermaid Code] --> B[Render to PNG]
B --> C[Save to Figures]
C --> D[Include in LaTeX]
Syntax¶
Basic diagram¶
Input:
Output:
Supported diagrams¶
Flowchart¶
Input:
Output:
Sequence diagram¶
Input:
Output:
Class diagram¶
Input:
Output:
State diagram¶
Input:
Output:
Gantt chart¶
Input:
```mermaid
gantt
title Project Schedule
section Phase 1
Task 1: 2024-01-01, 30d
Task 2: 2024-02-01, 20d
```
Output:
Pie chart¶
Input:
Output:
Configuration¶
DPI setting¶
Options: 72, 96, 150, 300
Image format¶
Options: png, svg
Image storage¶
Default location¶
Custom location¶
Troubleshooting¶
Diagram not rendering¶
Error:
Solution: - Check Mermaid syntax - Verify special characters are escaped - Try simpler diagram first
Image not found¶
Error:
Solution:
- Check figures/ folder exists
- Verify write permissions
- Check disk space
Next steps¶
- Cross-References - Navigation arrows
- Configuration - Customize settings
- Compilation - PDF/DOCX options