LaTeX error · Commands, braces and arguments

Runaway argument?

Quick answer

TeX started reading the argument of a command and could not find the closing } before a blank line (or the end of the file). It prints Runaway argument? followed by the start of the argument it was reading, then a second error such as Paragraph ended before \textbf was complete or File ended while scanning use of .... The text after Runaway argument? shows you where the argument starts: add its closing brace.

The error in the log

This is how the message appears in the .log file (and in the compile output). The line starting with l. is the line number where TeX noticed the problem; the real mistake is there or just before it.

Runaway argument?
{This text should be bold, but the brace never closes. \par Next para\ETC.
! File ended while scanning use of \textbf .
<inserted text> 
                \par 
<*> main.tex

Why it happens

  • A missing closing brace in \textbf{, \section{, \caption{, \footnote{ and similar commands.
  • A blank line inside an argument of a command that does not accept paragraphs, such as \author, \label or \cite. Then the follow-up error is Paragraph ended before ... was complete.
  • A missing } in a .bib field, which makes the bibliography run away (the message then appears while reading the .bbl file).

How to fix it

Use the text printed after Runaway argument?: it is the beginning of the unterminated argument. Find it in the source and add the } at the end of the intended text.

If the argument really needs several paragraphs, use an environment or a declaration instead, for example {\bfseries ...} or a \begin{quote}.

Broken: reproduces the error

\documentclass{article}

\begin{document}

\textbf{This text should be bold, but the brace never closes.

Next paragraph.

\end{document}

Try this in Octree — free LaTeX editor with AI, compiles in your browser

Fixed: compiles cleanly

\documentclass{article}

\begin{document}

\textbf{This text should be bold, and now the brace closes.}

Next paragraph.

\end{document}

Related errors

Frequently Asked Questions

What does File ended while scanning use of mean?

It is the same runaway argument, detected at the end of the file instead of at a blank line. The command named in the message is the one whose closing brace is missing.

Why does Runaway argument point to my bibliography?

An unbalanced brace in a .bib entry, such as title = {A {GPU} method,, is copied into the .bbl file. Check the entry printed after Runaway argument?, fix it in the .bib file, and delete the old .bbl before compiling again.

Is Runaway argument an error or a warning?

It is a diagnostic printed right before the real error. The error that follows it (Paragraph ended before ... or File ended while scanning ...) stops the compile in most editors.

Paste your document into Octree — compile errors get a Fix with AI button

When a compile fails, Octree shows the error next to the line that caused it and offers a one-click fix that you can review before applying. Free, nothing to install.

Fix it in Octree →