From 09ad8bcea5b5d85f5ac6185318bf7d1c2e9ca1cc 2014-04-22 05:02:53
From: James Goppert <james.goppert@gmail.com>
Date: 2014-04-22 05:02:53
Subject: [PATCH] Limit latex equations to page width.

---

diff --git a/IPython/nbconvert/templates/latex/base.tplx b/IPython/nbconvert/templates/latex/base.tplx
index 6b26557..3e0cf8f 100644
--- a/IPython/nbconvert/templates/latex/base.tplx
+++ b/IPython/nbconvert/templates/latex/base.tplx
@@ -157,11 +157,11 @@ This template does not define a docclass, the inheriting class must define this.
 
 % Display latex
 ((* block data_latex -*))
-    ((*- if output.latex.startswith('$'): -*)) 
+    ((*- if output.latex.startswith('$'): -*))
         ((= Replace $ symbols with more explicit, equation block. =))
-        \begin{equation*}
+        \begin{equation*}\adjustbox{max width=\textwidth}{$
         ((( output.latex | strip_dollars )))
-        \end{equation*}
+        $}\end{equation*}
     ((*- else -*))
         ((( output.latex )))
     ((*- endif *))