Purplelink
← All LaTeX errors

Paragraph ended before \x was complete

TeX was reading a command's argument and reached a blank line before the closing brace.

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:

Related errors

Frequently asked questions

Which command is \x in my error message?
It is the macro that was collecting an argument when the blank line arrived. Often it is the command you typed, such as \label. Sometimes it is an internal helper with an @ in its name. In that case use the text printed under Runaway argument? to find the place.
Why can some commands contain blank lines and others cannot?
TeX macros are either short or long. Short ones, including everything made with \newcommand*, stop at a paragraph break so that a missing brace is reported close to where it happened. Long ones, such as \footnote, accept several paragraphs.
How do I put a paragraph break inside a command that does not allow one?
If the command is your own, define it with \newcommand in place of \newcommand*. For a built-in short command such as \label or \cite, a paragraph break has no meaning there, so move the blank line to after the closing brace.