Writing LaTeX on macOS: Can You Just Use Xcode?


Short answer: you can open a .tex file in Xcode. You can also eat soup with a fork. Nobody’s stopping you.

I understand the impulse, though. If you’re a Mac developer who suddenly needs to write a paper — or an academic who happens to live in Xcode — the question is natural. You already have a professional editor installed. It has syntax highlighting, a file navigator, and find-and-replace that works. Why install anything else?

Here’s what happens when you try.

What Xcode gives you

Xcode will treat your .tex file as plain text. You get the editor surface — which, to be fair, is excellent. Native text engine, flawless IME handling for Korean, Japanese, and Chinese, buttery scrolling, every macOS keyboard convention you already know. The bones are good, because the bones are AppKit.

What Xcode doesn’t give you

Everything else.

There’s no LaTeX syntax highlighting — your \section commands sit there in monochrome. No build integration: you’ll be alt-tabbing to Terminal to run xelatex, then to Preview to see the PDF, then back to Xcode to find your place again. No SyncTeX, so “where does this paragraph appear in the PDF?” is a question you answer by scrolling. No document outline, no autocompletion for the four hundred LaTeX commands you half-remember, no error list that jumps to the offending line.

You can bolt some of this together with Run Script build phases and external tools. People have — there are decade-old Stack Exchange threads with heroic Xcode-LaTeX configurations, and they all read like instructions for teaching a horse to drive.

The instinct is right, though

Wanting to write LaTeX in a real native Mac app — with the system text engine, real IME support, and keyboard shortcuts that match every other app you use — is exactly the right instinct. Xcode just isn’t the app.

That’s roughly why I built texspark. I wanted the part of Xcode that’s good (the native editor feel) attached to the parts LaTeX actually needs: one-keystroke builds with any engine, SyncTeX in both directions, an outline that follows \include chains, autocompletion that knows the difference between \ref{ and \begin{, and an error list where clicking a row lands you on the line that broke. Plus an AI panel, because it’s 2026 and half my debugging is asking Claude why my table is off the page.

One-time license, 14-day full trial, and it weighs a lot less than Xcode.

If you still want to use Xcode

Genuinely, no judgment — here’s the minimal setup: install MacTeX, add a Run Script build phase calling xelatex -interaction=nonstopmode "$FILE", and keep Preview open next to it. It works. For a two-page document, it’s fine.

For a thesis, come back to this post. I’ll be here.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *