How to convert a PDF back into LaTeX
By Shihab Shahriar Antor · Updated August 2026 · 7 min read
A PDF does not contain LaTeX, so nothing can extract it. What a good conversion does is rebuild: read the pages, recreate the structure as sections, equations, tables and references, then compile and compare against the original. Expect to recover the document, not the original source file.
Why there is no real converter
A PDF is a description of where to put marks on a page. By the time LaTeX has produced one, the source is gone: no sections, no \cite, no equation environments, just glyphs at coordinates. Anything claiming to extract LaTeX from a PDF is reconstructing it from appearance, which is a different job with a different failure mode.
That reframing matters, because it tells you what to check. A converter that produced valid LaTeX has not succeeded; one whose compiled output matches the original has.
What comes back, and how reliably
| Element | Recovery | Note |
|---|---|---|
| Body text and headings | Good | Section hierarchy is usually obvious from the typography |
| Display equations | Good | Check symbols and sub/superscripts against the original |
| Tables | Good | Merged cells are where it goes wrong |
| Figures | As images | Vector plots stay images unless you rebuild them in TikZ |
| Citations | Text only | The .bib is not in the PDF; re-enter the entries |
| Cross-references | Rebuilt | Rendered numbers become real \label and \ref |
| Exact page layout | Not preserved | Start from the right document class instead |
Start from the class, not from the pixels
If the PDF was an IEEE paper, do not try to reproduce two columns and the heading sizes by hand. Open an IEEE template and pour the recovered content into it. The layout is then correct because the class is correct, which is the whole point of LaTeX and the reason a pixel-faithful rebuild is the wrong goal.
letX has 1,003 templates including IEEE, ACM, Springer LNCS, Elsevier, and a large set of university thesis formats, so the class you need is usually one search away.
The bibliography is a separate job
Rendered citations are just text: "[12] A. Smith et al., 2024". Nothing in the PDF says which entry that was. Rebuild the .bib from DOIs, which is fast and exact, and let \cite renumber everything. Trying to preserve the printed numbers is how you end up with a bibliography that cannot be reordered.
Only rebuild documents you have the right to rebuild. Recovering your own paper after losing the source is ordinary; retypesetting somebody else's published PDF is a copyright question, not a technical one.
Upload a PDF and get a compiling LaTeX project back to correct by hand.
Try /pdf-to-texFrequently asked questions
Can you convert a PDF to LaTeX?
Not by extraction, because a PDF contains no LaTeX. It can be rebuilt: the pages are read and the structure recreated as sections, equations, tables and references, then compiled. You recover the document, not the original source file.
Will the converted LaTeX look identical to the PDF?
Not line for line, and chasing that is the wrong goal. Start from the correct document class, such as IEEE or Springer, and the layout is right by construction. What should match is the content and the structure.
What about the references?
Citations in a PDF are rendered text with no entry data behind them. Rebuild the .bib from DOIs and let \cite renumber. Preserving the printed numbers gives you a bibliography that cannot be reordered later.
Are figures recovered as editable graphics?
No. Figures come back as images. A plot can be rebuilt in TikZ or pgfplots if you still have the underlying numbers, but those numbers are not recoverable from the picture.
Is it legal to convert a paper to LaTeX?
Rebuilding your own document is fine. Retypesetting somebody else’s published PDF is a copyright question rather than a technical one, and depends on the licence it was published under.
Related
Written by Shihab Shahriar Antor , AI Engineer & Founder of Shahriar Labs. Builder of LetX (collaborative LaTeX) and QuantumSketch (AI STEM video).
