DEV Community

TeX64
TeX64

Posted on

I Used to Retype Every Equation from Old PDFs. Here's How I Stopped.

There's a particular kind of pain that only LaTeX writers know: you're working on a new paper, you need an equation from an old PDF — your own thesis from three years ago, a colleague's preprint, a textbook chapter — and the .tex source file is gone. Just the PDF.

So you open both windows side by side and start retyping.

\mathbb{E}_{q_\phi(z|x)}\left[\log p_\theta(x|z)\right] - D_{\mathrm{KL}}\left(q_\phi(z|x) \| p(z)\right)

Symbol by symbol, subscript by subscript. You compile. Something's off. You scan back through. Missed a closing brace on line 3. Fix it. Recompile. Now the spacing is wrong because you typed \mathbb{E} where it should have been \mathcal{L}. Another fix.

Twenty minutes for one equation. You have eleven more to go.


The "obvious" solution and why it's still annoying

Most people who've been through this enough times have landed on Mathpix. It's genuinely excellent at what it does — take a screenshot of an equation, get back LaTeX. The accuracy on printed math is remarkable.

But here's what the Mathpix workflow actually looks like in practice:

  1. Switch to Mathpix
  2. Trigger the screenshot tool
  3. Drag over the equation
  4. Wait for conversion
  5. Copy the result
  6. Switch back to your LaTeX editor
  7. Paste it in the right place
  8. Switch to Mathpix for the next one
  9. Repeat

That's eight steps per equation. If you have thirty equations to extract from an old paper, you'll execute that loop two hundred and forty times. The individual steps are tiny, but the context switching is real — every time you jump between apps, you lose a tiny bit of momentum. After an hour of it, you feel vaguely exhausted without having written a single original sentence.

There are also open-source alternatives like pix2tex (LaTeX-OCR) and texify, which are free and run locally. But they all share the same fundamental problem: they exist outside your editor.


What "OCR inside the editor" actually means

I came across TeX64 — a local-first LaTeX editor for macOS — while looking for something to replace my aging TeXShop setup. The OCR feature wasn't even what I was initially interested in, but it's what I kept coming back to.

Here's what TeX64's OCR actually does differently: instead of being a separate application you invoke and paste from, it's integrated directly into the editor. You trigger it with a keyboard shortcut, drag over any equation anywhere on your screen (a PDF in Preview, a browser page, a screenshot you have open), and the converted LaTeX code appears at your cursor position.

No app switch. No clipboard. No paste.

The first time I used it, I spent a genuinely embarrassing moment looking around to see if something had gone wrong because it felt too fast and too simple to have actually worked.


Practical walkthrough

Say I'm writing a new paper and I need to reuse the GMM likelihood derivation from my master's thesis (only have the PDF).

With TeX64, the process is:

  1. Open the PDF in a separate window (Preview, or TeX64's built-in PDF viewer — whichever you prefer)
  2. Position your cursor in the .tex file where you want the equation
  3. Hit the OCR shortcut
  4. Drag over the equation in the PDF
  5. The LaTeX code appears at your cursor

No step 3 that's "switch apps." No step 5 that's "paste." The editor is already focused; the code goes directly in.

For a moderately complex equation like this one:

\log p(\mathbf{x}) = \log \sum_{k=1}^{K} \pi_k \mathcal{N}(\mathbf{x} \mid \boldsymbol{\mu}_k, \boldsymbol{\Sigma}_k)
Enter fullscreen mode Exit fullscreen mode

TeX64 gets it right on the first try about 90% of the time in my experience. When it doesn't (usually a subscript issue or a missing brace), there's another feature that saves the day.


When OCR makes a small mistake: Axiom to the rescue

TeX64 has a built-in AI assistant called Axiom that reads your compile logs and proposes fixes with actual diffs. When an OCR-extracted equation fails to compile, Axiom looks at the error message and typically identifies the specific issue in about two seconds.

The workflow becomes:

  • OCR extracts equation (90% chance it's perfect)
  • If compile error → Axiom reads the log, shows diff, one click to fix

Compared to staring at a compile log that says ! Missing } inserted somewhere in a 500-line file, this is a meaningful time save.


Honest limitations

macOS only. TeX64 is exclusively for Mac (Apple Silicon and Intel both work great). If your lab runs Windows or Linux, this isn't an option for you.

You still need MacTeX or TeX Live. TeX64 is an editor, not a full LaTeX distribution. You need a working TeX installation separately. The app will walk you through this if you don't have one, but plan for a 30-minute setup if you're starting fresh.

Free tier has limits on OCR volume. There's a free tier that's genuinely useful for getting started, but if you're extracting dozens of equations a day, you'll likely want one of the paid plans. It's reasonably priced compared to Mathpix, but it's not free for heavy use.

Not for real-time collaboration. If you need multiple people editing the same document simultaneously, Overleaf is still the right tool. TeX64 is local-first and built for individual work.


The bottom line

The equation-from-PDF problem isn't hard to solve, but most solutions involve adding a tool outside your editor and living with the friction. TeX64 solves it by putting OCR inside the editor, which turns out to make a bigger difference than you'd expect.

I've been using it for my PhD thesis for about eight months now. The OCR feature alone has probably saved me north of ten hours of retyping time, and that's a conservative estimate.

If you're on a Mac and write LaTeX regularly, it's worth spending twenty minutes with it. You can download it at tex64.com — the free tier is enough to get a real sense of whether the workflow works for you.

Top comments (0)