How to convert an image or screenshot into LaTeX

By Shihab Shahriar Antor · Updated August 2026 · 7 min read

Drop the image into an assistant that can read images and ask for LaTeX. A photographed equation becomes maths mode, a table becomes a booktabs table, a plot becomes TikZ or pgfplots. In letX that is /image-to-tex, and because it can compile, it checks the output builds instead of handing you source that looks right.

What converts well, and what does not

SourceHow it goesWhat to check
Typeset equation from a PDFReliableSubscript versus superscript, and similar-looking symbols
Typeset tableReliableMerged cells and alignment
Clean handwritingUsually worksAnything ambiguous by hand: 1 and l, x and times
Photo at an angle, poor lightUnreliableEverything. Retake it flat if you can
Chart or plotStructure, not dataIt reproduces the shape; it cannot recover exact values
Full page scanWorks, but crop firstGive it one thing at a time

The single biggest improvement you can make is cropping. A tight crop of one equation converts far better than a photograph of the page it sits on, because the model is no longer deciding what you meant to point at.

Equations

A display equation should come back as real maths, not an image reference:

Cross-entropy loss, recovered from a screenshot. Note the label: you can reference it immediately.
\begin{equation}
  \mathcal{L}(\theta) = -\frac{1}{N}\sum_{i=1}^{N}
    \left[ y_i \log \hat{y}_i + (1 - y_i)\log(1 - \hat{y}_i) \right]
  \label{eq:bce}
\end{equation}

Check subscripts against superscripts and any symbol with a lookalike. \nu and v, \epsilon and \in, a prime against an apostrophe. These are the errors that survive a read-through and change what the maths says.

Tables

Tables should come back as booktabs, which is what journals expect and what looks right in print. Vertical rules and double lines are the signature of a table converted by something that did not know the convention.

Three rules, no vertical lines. That is the house style of every journal class.
\begin{tabular}{lrr}
  \toprule
  Model & Accuracy & F1 \\
  \midrule
  Baseline & 0.812 & 0.79 \\
  Ours     & 0.947 & 0.93 \\
  \bottomrule
\end{tabular}

Why compiling matters here too

Converted LaTeX frequently uses a command that needs a package: \text needs amsmath, \toprule needs booktabs, \SI needs siunitx. Source that reads perfectly can still fail to build. An assistant that compiles catches that before you do, and adds the package rather than handing you an error to solve.

Drop a screenshot into a letX project and let it come back as LaTeX you can compile.

Try it

Frequently asked questions

How do I convert a photo of an equation to LaTeX?

Crop to just the equation, attach it to an assistant that can read images, and ask for LaTeX. In letX, use /image-to-tex in the Lexi panel. Then compile and compare the rendered output against the original, because symbol mistakes are the ones that survive a read-through.

Is image-to-LaTeX accurate?

For typeset equations and tables from a PDF or a clean screenshot it is reliable. Clean handwriting usually works. Angled photographs in poor light are unreliable. In every case the check that matters is compiling it and reading the rendered result, not reading the source.

Can it convert a chart into a LaTeX figure?

It can reproduce the structure as TikZ or pgfplots, and it cannot recover the underlying numbers from pixels. Treat the output as a starting skeleton you feed real data into, not as a transcription.

What is the difference from an OCR tool?

OCR gives you source and stops. An assistant inside the editor puts it in the right file, adds the packages the commands need, compiles, and fixes the build if it fails, which is usually where the remaining work was.

Related

Written by Shihab Shahriar Antor , AI Engineer & Founder of Shahriar Labs. Builder of LetX (collaborative LaTeX) and QuantumSketch (AI STEM video).