What it means
TeX was reading the argument of a command and hit a blank line, or a \par, before the closing brace. Many commands, among them \label, \cite, \date and everything defined with \newcommand*, refuse an argument that contains a paragraph break. That way a forgotten } is reported at the next blank line and not at the end of the file. The \x in the message is the macro that was reading, and the message always follows a Runaway argument? line.
The log line
This small file triggers the error:
\documentclass{article}
\begin{document}
\section{Methods}\label{sec:methods
We use two samples.
\end{document}
Compiled with pdfLaTeX (TeX Live 2026), it writes this to the .log file:
Runaway argument?
{sec:methods
! Paragraph ended before \label was complete.
<to be read again>
\par
l.4
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
The line under Runaway argument? shows what TeX had collected: {sec:methods, starting at the brace that was never closed. The ! line names the command, \label. l.4 is the blank line where TeX gave up, one line below the mistake on line 3.
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 before a blank line
The plain case: the brace was forgotten, and the next blank line stops the argument.
Before
\section{Methods}\label{sec:methods
We use two samples.
After
\section{Methods}\label{sec:methods}
We use two samples.
2. A blank line inside the braces
A list of keys or a long argument that was split over several lines with an empty line in between. The internal macro named in the log for this example is \@citex@checkblank.
Before
Earlier work \cite{smith2024,
jones2023} agrees.
After
Earlier work \cite{smith2024,
jones2023} agrees.
3. A % comment hides the closing brace
A note added at the end of the line swallowed the brace along with it.
Before
\section{Data}\label{sec:data % rename later}
The panel covers 2010 to 2024.
After
\section{Data}\label{sec:data} % rename later
The panel covers 2010 to 2024.
4. A command given fewer arguments than it takes
\setcounter takes two arguments. With only one, it reaches for the next thing in the file, finds the blank line, and stops.
Before
\setcounter{page}
The appendix starts here.
After
\setcounter{page}{1}
The appendix starts here.
5. Your own \newcommand* macro given two paragraphs
The star makes a macro short, meaning its arguments may not contain a paragraph break. If the argument really should hold several paragraphs, define the macro without the star.
Before
\newcommand*{\note}[1]{{\itshape #1}}
\note{Check the sample size.
Also check the dates.}
After
\newcommand{\note}[1]{{\itshape #1}}
\note{Check the sample size.
Also check the dates.}
How to find the line
The l. line points at the blank line where TeX stopped, so the mistake is above it. The text under Runaway argument? starts at the unclosed brace, so search the source for those words. When that text is empty, as it is for the \setcounter case, the command named in the ! line is missing an argument altogether.
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, so the same error starts with the file and line in place of the!:./main.tex:4: Paragraph ended before \label was complete.
Related errors
- Runaway argument: the first line of this message, and the form it takes at the end of a file.
- Too many }'s / Missing } inserted: the opposite imbalance.
- Citation `x' undefined: what
\citereports once the braces are right but the key is not.