What it means
TeX was collecting the argument of a command, the part between { and }, and reached a place where the argument could not continue: the end of the file, or a blank line for commands that do not accept paragraphs. Runaway argument? is the first of a pair of lines. The second, which begins with !, says what stopped it. In nearly every case a closing brace is missing.
The log line
This small file triggers the error:
\documentclass{article}
\begin{document}
\section{Related work
Prior studies report mixed results.
\end{document}
Compiled with pdfLaTeX (TeX Live 2026), it writes this to the .log file:
Runaway argument?
{Related work \par Prior studies report mixed results. \end {document\ETC.
! File ended while scanning use of \@xdblarg.
<inserted text>
\par
<*> main.tex
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.
The line under Runaway argument? shows what TeX had swallowed so far, starting at the opening brace: {Related work and then the rest of the file. That first brace is the one that was never closed. \ETC. means the display was cut short. The ! line names the macro that was reading. \@xdblarg is an internal helper behind \section, so the name does not always match what you typed. There is no l. line, because TeX reached the end of the file before it noticed anything wrong.
To try a fix without touching your project, save the example as a .tex file and compile it online with the LaTeX to PDF tool.
Why it happens
The causes below are in order of likelihood. Each has a before and an after you can compare with your own source.
1. A missing closing brace
The argument of \section, \footnote, \caption or a similar command was opened and never closed. TeX reads on to the end of the file.
Before
Wages rose\footnote{See Appendix B for the sample.
The effect persists.
After
Wages rose\footnote{See Appendix B for the sample.}
The effect persists.
2. A blank line inside a short argument
Commands such as \date, \label and \cite stop at the first blank line. The second log line then reads Paragraph ended before \date was complete, which has its own page.
Before
\date{October 2026
\maketitle
After
\date{October 2026}
\maketitle
3. A % comment hides the closing brace
Everything after % on a line is ignored, including a brace. A note added at the end of a line can remove the brace that closed the argument.
Before
The effect is \textbf{significant % check this}
in all samples.
After
The effect is \textbf{significant} % check this
in all samples.
4. A truncated .aux, .toc or .bbl file
When a build is interrupted, the auxiliary files can end in the middle of a line. On the next run TeX reads the broken file first and reports a runaway argument whose text you never typed, such as {{1}{1}. Delete the auxiliary files and compile twice.
Before
% main.aux ends in the middle of an entry:
\newlabel{sec:data}{{1}{1}
After (in a terminal)
rm main.aux main.toc main.out
pdflatex main.tex
5. An optional argument that is never closed
Square brackets are delimiters too. An \item[ without its ] makes TeX read on in search of the closing bracket.
Before
\begin{description}
\item[Sample size The number of firms.
After
\begin{description}
\item[Sample size] The number of firms.
How to find the line
Read the swallowed text, not the line number. Its first few words show where the argument began, so search the source for them. When the second line is File ended while scanning use of ..., there is no line number at all. When it is Paragraph ended before ... was complete, the l. line points at the blank line where TeX gave up, and the unclosed brace is above it.
When you run pdflatex in a terminal without -interaction=nonstopmode, TeX stops at the error and prints a ? prompt. Press Return to carry on past the error, type x to quit, or type h for TeX's own help text, which is the paragraph you see after the l. line in the log. Editors run TeX in non-stop mode, so you get the log and never see the prompt.
What each editor shows:
- ModernTex: when a build fails, the Build button shows the error count and the last good PDF stays on screen. The Build Results panel lists each error, warning and note in plain language, Compile › Next Issue steps through them, and Raw Log shows the full LaTeX log. See ModernTex.
- Overleaf: the logs panel, opened with the button next to Recompile, lists each error and warning with its file and line, and the editor marks the line in the gutter. The unprocessed log is at the bottom of that panel.
- TeXShop: the console window shows the log as it is written and stops at the error. Goto Error moves the source window to the line. TeXShop's default pdfLaTeX command includes
--file-line-error, but with no line to report, this message keeps its!form.
Related errors
- Paragraph ended before \x was complete: the second line of this message when a blank line stops the argument.
- Too many }'s / Missing } inserted: the opposite imbalance, an extra
}or a group left open. - Undefined control sequence: the other error that usually comes down to one mistyped character.