
I am writing a document that involves several lengthy mathematical expressions, tables that have to be adjacent, and large algorithms. The documentclass in use is 'book'. Despite the many attempts to alter the margins using the the 'geometry' package, I am unable to arrive at a universal solution for the entire document. Either I find a scattered text with unfavorable white-spaces, an equation protruding outside a paragraph, or an improperly positioned table(s)/figure(s)/algorithm. I have already tried commands like
\newgeometry{margin = 2cm}
% Some text/figure goes here
\restoregeometry
Here is a minimum working example:
\documentclass[11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage[table]{xcolor} % Modern color package (used for text and tables)
\begin{document}
\chapter{Introduction}
\lipsum
\begin{table}[H]
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
1 & 2 & 3 & 4 & 5 & 6 \\
\hline
7 & 8 & 9 & 10 & 11 & 12 \\
\hline
13 & 14 & 15 & 16 & 17 & 18 \\
\hline
19 & 20 & 21 & 22 & 23 & \cellcolor{green!25}24 \\
\hline
25 & 26 & 27 & 28 & 29 & 30 \\
\hline
31 & 32 & 33 & 34 & 35 & 36\\
\hline
\end{tabular}
$\Longrightarrow$
\begin{tabular}{|c|c|c|c|c|c|}
\hline
1 & 2 & 3 & $2 \cdot 2$ & 5 & $2 \cdot 3$ \\
\hline
7 & $2 \cdot 2 \cdot 2$ & $3 \cdot 3$ & $2 \cdot 5$ & 11 & $2 \cdot 2 \cdot 3$ \\
\hline
13 & $2 \cdot 7$ & $3 \cdot 5$ & $2 \cdot 2 \cdot 2 \cdot 2$ & 17 & $2 \cdot 3 \cdot 3$ \\
\hline
19 & $2 \cdot 2 \cdot 5$ & $3 \cdot 7$ & $2 \cdot 11$ & 23 & \cellcolor{green!25} $2 \cdot 2 \cdot 2 \cdot 3$ \\
\hline
25 & $2 \cdot 13$ & $3 \cdot 9$ & $2 \cdot 2 \cdot 7$ & 29 & $2 \cdot 3 \cdot 5$ \\
\hline
31 & $2 \cdot 2 \cdot 2 \cdot 4$ & $3 \cdot 11$ & $2 \cdot 17$ & 35 & $2 \cdot 2 \cdot 2 \cdot 3 \cdot 3$\\
\hline
\end{tabular} \par
\bigskip
\caption{Example of factoring using sieving by $p = 2$ three times, then by $p = 3$.\label{Table:FactoringBySieving}}
\end{center}
\end{table}
\section{Historical background}
\lipsum
\end{document}
Any suggestions?

[H]is not a standard float type although latex doesn't report an error it is silently ignored. If you meant to use theHtype from the float package, you need to load that package. Other than that I don't see anything wrong? – David Carlisle Dec 12 '13 at 16:50