mergdowntotex

approved

by DJONTSO V. dvrchipro@gmail.com

Merge & doc. export everything — embeds, Zotero/Pandoc citations, Mermaid, equations, cross-refs — into a unique .tex file. Compile to PDF, DOCX, or InDesign. WASM engine, zero build step. - This plugin has not been manually reviewed by Obsidian staff.

1 stars70 downloadsUpdated 1mo agoMIT

mergdown2tex Logo

mergdowntotex

Merge everything. Convert anywhere.
WASM engine runs inside Obsidian. No build step required.

Obsidian License Documentation


What it does

mergdown2tex takes your Obsidian note and transforms it into a publication-ready LaTeX document. Everything is merged automatically:

InputOutput
[[Wikilinks]]\hyperref[...]{} cross-references
![[Embedded notes]]Recursive expansion
![[image.png]]\includegraphics{}
@citation\citep{} + bidirectional arrows (↑↓)
$math$ / $$math$$LaTeX equations
Mermaid diagramsAuto-rendered to PNG
> [!note] calloutstcolorbox environments
Footnotes, tables, listsFull LaTeX support

Output formats:

  • PDF via TeX Live + Podman
  • DOCX via Pandoc
  • .tex for manual editing
  • InDesign compatible output

How it works

┌─────────────────────────────────────────────────────────┐
│  Obsidian Note                                          │
│  ├── [[Note A]]          ──→  \input{note_a}           │
│  ├── ![[Note B]]         ──→  recursive expansion      │
│  ├── ![[image.png]]      ──→  \includegraphics{}       │
│  ├── @citation           ──→  \citep{} + arrows ↑↓     │
│  ├── $math$              ──→  LaTeX equation            │
│  └── ```mermaid```       ──→  rendered PNG              │
└─────────────────────────────────────────────────────────┘
                        │
                        ▼
┌─────────────────────────────────────────────────────────┐
│  WASM Engine (inside Obsidian)                          │
│  ├── Markdown → LaTeX conversion (pure Rust)            │
│  ├── Embed expansion (filesystem)                       │
│  ├── Citation extraction + navigation                   │
│  └── Mermaid → PNG rendering                            │
└─────────────────────────────────────────────────────────┘
                        │
                        ▼
┌─────────────────────────────────────────────────────────┐
│  Output Files                                           │
│  ├── document.tex    (LaTeX source)                     │
│  ├── document.pdf    (compiled PDF)                     │
│  └── document.docx   (Word document)                    │
└─────────────────────────────────────────────────────────┘

Dependencies

StepWhat you needStatus
Markdown → LaTeXWASM engineNone (runs in Obsidian)
LaTeX → PDFTeX Live + PodmanRequired
LaTeX → DOCXPandocRequired

For PDF/DOCX compilation

Install the LaTeX environment using the included Dockerfile:

# Build the container (one time)
podman build -t mergdown2tex-env -f Dockerfile .

# Or use Docker
docker build -t mergdown2tex-env -f Dockerfile .

The container includes:

  • TeX Live (full)
  • Pandoc
  • Python3 + Pygments (for minted)
  • All required LaTeX packages

Install

Manual install

  1. Download main.js and manifest.json from Releases
  2. Copy to .obsidian/plugins/mergdown2tex/
  3. Enable in Settings → Community Plugins

Folder structure

.obsidian/
└── plugins/
    └── mergdown2tex/
        ├── main.js          ~2.8 MB   ← plugin + WASM embarqué
        └── manifest.json     351 B    ← metadata

Commands

CommandAction
mergdown2tex: Convert to LaTeXGenerate .tex file
mergdown2tex: Compile to PDFGenerate PDF
mergdown2tex: Compile to DOCXGenerate Word document

Settings

SettingDefaultDescription
documentclassreportLaTeX document class
fontsize12ptFont size
bibliography""Path to .bib file
customPreamble""Custom LaTeX preamble
useMintedtrueSyntax highlighting with minted
useTcolorboxtrueCallouts as tcolorbox
mermaidDpi150Mermaid diagram resolution

Why mergdown2tex?

Pandoc PluginPandoc CLImergdown2tex
Install requiredPandoc + TeX LivePandoc + TeX LiveWASM only
Wikilink resolution
Embed expansion
Citation arrows (↑↓)
Mermaid → PNG
Custom preamblePartialManual

Architecture

Release (2 files — installés par Obsidian) :

main.js          ~2.8 MB   ← plugin + WASM embarqué (Base64)
manifest.json     351 B    ← metadata

Développement (dans le repo) :

main.js             56 KB   ← plugin + WASM bindings
vlatex_bg.wasm     2.1 MB   ← WASM séparé (loaded from disk)
manifest.json       351 B   ← metadata
scripts/
└── bundle-release.js        ← encode WASM → Base64 → injecte dans main.js

Build release automatisé par GitHub Actions :

graph LR
    A[git tag 1.0.x] --> B[GitHub Actions]
    B --> C[bundle-release.js]
    C --> D[main.js + WASM]
    D --> E[Release]
    D --> F[Attestations]

Zero build step. WASM embarqué dans main.js à la release.


Troubleshooting

"WASM module not loaded"

  • Ensure vlatex_bg.wasm is in the same folder as main.js
  • Restart Obsidian

"Podman not found"

"Compilation failed"

  • Check that the container is built: podman images | grep mergdown2tex-env
  • Rebuild if needed: podman build -t mergdown2tex-env -f Dockerfile .

License

MIT


Support

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.