Document tools

Markdown to LaTeX

Convert markdown to latex with pandoc. Runs entirely on your device.

Runs on your device. The file is never uploaded.

Markdown to LaTeX writes a Markdown file out as a .tex body: sections, lists, tables, and dollar-delimited math kept as real math rather than approximated. Characters LaTeX treats specially are escaped where they appear as ordinary words. There is no documentclass line and no preamble, so the file will not compile alone.

Input

Questions

Can I compile the .tex file straight away?

Not on its own. Pandoc runs without its standalone option, so you get the body of the document: sections, paragraphs, lists, tables and math, with no documentclass line, no preamble and no begin document. Paste it into your own template between begin document and end document, and it will compile with whatever packages your preamble loads.

Does my math survive?

Yes. Pandoc's Markdown reader understands dollar-delimited math, both inline and display, and its LaTeX writer writes it back out as LaTeX math. This is the one conversion in this family where math is native to both sides rather than being approximated, so formulas come through as formulas.

What happens to images and tables?

Images become includegraphics commands carrying the same path your Markdown used, so your preamble needs the graphicx package and the image files need to sit where the path says. Tables are written as LaTeX tables. No image data is read: the tool passes pandoc the text of your Markdown and no other file.

Will special characters break my build?

Pandoc escapes the characters LaTeX treats specially, such as percent, ampersand, underscore, hash and dollar, when they appear as ordinary text in your Markdown. What it cannot fix is missing packages: if your text needs Unicode symbols your engine has no font for, that is a preamble problem, not a conversion problem.

How do I convert LaTeX back to Markdown?

Use LaTeX to Markdown. Do not expect a clean round trip, because your preamble, custom macros and package options have no Markdown equivalent and are dropped on the way back. The file name here is your Markdown name with the .tex extension.

Related Document tools