# What is the best way to avoid overful hbox in this situation?(mathematics)

I am writing some mathematical symbols which gives me an overful hbox, please see the picture.

The code is

\documentclass[a4paper,draft]{memoir}
\RequirePackage{amsthm}
\usepackage{amssymb}
\usepackage{amsmath}
\newtheorem{Co}{Corollary}
\numberwithin{Co}{section}

\begin{document}
\chapter{first chapter}
\section{first section}
\begin{Co}
Let $\{P_n\}$ be a collection of probability measures on $(C[0,\infty),\mathcal{C})$.
Such that etc.etc.
\end{Co}
\end{document}


What would be a good way to fix this? One idea I have is using "align" but it seems overkill to get the mathematical symbol on a new line in the middle of the page. Are there any good ways to write this to not get an overful hbox?

• Welcome to TeX.SX! Related informations: What does “overfull hbox” mean? – Bobyandbob Aug 29 '17 at 11:45
• Welcome to TeX SX! The simplest is probably to modify the phrasing, so the formula goes ‘on its own’ to next line. – Bernard Aug 29 '17 at 11:46
• Write Let the set $\{P_n\}$ ... instead. – Henri Menke Aug 29 '17 at 11:50

This shows the problem, plus 3 ways to deal with it:

1. Specify a breakpoint manually within the long math expression, $(C[0,\infty),\allowbreak\mathcal{C})$

2. Invoke \sloppy within the corollary.

3. Reword the corollary, as suggested by Bernard and Henri, to avoid the problem to begin with.

The MWE:

\documentclass[a4paper,draft]{memoir}
\RequirePackage{amsthm}
\usepackage{amssymb}
\usepackage{amsmath}
\newtheorem{Co}{Corollary}
\numberwithin{Co}{section}
\usepackage{lipsum}
\begin{document}
\chapter{first chapter}
\section{first section}
\lipsum[1]
\begin{Co}
Let $\{P_n\}$ be a collection of probability measures on
$(C[0,\infty),\mathcal{C})$.  Such that etc.etc.
\end{Co}
\begin{Co}
Let $\{P_n\}$ be a collection of probability measures on
$(C[0,\infty),\allowbreak\mathcal{C})$.  Such that etc.etc.
\end{Co}
\begin{Co}
\sloppy
Let $\{P_n\}$ be a collection of probability measures on
$(C[0,\infty),\mathcal{C})$.  Such that etc.etc.
\end{Co}
\begin{Co}
Let the set $\{P_n\}$ be a collection of probability measures on
$(C[0,\infty),\mathcal{C})$.  Such that etc.etc.
\end{Co}

\end{document}


Since you say that, "any good ways to write this to not get an overful hbox", I presume that you are more concerned about the irritating messages, and will not mind a bit overfull horizontal material so long as the looks are not destroyed.

Here is one technique I employ more than often.

\documentclass[a4paper,draft]{memoir}
\RequirePackage{amsthm}
\usepackage{amssymb}
\usepackage{amsmath}
\newtheorem{Co}{Corollary}
\numberwithin{Co}{section}

\begin{document}
\chapter{first chapter}
\section{first section}
\begin{Co}
\hfuzz\maxdimen
Let $\{P_n\}$ be a collection of probability measures on
$(C[0,\infty),\mathcal{C})$.  Such that etc.etc.
\end{Co}
\end{document}


\hfuzz=[length] is a parameter that allows hbox's to be overfull by [length] before an overfull error occurs. When we set this to \maxdimen, an overfull hbox never occurs.

\maxdimen is the largest dimension, but not the largest number.

• The problem with this approach is that the margin overrun is not in the "epsilon" noise, but very visibly noticeable. Add a \usepackage{lipsum} to the preamble and \lipsum[1] after the corollary to see this. – Steven B. Segletes Aug 29 '17 at 12:13
• @StevenB.Segletes Yes, I am very much aware of this issue. But as I said, when we don't mind a bit of overshoot at the right, we can use this technique. – Masroor Aug 29 '17 at 12:19
• @StevenB.Segletes Moreover, whenever I employ this trick, I never make it global. I always make it a point to keep it scoped. – Masroor Aug 29 '17 at 13:38