You have a PDF (a paper, a set of lecture notes, an old exam) and you need to edit it in LaTeX: fix a formula, reuse a proof or adapt it for your own document. The problem is that a PDF is made to be read, not edited, and copying from it rarely gives you anything usable.
This guide explains why converting a PDF to LaTeX is harder than it looks, the quickest way to do it depending on the type of PDF you have, and how to get LaTeX code that compiles on the first try.
Quick answer
To convert a PDF to LaTeX, first check whether the original source is available (most arXiv papers, for example, offer their LaTeX files). If it isn't, upload the PDF to an AI converter such as MathWrite: use the Turbo model if the PDF was generated with LaTeX, or Professional if it is scanned or handwritten. You'll get editable LaTeX code with a compiled preview that you can open in Overleaf.
Why you can't just copy and paste from a PDF
A PDF doesn't store the structure of a document. It stores characters and their positions on the page. A fraction is just a few symbols placed above and below a line; a matrix is a grid of characters with no notion of rows or columns.
That's why, when you copy an equation from a PDF and paste it into your editor, you get scrambled text: lost superscripts, symbols replaced by odd characters and line breaks in the wrong places. Rebuilding the LaTeX means reading the page visually, the way a person would.
First, identify what kind of PDF you have
The right method depends on how the PDF was created:
| Type of PDF | How to recognize it | Best option |
|---|---|---|
| Generated with LaTeX | Sharp, selectable text with the typical LaTeX fonts and formulas (papers, theses, lecture notes) | Look for the source, or use MathWrite Turbo |
| Generated with Word or another editor | Selectable text, but different typography and equations | MathWrite Professional |
| Scanned or photographed | You can't select the text: each page is an image | MathWrite Professional |
| Handwritten notes | Handwriting, often scanned with a phone | MathWrite Professional |
Option 1: find the original LaTeX source
If the PDF was written in LaTeX, the original .tex files may already exist. It's worth a quick check before converting anything:
- arXiv: most papers include their source files. On the paper's page on arXiv, look for the "TeX Source" link next to the PDF to download them.
- Your professor or the authors: for lecture notes or papers, a polite email often gets you the
.texfiles. - Overleaf: if the document was shared from an Overleaf project, ask for access to the project to download the source.
If the source isn't available, or the PDF wasn't made with LaTeX, go to option 2.
Option 2: convert the PDF with MathWrite, step by step
- 1
Upload the PDF
Drag the file into MathWrite. PDFs up to 10 MB are accepted; if yours is larger, compress it or split it into parts.
- 2
Choose the model
Turbo for PDFs generated with LaTeX: it processes dozens of pages in seconds and also extracts the figures. Professional for everything else: scans, PDFs made in Word or handwritten notes.
- 3
Wait a few seconds
A progress bar shows the pages being processed. With the Unlimited plan you can convert up to 100 pages at once with Turbo and up to 20 with Professional.
- 4
Review the result
The LaTeX code appears next to the compiled PDF. Compare it with the original and edit anything you need right in the editor.
- 5
Take it wherever you need it
Copy the code, open it in Overleaf with one click, or export it to Word, HTML or Markdown.
Have a PDF at hand? Convert it now.
Convert a PDF to LaTeXWhat the result looks like
When you convert a PDF you get a complete document that compiles, not loose fragments. For a page with a theorem and a numbered equation, the LaTeX looks like this:
Example: LaTeX for a page with a theorem
\documentclass{article}
\usepackage{amsmath, amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
\section{The fundamental theorem of calculus}
\begin{theorem}
If $f$ is continuous on $[a,b]$ and $F(x) = \int_a^x f(t)\,dt$,
then $F$ is differentiable on $(a,b)$ and
\begin{equation}
F'(x) = f(x).
\end{equation}
\end{theorem}
\end{document}Tips for converting PDFs
- Convert only the pages you need: it's faster and the result is easier to review.
- With scanned PDFs, scan quality makes the difference. 300 dpi is a good minimum.
- Use Turbo only for PDFs generated with LaTeX. It isn't designed for handwriting or scans, where Professional gives better results.
- Check tables and long equations in the preview: they're the parts most worth a second look.
- If the PDF is password-protected, remove the protection before uploading it.
- Respect copyright: converting a PDF to edit it doesn't give you the right to republish someone else's work.
What to do with the LaTeX afterwards
Edit it in Overleaf
Open the project with one click and keep working with your collaborators.
Turn it into slides
Generate a Beamer presentation from the converted document. Here's how.
Export it to Word
If someone needs a .docx, see how to convert LaTeX to Word without losing the equations.
Translate it
Translate the document into more than 20 languages without breaking a single equation.
Frequently asked questions
Can I convert a PDF to LaTeX for free?
You can try it for free: when you create a MathWrite account you get free credits to convert your first pages. For regular use, the Unlimited plan costs $9.99 a month or $39.99 a year (€9.99 or €39.99 in the eurozone).
Does it work with scanned PDFs?
Yes. Use the Professional model, which is designed for scans, images and handwritten notes. The sharper the scan, the more accurate the result.
How many pages can I convert at once?
With the Unlimited plan, up to 100 pages per PDF with Turbo and up to 20 with Professional. Files can be up to 10 MB.
Are the figures kept?
With Turbo, the figures in the PDF are extracted together with the LaTeX code, so you can reuse them in your document.
Can I open the result in Overleaf?
Yes, with one click. You can also copy the code into any LaTeX editor.
Is it the same as having the original .tex file?
Not exactly. The original source may include the author's macros and comments, while a conversion rebuilds the document from what is visible in the PDF. To edit and reuse the content, the result is usually more than enough.
Convert your first PDF to LaTeX
Create your account, upload your PDF and get editable LaTeX code in seconds, ready to open in Overleaf.
Start Converting for FreeTrusted by 20,000+ academics worldwide