Decode the LaTeX errors you will meet most often (Missing $ inserted, Undefined control sequence, File not found, Runaway argument, Overfull hbox, and more) and fix them using Coauthor's Compilation Results panel.
Fixing Common LaTeX Errors
LaTeX error messages are terse and sometimes point a few lines away from the real problem, but the same dozen errors account for nearly all failed compiles. This page explains each one and how to fix it. For how the error panel itself works, see Compile Errors, Warnings, and Logs.
Reading an Error in Coauthor
- After a failed compile, click the red error count in the toolbar to open the Compilation Results panel.
- Each entry shows Error or Warning, Line N when known, and the message. Click the entry to jump to that line.
- Fix the first error, then compile again with Ctrl+S. Later errors are often side effects of the first one.
- If the panel shows No errors but the header is red, expand Full Compilation Log and read the last lines of the final pass.
If a message is unclear, select it in the panel and paste it into the AI coauthor thread together with the reported line; it can usually name the fix.
Missing $ inserted
Meaning: Something that only works in math mode appeared in normal text, or a math expression was not closed.
Typical causes: an underscore in a file name or identifier (results_v2), a caret, a Greek letter outside $...$, or a $ that was opened but never closed so the rest of the paragraph is treated as math.
Fix: Escape the character (results\_v2), wrap the expression in $...$, or find the unmatched $. In the editor, typing $ inserts a pair so unmatched dollars are rare in new text; look at pasted text first. See Mathematics.
Undefined control sequence
Meaning: LaTeX met a \command it does not know. The log shows the line and the exact token after l.N.
Typical causes: a typo (\includegraphic), a command from a package that is not loaded (\citep without natbib, \toprule without booktabs, \cref without cleveref), a \chapter in article, a macro defined in a file that is not \input, or a literal backslash in text such as a Windows path.
Fix: Correct the spelling, add the \usepackage, or write \textbackslash. The autocomplete popup only offers real commands, so use it when unsure. See Packages and the Preamble.
File not found
Meaning: \includegraphics, \input, \usepackage, or \bibliography referred to a file the compiler could not find. Coauthor reports these as Error entries without a line number.
Typical causes: the file was never uploaded to the project folder, it is in a different folder, the name differs in case or extension (Figure1.PNG vs figure1.png), the path is not relative to the main file, or it is an unsupported format (EPS, SVG).
Fix: Compare the exact name in the workspace panel with the command. Move or import the file into the main file's folder (or a subfolder and use the relative path). Convert EPS/SVG to PDF or PNG. See Figures and Images and Multi-File Projects.
Runaway argument? / Paragraph ended before \command was complete
Meaning: An argument was opened with { and never closed, so LaTeX kept reading until a blank line.
Fix: Go to the reported line and count braces; the editor auto-closes {, so this usually comes from deleting one half of a pair. Remember that \section{...}, \caption{...}, and \textbf{...} cannot contain blank lines.
Extra }, or forgotten $ / Too many }'s
Meaning: A closing brace with no matching opener, or a math expression closed twice.
Fix: Delete the extra } or $. Use Ctrl+F to search for } near the reported line if the error is in dense math.
\begin{x} ended by \end{y} / \begin{document} ended by \end{...}
Meaning: Environments are not nested correctly, or a section file contains its own \end{document}.
Fix: Match every \begin with the corresponding \end in reverse order. When you type \begin{name} the editor inserts the \end{name}, so mismatches typically come from copy-paste. In multi-file projects remove \end{document} from fragments.
LaTeX Error: Environment X undefined
Meaning: \begin{align}, \begin{theorem}, \begin{subfigure}, etc., without the package or \newtheorem that defines it.
Fix: Add amsmath, amsthm plus a \newtheorem line, or subcaption to the preamble.
Misplaced alignment tab character &
Meaning: A bare & outside a table or alignment.
Fix: Write \& in text (Smith \& Jones). In tables, check that the row is inside \begin{tabular}. See Tables.
Citation 'x' undefined / Reference 'x' undefined
Meaning: Warnings, not errors: a \cite or \ref key has no matching entry or label. They print as [?] or ??.
Fix: Check the key spelling and case, confirm the .bib file is named in \bibliography, and make sure the labeled file is \input from the main file. Coauthor's latexmk compile already reruns passes, so a persistent ?? is a real mismatch. See Bibliographies and Citations and Cross-References and Labels.
Overfull \hbox (12.3pt too wide) / Underfull \hbox
Meaning: Warnings about a line that could not be broken nicely; the text sticks into the margin (overfull) or is stretched (underfull). The PDF is still produced.
Fix: Usually a long URL, a wide table or figure, or a long word LaTeX does not know how to hyphenate. Load microtype, wrap URLs in \url{}, reduce the width of the float, or add hyphenation hints (hy\-phen\-ation). In two-column venue templates, keep an eye on these before submission; many reviewers notice text in the margin.
Option clash for package X
Meaning: A package was loaded twice with different options, often because the class already loaded it.
Fix: Remove your \usepackage line or move the options into the package's setup command (\hypersetup{...}, \geometry{...}).
Emergency stop / *** (job aborted, no legal \end found)
Meaning: The compiler hit the end of the file while still expecting something, most often because \end{document} is missing or was commented out, or a previous error consumed the rest of the file.
Fix: Make sure the main file ends with \end{document} and fix any earlier error.
Coauthor-Specific Situations
| What you see | Cause | Fix |
|---|---|---|
| No main file set in the toolbar and Compile disabled | The folder has no .tex marked as main | Open the file's menu in the workspace panel and choose Set as main. See LaTeX Main Files |
| Move LaTeX Project To A Folder dialog | The file is at the workspace root | Move the file and its supporting files into a folder |
| Auto failed in the toolbar | The last background compile failed | Click the red error count to see why; the PDF pane keeps the last good PDF |
| Orange timed out pass card | The compile exceeded its time limit | Look for an infinite loop in a macro, an enormous TikZ drawing, or huge images |
-shell-escape needed (for minted, epstopdf, external TikZ) | Shell escape is disabled for security | Use listings instead of minted, upload PDF/PNG instead of EPS, keep TikZ inline |
Still Stuck?
Copy the message and the surrounding lines from Full Compilation Log, paste them into the AI coauthor thread, and ask what is wrong. Because the AI can read your project files, it can often point at the exact brace or missing package.
Related articles
Prefer to ask?
Inside Coauthor, ask the AI coauthor how any feature works — it answers from these same help articles. For anything else, use the ? button in the top-right corner of the app.