Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Mermaid Export Fit

Rosetta Zidian GuoRosetta Zidian Guofyaicfyaic232 downloads

Prevents wide Mermaid diagrams from breaking during PDF/HTML export.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates2

Mermaid Export Fit keeps wide Mermaid diagrams visible in Obsidian and prevents them from breaking during PDF/HTML export.

It is intentionally invisible in daily use: install it, restart your Obsidian vault, and keep writing Mermaid as usual.

Why This Exists

Large Mermaid diagrams often have a natural width that is wider than the Obsidian reading pane or PDF page. Without export-aware fitting, the right side of the diagram can be clipped in the exported document.

Kudos to this plugin: Mermaid Popup. It is useful for inspecting Mermaid diagrams inside Obsidian. Mermaid Export Fit focuses on a different pain point: keeping the diagram intact when the note is exported to PDF or HTML.

Before Mermaid Export Fit, a large diagram can be clipped in the exported PDF:

A large Mermaid diagram clipped during PDF export before installing Mermaid Export Fit

After Mermaid Export Fit is installed, the exported PDF keeps the whole diagram visible:

The same large Mermaid diagram fitted correctly after installing Mermaid Export Fit

Features

  1. Preserves Mermaid SVG clarity instead of forcing every diagram to shrink in normal reading.
  2. Adds horizontal scrolling when a diagram is wider than the reading pane.
  3. Fits Mermaid diagrams to page width during PDF and HTML export.
  4. Provides an English-first settings page with a globe button for English/Chinese switching.

Installation

  1. Copy the mermaid-fit/ folder into your vault's .obsidian/plugins/ directory.
  2. In Obsidian, open Settings -> Community plugins and enable community plugins.
  3. Enable Mermaid Export Fit.
  4. Restart or reload your Obsidian vault.
  5. Done. The plugin works automatically with no extra setup.

Usage

There is no workflow to learn. Once the plugin is enabled and the vault has been restarted, Mermaid diagrams are adjusted automatically in reading mode, live preview, and export.

Language

The plugin uses English by default. Open Settings -> Community plugins -> Mermaid Export Fit, then click the globe icon in the upper-right of the plugin settings page to switch between English and Chinese.

Commands

Open the command palette with Ctrl+P:

Command Action
Refresh all Mermaid diagrams Re-scan the current workspace and apply Mermaid fit behavior.
Scale Mermaid diagrams to fit container Force Mermaid SVGs to fit the available width.

Settings

  • Enable horizontal scrolling: Keep wide diagrams scrollable without clipping.
  • Fit diagrams when exporting: Scale Mermaid SVGs to page width for PDF/HTML export.

Privacy

Mermaid Export Fit works locally in Obsidian. It does not use the network, collect telemetry, or send vault content to any service.

Compatibility

  • Obsidian desktop
  • Obsidian mobile
  • PDF export
  • HTML export
  • Slides/presentation views

License

MIT. See LICENSE.

中文简介

Mermaid Export Fit 默认使用英文界面,可在插件设置页右上角点击地球图标切换为中文。它解决的核心痛点是:大型 Mermaid 图表在 Obsidian 内部可以想办法查看,但一旦导出为 PDF/HTML 仍可能被裁切;安装本插件并重启 vault 后,导出也会自动适配,不需要额外操作。

版本: 1.0.1

HealthExcellent
ReviewPassed
About
Keep wide Mermaid diagrams intact in Obsidian and prevent clipping during PDF/HTML export. Preserve SVG clarity, add horizontal scrolling in the reading pane, and fit diagrams to page width during exports automatically.
CodeExportPDF
Details
Current version
1.0.1
Last updated
3 weeks ago
Created
3 weeks ago
Updates
2 releases
Downloads
232
Compatible with
Obsidian 0.15.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Authors
Rosetta Zidian GuoRosetta Zidian Guorosetta-zidian-guo
GitHubrosetta-guo-fyaic
rosetta-guo
medium.com
producthunt.com
scholar.google.com
fyaicfyaic
GitHubfyaic
  1. Community
  2. Plugins
  3. Code
  4. Mermaid Export Fit

Related plugins

Slides Extended

Create markdown-based reveal.js presentations. Fork of Advanced Slides.

Pandoc Plugin

Commands to export to Pandoc-supported formats like DOCX, ePub and PDF.

qmd as md

Edit, preview, and render Quarto (.qmd) files with executable code cells via Quarto to PDF, DOCX, HTML, or reveal.js.

Marp Slides

Create Marp presentations.

PDF Highlights

Extract highlights, underlines and annotations from your PDFs.

Advanced PDF Export

Export notes as pixel-perfect PDFs with live preview, style presets, manual page breaks, tables, and full layout control.

PDF break page

Add shortkey and command to insert a break page formating for pdf exports.

Templater

Create and use dynamic templates.

Mermaid Tools

Improved Mermaid.js experience: visual toolbar with common elements and more.

Text Extractor

A (companion) plugin to facilitate the extraction of text from images (OCR) and PDFs.