md2 converter · Runs in your browser

Markdown to LaTeX

Editable LaTeX source for XeLaTeX, with Arabic through polyglossia and the Amiri font.

Open the studio

How it works

  1. Write or paste Markdown in the studio, or send it from a terminal or your agent.
  2. The md2 engine reads the document once and detects each paragraph's direction.
  3. A LaTeX (TEX) file is built and downloads right away.

When to use it

  • Finish a paper in Overleaf
  • University templates that require LaTeX
  • Full control over academic typesetting

Right-to-left Arabic

English paragraphs in an Arabic document get an english environment, Latin words \textenglish, and numbers never flip.

Try it now

curl
curl -X POST https://md2.dev/v1/convert \
  -H "Content-Type: application/json" \
  -d '{"markdown":"# Report\n\nHello from md2","format":"tex"}' \
  -o document.tex
MCP tool
{
  "tool": "convert",
  "arguments": {
    "markdown": "# Report\n\nHello from md2",
    "format": "tex"
  }
}

Common questions

How do I compile it?
Run xelatex document.tex, or upload it to Overleaf and pick XeLaTeX.
Is my math kept as written?
Yes, the TeX source passes through unchanged inside \[ \] and $ $.
Is the output actually compiled?
Yes, our tests compile every Arabic sample with XeLaTeX on every run.