Skip to main content

Markdown Equations Fixer and Converter

PyPI version Python 3.7+ License: MIT

A command-line tool to standardize mathematical equations in Markdown files and convert documents between formats (Markdown, LaTeX, DOCX, PDF).

Key Features

  • Fix Markdown Equations: Standardizes LaTeX-style equations to Markdown format
    • \[...\] → $$...$$ (block equations)
    • \(...\) → $...$ (inline equations)
    • Multi-line equations supported
  • Document Conversion: Convert between formats using Pandoc
    • Input: markdown, gfm, commonmark, latex, org, docx
    • Output: markdown, gfm, commonmark, latex, org, docx, pdf
  • CLI Features: Recursive processing, dry-run mode, progress indicators

Installation

Prerequisites: Python 3.7+

pip install markdown-equations-fixer

For document conversion, install Pandoc:

  • Windows: choco install pandoc
  • macOS: brew install pandoc
  • Linux: sudo apt-get install pandoc

For PDF/DOCX output, install a LaTeX distribution:

  • Windows: choco install miktex
  • macOS: brew install --cask basictex
  • Linux: sudo apt-get install texlive-latex-extra

Usage

Fix Equations

Standardize mathematical equations in Markdown files (.md, .markdown):

# Fix a single file
meq-fixer fix document.md

# Fix multiple files/directories
meq-fixer fix file1.md file2.md ./docs/

# Recursively process a directory
meq-fixer fix -r ./my-project/

# Preview changes without modifying (dry run)
meq-fixer fix --dry-run thesis.md

# Verbose output
meq-fixer fix -v document.md

Options:

  • --dry-run: Preview without making changes
  • --verbose, -v: Show detailed progress
  • --recursive, -r: Process subdirectories

Convert Documents

Convert between document formats:

# Markdown to DOCX
meq-fixer convert paper.md paper.docx --to-format docx

# LaTeX to GitHub Markdown
meq-fixer convert report.tex report.md -f latex -t gfm

# Convert and fix equations (Markdown output only)
meq-fixer convert paper.tex paper.md -t markdown --fix-equations

# Markdown to PDF
meq-fixer convert thesis.md thesis.pdf -t pdf

Options:

  • --from-format, -f: Input format (markdown, gfm, commonmark, latex, org, docx)
  • --to-format, -t: Output format (markdown, gfm, commonmark, latex, pdf, docx, org)
  • --fix-equations: Fix equations in Markdown output (Markdown formats only)

Examples

Input:

Here's an equation: \[E = mc^2\]

And a matrix:
\[
\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6
\end{bmatrix}
\]

Output: May not format properly on github, but will work on markdown editor apps like obsidian, marktext, etc.

Here's an equation: $$E = mc^2$$

And a matrix:
$$
\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6
\end{bmatrix}
$$

Dependencies

Python packages (installed automatically):

  • click>=8.0.0
  • rich>=10.0.0
  • pypandoc

See Installation for system dependencies.

License

MIT License. See LICENSE file.

Contributing

Contributions welcome! Open an issue or submit a pull request.

Metadata

Release files for markdown-equations-fixer 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for markdown-equations-fixer 1.2.0
File Size Uploaded
markdown_equations_fixer-1.2.0.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for markdown-equations-fixer 1.2.0
File Interpreter ABI Platform
markdown_equations_fixer-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.1 kB

Release files / markdown_equations_fixer-1.2.0.tar.gz

Download URL markdown_equations_fixer-1.2.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
98a84a47f569e73c885db2cf95c843829167161444a3c64f2f3f887fe7bdc434
BLAKE2b-256 checksum
How to use checksums
123f46526372cd4fac7e499e435acbccab998da9e8b741274ff32d655bc0d4bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Release files / markdown_equations_fixer-1.2.0-py3-none-any.whl

Download URL markdown_equations_fixer-1.2.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
748b22e0235a2164d07d62e6d6127cc3160edbf8dd2782a3b6c3cb947f460e06
BLAKE2b-256 checksum
How to use checksums
9a07538989770ccaf9342ab7ff9d7734d782ec3e3b8260cacc2d112dac6de73a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.3

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page