Math & ScienceBad box (overfull \hbox)

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

Bad box (overfull \hbox)

Post by Singularity »

Why might this equation be generating an "Overfull \hbox (4.4pt too wide)" message? It's definitely not too

Code: Select all

\begin{equation}
	\mathbf{v}_j(n) = \sin \left( \frac{j \pi n}{N+1} \right) \qquad (n = 1 \ldots N)
\label{eq:evec1Dsystem}
,\end{equation}
I tried to make an MWE, but then the error went away!
Last edited by cgnieder on Fri Aug 16, 2013 5:21 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Bad box (overfull \hbox)

Post by Johannes_B »

Are you sure the warning comes from that equation? Are you using the geometry-package to change your page margins?


I made the margins very big in the following example, the global option draft marks overfull boxes with a black bar. The package showframe simply draws the borders of the type area. That is just for visualisation.

Best regards
Johannes

Code: Select all

\documentclass[a4paper,draft]{article}
\usepackage[margin=3in]{geometry}
\usepackage{showframe}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}

\begin{document}
\begin{equation}
\mathbf{v}_j(n) = \sin \left( \frac{j \pi n}{N+1} \right) \qquad (n = 1 \ldots N)
\label{eq:evec1Dsystem}
\end{equation}
\end{document}
You can click on open in writelatex just above the code to see the output.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

Bad box (overfull \hbox)

Post by Singularity »

That's the equation that latex reports as too wide. But using your "draft" and "showframe" tips, it seems that the problem might be caused by text following the equation. I added the surrounding text and was able to create an MWE:

Code: Select all

\documentclass[fleqn,reqno]{article}
\usepackage{amsmath,graphicx,amssymb,amsthm}
\usepackage{bm}				% Use to highlight matrices: \bm{matrix}

\begin{document}

The eigenvectors, $\mathbf{v}_j$ for $j=1 \ldots N$, of $\bm{K}$ for the fixed boundary system's $\bm{K}$ are found as follows
\begin{equation}
	\mathbf{v}_j(n) = \sin \left( \frac{j \pi n}{N+1} \right)
\label{eq:evecs}
,\end{equation}
which are equally spaced intervals halfway around the unit circle. (MY BIGGEST REMAINING QUESTION: HOW DID WE GET THIS?) The matrix $\bm{V} = \begin{pmatrix} \mathbf{v}_1 & \mathbf{v}_2 & \ldots & \mathbf{v}_N \end{pmatrix}$ is symmetric.

\end{document}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Bad box (overfull \hbox)

Post by Johannes_B »

The microtype-package does some magic with your letters. Some are expanded, some are protruded by a very small amount. You won't notice. This makes all your justified text a bit more, well, justified. This is called margin kerning.

Best regards
Johannes

Code: Select all

\documentclass[fleqn,
%draft,%
reqno]{article}
\usepackage{showframe}
\usepackage{microtype}
\usepackage{amsmath,graphicx,amssymb,amsthm}
\usepackage{bm}                         % Use to highlight matrices: \bm{matrix}

\begin{document}

The eigenvectors, $\mathbf{v}_j$ for $j=1 \ldots N$, of $\bm{K}$ for the fixed boundary system's $\bm{K}$ are found as follows
\begin{equation}
        \mathbf{v}_j(n) = \sin \left( \frac{j \pi n}{N+1} \right)
\label{eq:evecs}
,\end{equation}
which are equally spaced intervals halfway around the unit circle. (MY BIGGEST REMAINING QUESTION: HOW DID WE GET THIS?) The matrix $\bm{V} = \begin{pmatrix} \mathbf{v}_1 & \mathbf{v}_2 & \ldots & \mathbf{v}_N \end{pmatrix}$ is symmetric.

\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Bad box (overfull \hbox)

Post by cgnieder »

Here is a post that explains the background of overfull boxes: http://www.latex-community.org/forum/vi ... 45&t=23050

Regards
site moderator & package author
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

Bad box (overfull \hbox)

Post by Singularity »

cgnieder wrote:Here is a post that explains the background of overfull boxes: http://www.latex-community.org/forum/vi ... 45&t=23050

Regards
Thanks Clemens. Will read about it (eventually). For now, loading microtype solved the issue.
Post Reply