Skip to main content
Underfull \hbox (badness 10000) in paragraph at lines ... is a line-breaking warning, not a compile error: your PDF still builds, and TeX is reporting that it had to stretch interword spaces past its maximum badness ceiling (10000) to fill a line. The usual culprits are \\ at the end of a paragraph or before a blank line, stacked \\ breaks used for vertical spacing, \linebreak on a short line, or a narrow column. For fatal errors that stop compilation (Missing $ inserted, Undefined control sequence, Runaway argument), see Common LaTeX errors.

Underfull \hbox (badness 10000)

When a line cannot reach the right margin without excessive stretching, TeX logs:
main.log
Badness runs from 0 (ideal spacing) to 10000 (the ceiling). Seeing 10000 means the stretch hit TeX’s maximum scale, not that the document is broken.

Common causes and fixes

  • \\ at the end of a paragraph, before a blank line, or before a heading (\section): \\ starts a new line inside the same paragraph, leaving an empty trailing line with nothing to fill it. Remove the trailing \\ and separate paragraphs with a blank line instead. (A \\ between two non-empty lines inside a paragraph does not trigger this warning, though blank lines are still the right way to end paragraphs.)
  • Stacking \\ or \\[1em] to create vertical space: writing \\ followed by \\ (or \\[1em] before a blank line) creates an empty underfull line. Use a blank line with \vspace{...} or load the parskip package instead.
  • \linebreak on a short line: unlike \\ or \newline, \linebreak forces the line before the break to stretch across the full text width. Replace \linebreak with a blank line or \\ if you do not want full justification on that line.
  • Very narrow columns (minipage, p{...} table cells, twocolumn): long words leave few break points in justified text. Load ragged2e and use \RaggedRight inside the narrow block so TeX keeps hyphenation without forcing full justification.
The compiled example below fixes three of these spacing patterns with zero warnings:
fixed-underfull.tex
Ready to use this syntax? Continue in the browser editor when you want to adapt the example in a real project.Open LaTeX Cloud Studio

Overfull \hbox (...pt too wide)

When TeX cannot find a line break before the right margin, text extends past the text block and TeX prints the overhang in points:
main.log
An overhang of 1–2 pt is often barely visible; larger values visibly protrude into the margin. Compiling with \documentclass[draft]{article} draws a black rule in the margin beside every overfull line so you can spot them in the PDF.

How to fix it

  1. Rephrase the line if the problem is an ordinary sentence with an awkward word break.
  2. Load \usepackage{microtype} to allow subtle character protrusion and font expansion across the document.
  3. Allow breaks in URLs and long identifiers: wrap URLs in \url{...} (from url or hyperref), insert discretionary hyphens (\-) in compound words, or add \allowbreak after punctuation in code-like tokens.
  4. Scope \sloppy to one paragraph using \begin{sloppypar}...\end{sloppypar} when a single paragraph contains unbreakable tokens. Avoid putting \sloppy globally in the preamble unless you accept looser spacing everywhere; for a gentler document-wide fallback, add \setlength{\emergencystretch}{2em}.
For wide tables or long equations that overflow the margin, see Advanced tables and Align and multline environments.
fixed-overfull.tex

Underfull \vbox (badness 10000)

main.log
Underfull \vbox is the vertical counterpart to Underfull \hbox: a tall unbreakable block (such as a large minipage, heading, or float) was pushed to the next page, leaving vertical space that TeX stretched to reach the bottom margin. It appears most often in classes that enable \flushbottom by default (such as book and twoside layouts). If the page looks fine, you can ignore it; otherwise add \raggedbottom in the preamble or relax float placement as described in Float and placement issues.

Undefined references and Label(s) may have changed

main.log
LaTeX writes \label values to the .aux file on one pass and reads them back on the next. On a first compile, references print as ?? and LaTeX asks you to rerun. In LaTeX Cloud Studio, a full compile runs latexmk, so the extra passes needed for cross-references run in one compile. If There were undefined references. stays after rerunning, check that the key in \ref{...} matches a \label{...} exactly, and make sure \label comes after \caption inside figure and table environments.

There were multiply-defined labels

main.log
Two or more \label commands share the same key. References to that key resolve to the last definition, which is rarely what you want. Give each section, figure, table, and equation a unique key (for example sec:intro, fig:setup, tab:results) and compile again.

Font shape ... undefined

main.log
The current font family does not include the requested weight and shape combination (here bold small caps in default OT1 Computer Modern), so LaTeX substitutes a fallback shape. Loading \usepackage[T1]{fontenc} switches to the EC/T1 fonts, which include bold small caps; if another font family lacks a shape, pick a family that provides it or avoid combining those styles.

`h' float specifier changed to `ht'

main.log
A figure or table requested [h] (“here” only), could not fit in the remaining space on the page, and LaTeX widened the placement specifier to [ht] so the float could move to the top of a following page. Write [htbp] instead of [h] unless you have a specific placement reason; see Float and placement issues.

Citation ... undefined

main.log
LaTeX found \cite{knuth1984} without a matching formatted entry in the .bbl file. Check that the citation key matches your .bib entry (spelling and case), and ensure the bibliography tool (bibtex or biber) ran before the final LaTeX passes. See Fix bibliography build errors.

Try it in the editor

Start from the Basic Article template in LaTeX Cloud Studio and replace main.tex with the complete example to verify clean compiles on TeX Live 2026.