DOCX Compilation¶
MergDown2TeX compiles LaTeX to DOCX using Pandoc.
How it works¶
graph TD
A[Note] --> B[WASM Engine]
B --> C[.tex File]
C --> D[Pandoc]
D --> E[DOCX File]
Requirements¶
- Pandoc (inside container)
- TeX Live (for bibliography)
Compile DOCX¶
Option A: Command Palette¶
- Open command palette (
Ctrl/Cmd + P) - Type "MergDown2TeX"
- Select "MergDown2TeX: Convertir et compiler en DOCX (Word)"
Option B: Button¶
Click the DOCX button in the ribbon.
Option C: Bash script¶
#!/bin/bash
# compile-docx.sh
INPUT="document.tex"
CONTAINER="mergdown2tex-env"
# Copy file to container
podman cp "$INPUT" "$CONTAINER:/vault/"
# Compile with Pandoc
podman exec "$CONTAINER" pandoc "$INPUT" -o "${INPUT%.tex}.docx"
# Copy back
podman cp "$CONTAINER:/vault/${INPUT%.tex}.docx" .
Pandoc options¶
Default¶
With bibliography¶
With reference document¶
DOCX features¶
Automatic conversion¶
| LaTeX | DOCX |
|---|---|
\section{} |
Heading 1 |
\subsection{} |
Heading 2 |
\textbf{} |
Bold |
\textit{} |
Italic |
\citep{} |
Citation |
\includegraphics{} |
Image |
\begin{table} |
Table |
\begin{equation} |
Equation |
Custom styles¶
Create a reference DOCX:
# Generate reference
pandoc -o reference.docx --print-default-data-file reference.docx
# Customize in Word
# Use as reference
pandoc document.tex --reference-doc=reference.docx -o output.docx
Troubleshooting¶
Pandoc not found¶
Error:
Solution:
- Rebuild container with Pandoc
- Check Dockerfile includes pandoc
Bibliography not working¶
Error:
Solution:
- Include --bibliography flag
- Check .bib file path
Images not showing¶
Error:
Solution: - Check image paths - Use absolute paths - Include images in DOCX
Next steps¶
- PDF Compilation - PDF output
- LaTeX Compilation - Manual compilation
- Configuration - Customize settings