# PDF to LaTeX

Recover editable LaTeX, figures, and useful document structure from a PDF, including scanned pages with a local vision model.

A PDF is the finished page, not the author's original structure. PDF to LaTeX rebuilds a practical starting point so you can quote a permitted source, recover your own lost draft, or move an old document back into an editable workflow.

## Use it when

- you own the document or have permission to reuse it;
- you need editable text, equations, and extracted figures;
- recreating the original typography exactly matters less than recovering the content.

Do not use conversion to remove access controls or to reuse copyrighted work without permission. If you only need notes, [PDF to Markdown](/docs/tools/pdf-to-markdown/) is usually easier to clean up.

## Convert the PDF

1. Open **PDF to LaTeX** from Oleafly Tools, run `/pdf-to-latex`, or choose a PDF from **Import**.
2. Select the PDF and start the conversion.
3. Review the detected pages, headings, columns, equations, and figures.
4. Create a project, then compile it beside the original PDF.

For a PDF with selectable text, Oleafly reads the text layer, rebuilds reading order, detects headings and likely math, and extracts figures into the project. For a likely scan, it switches to page-by-page transcription through a compatible Ollama vision model on your device.

## What conversion can and cannot recover

The result aims for editable meaning, not a pixel-for-pixel clone. PDF files often lose information about where a paragraph, equation, or table came from. Two columns, footnotes, unusual fonts, and positioned text can be ambiguous.

Check these first:

1. Reading order across columns and sidebars.
2. Equation symbols, numbering, and line breaks.
3. Figure placement, captions, and references.
4. Tables, especially merged cells and rules.
5. Citations and bibliography entries.

:::note[Scanned PDFs]
Scanned-page transcription needs Ollama with a vision-capable model and is limited to 50 pages. Selectable-text conversion runs locally without an AI model. General PDF input is limited to 128 MB.
:::

Keep the original PDF until you have compiled and compared the complete result. A clean first page does not guarantee that later pages, appendices, or references converted the same way.
