docx-to-obsidian-markdown
Skill0 starsChanged 6 months agoMITView on GitHub
Convert Word (.docx) documents to Obsidian-compatible Markdown (.md) files with proper LaTeX math rendering, table conversion, image extraction, and heading hierarchy preservation. Use when the user wants to convert a .docx file to Markdown, especially academic papers or technical documents containing math formulas, Greek letters, tables, and figures.
In this repository9 other files it gives its agents.
- cc-monitorSkill
- code-commenterSkill
- code-comment-guidelinesSkill
- git-commit-zhSkill
- obsidian-note-architectSkill
- obsidian-note-formatterSkill
- project-context-exportSkill
- skill-creatorSkill
- tutorial-course-generatorSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Run the conversion script:
- Distinctive: line 46
After conversion, review the output for:
- Very specific: line 141
Use relative paths in Markdown: !description
- Very specific: line 150
If you encounter complex OMML math that the script cannot auto-convert, read references/omml-to-latex.md for the full mapping table
- Very specific: line 151
If you encounter edge cases in table conversion, read references/edge-cases.md
- Very specific: line 152
If you need to extract images with specific naming conventions, read references/image-extraction.md
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
DOCX to Obsidian Markdown Converter
Convert Word (.docx) documents to Obsidian-compatible Markdown format, with full support for LaTeX math, tables, images, and heading structures.
When to Use This Skill
Activate this skill when:
- The user asks to convert a
.docxfile to.md(Markdown) - The user mentions Obsidian Markdown format
- The user needs math formulas converted from Word equation editor (OMML) to LaTeX
- The user wants Greek letters (like λ, α, β) rendered as
$\lambda$,$\alpha$,$\beta$etc. - The user needs to preserve academic paper formatting (headings, tables, figures, citations)
Conversion Workflow
Step 1: Parse the DOCX File
Run the conversion script:
python3 scripts/convert.py <input.docx> <output.md>This script handles the complete conversion pipeline:
- Document structure analysis — Identifies headings, body text, lists, tables, images, and math blocks
- Math formula conversion — Converts Word OMML equations to LaTeX syntax
- Image extraction — Extracts embedded images to an
assets/folder alongside the output - Table conversion — Converts Word tables to Markdown pipe tables
- Output generation — Writes the final
.mdfile in Obsidian-compatible format
Step 2: Verify the Output
After conversion, review the output for:
- Math formulas render correctly in Obsidian preview mode
- Heading hierarchy is preserved (H1/H2/H3 mapped from Word Heading styles)
- Tables display correctly
- Images are referenced with relative paths
- Greek letters and special symbols use LaTeX notation
Step 3: Manual Adjustments (If Needed)
The automated conversion covers most cases, but some edge cases may require manual review. See references/edge-cases.md for known limitations and fixes.
Math Formula Rules (CRITICAL)
This is the most important part of the conversion. Obsidian uses MathJax to render LaTeX:
Inline Math
Wrap inline math expressions with single $:
- Word OMML equation within a paragraph →
$...$ - Greek letters standing alone →
$\lambda$,$\alpha$,$\theta$ - Variables or short expressions →
$x_i$,$f(x)$,$n \times m$
Display (Block) Math
Wrap display/block equations with double $$ on separate lines:
$$
e_{ij} = h_\theta(x_i, x_j - x_i)
$$Greek Letter Mapping
Common Greek letters must use LaTeX commands:
| Symbol | LaTeX | Symbol | LaTeX |
| α | $\alpha$ | β | $\beta$ |
| γ | $\gamma$ | δ | $\delta$ |
| λ | $\lambda$ | μ | $\mu$ |
| θ | $\theta$ | σ | $\sigma$ |
| ω | $\omega$ | φ | $\varphi$ |
| ε | $\varepsilon$ | η | $\eta$ |
Common Math Patterns
Fractions: \frac{a}{b} → $\frac{a}{b}$
Subscripts/Superscripts: x_i^2 → $x_i^2$
Summation: \sum_{i=1}^{n} → $\sum_{i=1}^{n}$
Integrals: \int_{0}^{\infty} → $\int_{0}^{\infty}$
Matrices: Use \begin{pmatrix}...\end{pmatrix} within $$ blocks
Equation numbering: Append \tag{n} within $$ blocks, e.g. $$e = mc^2 \tag{1.1}$$
Heading Mapping
Map Word heading styles to Markdown heading levels:
| Word Style | Markdown |
| Heading 1 | # |
| Heading 2 | ## |
| Heading 3 | ### |
| Heading 4 | #### |
| Title | # (with YAML frontmatter title) |
Table Conversion
Convert Word tables to Markdown pipe tables:
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Data 1 | Data 2 | Data 3 |For merged cells or complex layouts, fall back to HTML tables:
<table>
<tr><th>Header</th></tr>
<tr><td>Data</td></tr>
</table>Image Handling
- Extract all embedded images from the
.docxto anassets/folder next to the output.mdfile - Use relative paths in Markdown:
 - Preserve captions as alt text or adjacent paragraphs
Citation Handling
Word cross-references and citations (e.g., [5], [6]) should be preserved as-is in the Markdown text. If the user wants to convert to Obsidian's citation format later, that is a separate step.
File References
- If you encounter complex OMML math that the script cannot auto-convert, read
references/omml-to-latex.mdfor the full mapping table - If you encounter edge cases in table conversion, read
references/edge-cases.md - If you need to extract images with specific naming conventions, read
references/image-extraction.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

