LaTeX forum ⇒ Math & ScienceBad box (overfull \hbox) Topic is solved

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

Bad box (overfull \hbox)

Postby Singularity » Fri Aug 16, 2013 6:05 am

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

  1. \begin{equation}
  2. \mathbf{v}_j(n) = \sin \left( \frac{j \pi n}{N+1} \right) \qquad (n = 1 \ldots N)
  3. \label{eq:evec1Dsystem}
  4. ,\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.
Reason: code markup

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3763
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Aug 16, 2013 7:35 am

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

  1. \documentclass[a4paper,draft]{article}
  2. \usepackage[margin=3in]{geometry}
  3. \usepackage{showframe}
  4. \usepackage[english]{babel}
  5. \usepackage[utf8x]{inputenc}
  6. \usepackage{amsmath}
  7.  
  8. \begin{document}
  9. \begin{equation}
  10. \mathbf{v}_j(n) = \sin \left( \frac{j \pi n}{N+1} \right) \qquad (n = 1 \ldots N)
  11. \label{eq:evec1Dsystem}
  12. \end{equation}
  13. \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: 152
Joined: Sat Jan 22, 2011 9:55 pm

Postby Singularity » Fri Aug 16, 2013 8:35 am

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:

  1. \documentclass[fleqn,reqno]{article}
  2. \usepackage{amsmath,graphicx,amssymb,amsthm}
  3. \usepackage{bm} % Use to highlight matrices: \bm{matrix}
  4.  
  5. \begin{document}
  6.  
  7. 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
  8. \begin{equation}
  9. \mathbf{v}_j(n) = \sin \left( \frac{j \pi n}{N+1} \right)
  10. \label{eq:evecs}
  11. ,\end{equation}
  12. 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.
  13.  
  14. \end{document}

User avatar
Johannes_B
Site Moderator
Posts: 3763
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Aug 16, 2013 9:41 am

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

  1. \documentclass[fleqn,
  2. %draft,%
  3. reqno]{article}
  4. \usepackage{showframe}
  5. \usepackage{microtype}
  6. \usepackage{amsmath,graphicx,amssymb,amsthm}
  7. \usepackage{bm} % Use to highlight matrices: \bm{matrix}
  8.  
  9. \begin{document}
  10.  
  11. 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
  12. \begin{equation}
  13. \mathbf{v}_j(n) = \sin \left( \frac{j \pi n}{N+1} \right)
  14. \label{eq:evecs}
  15. ,\end{equation}
  16. 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.
  17.  
  18. \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: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Fri Aug 16, 2013 5:24 pm

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

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

Singularity
Posts: 152
Joined: Sat Jan 22, 2011 9:55 pm

Postby Singularity » Fri Aug 16, 2013 7:05 pm

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

Regards

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


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 4 guests