Documentation/Math & Equations/Fix: Equation Overlapping Page Number in LaTeX
Math & Equations

Fix: Equation Overlapping Page Number in LaTeX

A wide equation extending into the page number area is a common annoyance in LaTeX, especially in two-column layouts or documents with narrow margins. This happens because LaTeX's equation centering doesn't account for page number width. Here are reliable fixes for this issue. Bibby AI flags margin overflow warnings in real time, so you catch these overlaps before they sneak into your final PDF — something Overleaf only reveals after compilation.

Break the Equation Across Lines

The most common fix: if the equation is too wide, split it using multline or split so it fits within the text width:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

% Before: one long overlapping line
% \[ a + b + c + d + e + f + g + h + i + j + k + l = 0 \]

% After: split across lines
\begin{multline}
    a + b + c + d + e + f \\
    + g + h + i + j + k + l = 0
\end{multline}

\end{document}

Shrink the Equation or Adjust Spacing

For equations that are only slightly too wide, use \! to reduce spacing, \resizebox, or \small to shrink the content:

% Option 1: Reduce inter-element spacing with \!
\[
a \!+\! b \!+\! c \!+\! d \!+\! e \!+\! f \!+\! g = 0
\]

% Option 2: Scale the equation down slightly
\usepackage{graphicx}
\[
\resizebox{0.9\textwidth}{!}{$\displaystyle
    a + b + c + d + e + f + g + h + i + j = 0
$}
\]

% Option 3: Use a smaller font size
{\small
\[
    a + b + c + d + e + f + g + h + i + j + k = 0
\]}

Move the Page Number or Change Layout

If the overlap is systemic, adjust your page geometry or page number position:

% Option 1: Increase text width with geometry
\usepackage[margin=1in]{geometry}

% Option 2: Remove page numbers from a specific page
\thispagestyle{empty}

% Option 3: Move page number to the header
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot{}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}

💡 Tips

  • Always check the final PDF for overlaps — they're invisible in source code and easy to miss.
  • The multline approach is preferred by journals because it preserves readable, properly formatted math.
  • Avoid \resizebox for math if possible — it can make fonts inconsistent with the rest of the document.
  • Bibby AI's live preview catches margin overflows instantly, saving you from last-minute formatting surprises.

Try This in Bibby AI

Write LaTeX faster with AI auto-complete and instant compilation.

Start Writing Free

Related Tutorials

Fix: Equation Overlapping Page Number in LaTeX | Bibby AI