Troubleshooting

Grok math or LaTeX not exporting right? Here's the fix

Your formulas come out doubled, show up as raw \frac{}{} code, or look broken in the PDF. Here's why it happens — and the clean way to make math render exactly once.

Updated 14 Jun 20265 min readFree
Quick answer

Grok writes each formula twice — a visible version and a hidden one for screen readers. When you print to PDF without the math stylesheet, the hidden copy stops hiding, so formulas double up or turn into raw symbols. The fix is a tool that strips the duplicate and includes the styling so math renders once: install the free Grok to PDF extension, open your chat, click Export → PDF.

You asked Grok for a derivation, it gave you a page of clean equations, and then you tried to save it. The PDF came out wrong. Maybe every formula appears twice. Maybe they show as raw \frac{a}{b} text. Maybe the symbols are tiny, oversized, or just wrong. This is one of the most common Grok export problems, and it has a single root cause — and a quick fix.

This guide explains what's going wrong, why, and how to get math that renders cleanly the first time.

The symptoms you're seeing

If your exported or printed Grok math looks off, it usually shows up as one of these:

  • Every formula appears twice — once looking right, once as a jumble of stacked symbols right below it.
  • Raw LaTeX text — you see \frac{}{}, \sqrt, \sum or \begin{matrix} as plain code instead of a rendered equation.
  • Missing or odd characters — Greek letters, integral signs or operators come through as boxes, question marks or unfamiliar glyphs.
  • Tiny or oversized math — formulas that are microscopic next to the body text, or blown up far too large.
  • Broken matrices and multi-line equations — brackets, alignment and rows fall apart so the structure is unreadable.

Why it happens

Grok renders math with KaTeX, the same fast math typesetting library many sites use. Here's the part that matters: for every single formula, KaTeX outputs two copies into the page.

  • A visible HTML version (.katex-html) — the nicely typeset equation you see on screen.
  • A hidden MathML version (.katex-mathml) — a copy for screen readers and accessibility tools, normally invisible.

That hidden copy only stays hidden because the KaTeX stylesheet tells it to. When you use the browser's "Print to PDF" or copy-paste the content without that stylesheet, the rule that hides the MathML is gone. So both versions print — and that's why each formula shows up twice, the second one as a column of raw symbols.

The same missing stylesheet causes the other symptoms. With no KaTeX CSS to lay out the equation, the browser falls back to dumping the source — that's your raw \frac{}{} text — or it renders glyphs at the wrong size, breaking matrices and inline symbols along the way. It isn't Grok producing bad math. It's the export losing the styling that makes the math look right.

The fix: export math that renders once

The reliable fix is to export with a tool that does two things at once: strips the duplicate MathML so nothing prints twice, and includes the KaTeX styling so the visible formula lays out correctly. That's exactly what the free Grok to PDF extension does.

  1. Install the extension Add Grok to PDF from the Chrome Web Store. It's free, needs no account, and works in Chrome and Chromium browsers like Edge and Brave.
  2. Open the chat with the math Go to grok.com and open the conversation whose equations you want to keep.
  3. Click Export, then PDF The Export button sits at the top-right of the conversation. Click it and choose PDF.
  4. Save and open it Click Export. The PDF builds in your browser and downloads in a second or two — with every formula typeset once.

A quick check that it worked

Open the finished PDF and scroll to any equation. You're looking for three things: each formula appears exactly once, the symbols are crisp and correctly sized next to the body text, and matrices and multi-line equations keep their brackets and alignment. If a derivation reads like it would in a textbook — not like a wall of \frac and stray symbols — the math came through clean.

Note

Trying to fix this by hand is fiddly and limited. You'd have to capture the page with the KaTeX stylesheet attached, then strip out every hidden MathML node before printing — and it still tends to clip wide equations at page edges. A tool that handles both steps in one pass is far less work and far more reliable.

Markdown is different — that's not a bug

One thing to expect: if you export to Markdown instead of PDF, the math comes through as LaTeX source — for example $$\frac{a}{b}$$ rather than a rendered image. That's by design, not a fault. Markdown is a plain-text format, so keeping the LaTeX means your equations stay editable and portable, and they'll render anywhere that supports math Markdown. If you want the finished, typeset look, export to PDF or Word instead.

Is it private?

Yes. Grok to PDF runs entirely in your browser. There's no backend to send your conversation to and no account to create — the extension reads the page you're already looking at, builds the file on your own machine, and hands it to you. Nothing is uploaded.

FAQ

Why does my Grok formula appear twice in the PDF?

KaTeX writes two copies of every formula — a visible HTML one and a hidden MathML one for screen readers. Without the KaTeX stylesheet, the hidden copy stops hiding and both print. Grok to PDF strips the duplicate and includes the styling, so each formula renders once.

Why does math export as raw LaTeX code?

With the KaTeX stylesheet missing, the browser can't lay out the equation and falls back to the source — so you see \frac{}{} as plain text. Exporting with the styling included fixes it. In Markdown exports, LaTeX source is kept on purpose so the math stays editable.

Does it handle big equations and matrices?

Yes. Multi-line equations, matrices, integrals and inline symbols all render once and cleanly, because the export carries the KaTeX styling and drops the duplicate MathML that breaks browser printing.

Get Grok math that renders once, cleanly

Free Chrome extension. PDF, Word & Markdown. Runs locally — nothing uploaded.