Back to Blog

The Four Kinds of AI LaTeX Help, and When Each One Fails

Shihab Shahriar AntorSeptember 2, 2026

There are four shapes of AI help for LaTeX, and most complaints about "AI being bad at LaTeX" are really about using the wrong one. They fail in different, predictable ways.

1. A chat window with your text pasted in

Good at: explaining an error message, drafting a block of LaTeX from scratch, answering a question about syntax.

Fails at: anything that depends on the rest of your document. It cannot see your preamble, so it hands you a \toprule without knowing whether booktabs is loaded, and the copy you pasted is stale the moment you keep working. Every edit comes back as text you merge by hand, which is where things get lost.

2. Autocomplete in the editor

Good at: finishing the line you were already writing. Environment names, reference keys, the closing half of a construct.

Fails at: anything you have to think about first. It cannot restructure, it cannot check whether the result builds, and on a bad day it confidently completes a citation key that does not exist, which compiles to a question mark you find later.

3. An agent inside the editor

Good at: the work spanning several files or several steps. Reformatting to a journal class, turning prose numbers into a table, splitting one file into chapters and fixing the paths, reading the log and repairing the first real error.

Fails at: knowing what is true. It will restructure your results section beautifully and has no idea whether the numbers are right. The guard is the review step: an edit that arrives as a diff you accept or reject is one you can refuse in a second, and the ones worth refusing are usually obvious the moment you see them side by side.

4. Your assistant, given a compiler

Good at: staying where you already work. If your day is in ChatGPT or Claude, a remote MCP server lets that assistant create the project, write the files, compile, and hand back a PDF, which removes the copy-paste loop entirely.

Fails at: being where the document is. You are working in a chat transcript, not in an editor with a PDF beside the source, so it suits generating and iterating more than it suits writing.

The one property worth checking

Whatever the shape: can it compile, and does it look at the result? That is the difference between a tool that has checked something and one that is confident. LaTeX is unusually well suited to this, because the answer is not a matter of taste. The build succeeded or it did not, the log says which, and a tool that ends its work with a real compile has done the one thing that makes its output trustworthy.

Ours is Lexi, in the editor, and the same tools are reachable from your own assistant over MCP. What you ask decides what you get back, which is covered in the prompts that actually change the document.

Frequently asked questions

What is the best AI tool for LaTeX?

It depends on which of four shapes you need. A chat window is fine for explaining an error. Autocomplete helps while typing. An in-editor agent that can read your project and compile is what you want for multi-file edits. A connector into your own assistant suits people who already work there. Each fails differently.

Why does ChatGPT give me LaTeX that does not compile?

Because in a plain chat it has no compiler and no sight of your preamble. It produces well-formed LaTeX for a document it cannot see, so the usual failure is a command whose package was never loaded. Giving it a real compiler, over MCP, removes that specific failure.

Can AI write a whole paper in LaTeX?

It can produce the structure, the boilerplate, tables from your numbers, and figure code, and it is genuinely good at all of those. It cannot know what is true about your experiment, and a request for citations without a lookup tool invites invented ones.

Is autocomplete or an agent better for LaTeX?

Different jobs. Autocomplete is faster for what you were already typing. An agent is for the work you would rather not do at all: reformatting to a journal class, building a table from prose, splitting a file into chapters.

Ready to try LetX?

Join researchers and students focusing on their work, not the tools.

Get Started Free

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