Sarmate.net Sarmate.net
Home Features Pricing Documentation Contact
Log in Sign up

There's no line here to end: what this LaTeX error means

This message means: you used \\ (line break) where there is no line to end — often to create space between paragraphs. In LaTeX, you do that differently.

The classic: a \\ on an empty line to separate paragraphs. In LaTeX, you separate paragraphs with a real blank line, not with \\.

This code fails:

LaTeX
\documentclass{article}
\begin{document}
\\   % nothing to end -> There's no line here to end
First paragraph.
\end{document}

For two paragraphs, a blank line is enough:

LaTeX
\documentclass{article}
\begin{document}
First paragraph.

Second paragraph.
\end{document}
The reflex Want vertical space? Use \vspace{1em} or \medskip, not \\.

Try it yourself

This example compiles. Add a \\ alone on its line right after \begin{document} and recompile to see the error.

The method

  1. Go to the reported line: there is a \\ with no text line before it.
  2. Were you separating paragraphs? Replace the \\ with a blank line.
  3. Want vertical space? Use \vspace, \medskip or \bigskip.
  4. In a table or tabular: the last \\ of the last row is often unnecessary — remove it.
sarmate.net tip Our online editor reads the compilation log and tells you the likely cause in plain words, so you unblock without guessing.

An AI can fix the error — directly in your code

AI assistants (Claude, Gemini, ChatGPT…) know LaTeX very well: describe the message and they spot the extra \\ and the right fix. The usual drawback is the back-and-forth — copy, paste, repeat.

sarmate.net removes this round-trip with its MCP server: you connect the AI directly to your online editor. It reads your files, compiles them, analyzes the error log and fixes the code in place, with no copy-paste. You stay in control: nothing is changed without your approval.

Write and compile LaTeX online

Full editor, instant compilation (pdfLaTeX/XeLaTeX/LuaLaTeX), nothing to install.

Open the online editor