Skip to main content
Datatool360

How to Fix Equations That Break When You Convert a PDF to Markdown

By the Datatool360 team ·

You convert a maths PDF to Markdown and the equations come out as a row of letters, a stray fraction bar or a pile of odd symbols. The text around them is fine, but every formula is wrong. This guide explains why that happens and how to get Markdown in which the equations are real LaTeX that your notes app or notebook can display.

Want to do it right now? Open the Math PDF to LaTeX tool

Why equations break

Most PDF to Markdown converters copy the text of the PDF. In a PDF a formula is not text. It is single symbols and little lines placed at positions on the page: the top of a fraction, a bar, the bottom, a root sign drawn as a shape. Copying the symbols gives the pieces and loses the structure, so a fraction becomes two numbers on two lines and a power becomes a normal digit.

Markdown itself cannot hold an equation. Notes apps and notebooks show equations when they are written as LaTeX between dollar signs, so the converter has to rebuild each formula in that form.

Get Markdown with real equations

  1. Open the Math PDF converter and upload the PDF.
  2. Press convert. Formulas are rebuilt and written as LaTeX.
  3. Check the live preview. It shows the equations as they will look, and marks the ones the converter is not sure about.
  4. Fix any formula in the editor, then choose the Markdown export.

In the Markdown file a formula that sits on its own line is written between double dollar signs, and a formula inside a sentence between single dollar signs. Question numbers, options and headings are kept in the order of the original.

Make sure your app shows the equations

If the equations show up as code, the problem is not the file but the program that opens it.

  • Many Markdown editors and note apps show dollar-sign equations, some only after you turn on a “math” or “LaTeX” option in the settings.
  • Jupyter notebooks show them in Markdown cells. GitHub shows them in Markdown files.
  • Plain text editors and some chat apps only show the code. That is expected.
  • A static site generator may need a maths plugin, KaTeX or MathJax, before the page shows equations.

Typical problems and what to do

  • A formula is wrong: compare it with the PDF. A flagged formula is the first to check. Correct the LaTeX in the editor and export again.
  • A percent sign disappears: in LaTeX % starts a comment and is written \%. The converter does this for you, but a hand-typed percent inside a formula needs the backslash.
  • A dollar sign in the text, such as a price, is taken for the start of a formula: write it as \$.
  • A very large stacked fraction or matrix is only partly right: these layouts can not always be rebuilt from a PDF. They are flagged, so you know where to look.

Scans, photos and handwriting

A PDF that is a scan or a photo has no symbols to read, so its equations are read from the picture. That is much less exact, and the converter marks those formulas so that you check them. A clear, straight scan with a high resolution helps a lot. Handwriting is not supported.

Where your file goes

The converter processes the PDF on our server and stores it so that you can edit and download it. The file and the extracted text are deleted automatically 72 hours after you upload them. If a document is private, think about whether you want to upload it, and ask us through the contact page if you want it removed sooner.

Keep reading