From 6b8a9d57a3644fb27c47dc5866c12d0ba70ee1ec 2013-07-27 17:39:21
From: damianavila <damianavila82@yahoo.com.ar>
Date: 2013-07-27 17:39:21
Subject: [PATCH] Redo of fixing templates structure.

---

diff --git a/IPython/nbconvert/templates/html_basic.tpl b/IPython/nbconvert/templates/html_basic.tpl
index e879c60..0de72d6 100644
--- a/IPython/nbconvert/templates/html_basic.tpl
+++ b/IPython/nbconvert/templates/html_basic.tpl
@@ -1,15 +1,15 @@
 {%- extends 'display_priority.tpl' -%}
 
 
-
 {% block codecell %}
 <div class="cell border-box-sizing code_cell vbox">
-{{ super() }}</div>
+{{ super() }}
+</div>
 {%- endblock codecell %}
 
 {% block input_group -%}
 <div class="input hbox">
-{{super()}}
+{{ super() }}
 </div>
 {% endblock input_group %}
 
@@ -22,7 +22,9 @@
 {% endblock output_group %}
 
 {% block in_prompt -%}
-<div class="prompt input_prompt">In&nbsp;[{{cell.prompt_number}}]:</div>
+<div class="prompt input_prompt">
+In&nbsp;[{{ cell.prompt_number }}]:
+</div>
 {%- endblock in_prompt %}
 
 {# 
@@ -34,32 +36,32 @@
 
 {% block input %}
 <div class="input_area box-flex1">
-{{cell.input | highlight2html }}
+{{ cell.input | highlight2html }}
 </div>
 {%- endblock input %}
 
 {% block output %}
 <div class="hbox output_area">
 {%- if output.output_type == 'pyout' -%}
-<div class="prompt output_prompt">
-Out[{{cell.prompt_number}}]:
+    <div class="prompt output_prompt">
+    Out[{{ cell.prompt_number }}]:
 {%- else -%}
-<div class="prompt">
+    <div class="prompt">
 {%- endif -%}
-</div>
+    </div>
 {{ super() }}
 </div>
 {% endblock output %}
 
 {% block markdowncell scoped %}
 <div class="text_cell_render border-box-sizing rendered_html">
-{{ cell.source | strip_math_space | markdown2html | strip_files_prefix}}
+{{ cell.source | strip_math_space | markdown2html | strip_files_prefix }}
 </div>
 {%- endblock markdowncell %}
 
 {% block headingcell scoped %}
 <div class="text_cell_render border-box-sizing rendered_html">
-  {{("#" * cell.level + cell.source) | replace('\n', ' ') | strip_math_space | markdown2html | strip_files_prefix | add_anchor }}
+{{ ("#" * cell.level + cell.source) | replace('\n', ' ') | strip_math_space | markdown2html | strip_files_prefix | add_anchor }}
 </div>
 {% endblock headingcell %}
 
@@ -68,71 +70,73 @@ Out[{{cell.prompt_number}}]:
 {% endblock rawcell %}
 
 {% block unknowncell scoped %}
-unknown type  {{cell.type}}
+unknown type  {{ cell.type }}
 {% endblock unknowncell %}
 
-
 {% block pyout -%}
 <div class="box-flex1 output_subarea output_pyout">
-{% block data_priority scoped %}{{ super()}}{% endblock %}
+{% block data_priority scoped %}
+{{ super() }}
+{% endblock %}
 </div>
 {%- endblock pyout %}
 
 {% block stream_stdout -%}
 <div class="box-flex1 output_subarea output_stream output_stdout">
-<pre>{{output.text |ansi2html}}</pre>
+<pre>
+{{ output.text | ansi2html }}
+</pre>
 </div>
 {%- endblock stream_stdout %}
 
 {% block stream_stderr -%}
 <div class="box-flex1 output_subarea output_stream output_stderr">
-<pre>{{output.text |ansi2html}}</pre>
+<pre>
+{{ output.text | ansi2html }}
+</pre>
 </div>
 {%- endblock stream_stderr %}
 
 {% block data_svg -%}
-{{output.svg}}
+{{ output.svg }}
 {%- endblock data_svg %}
 
-
 {% block data_html -%}
 <div class="output_html rendered_html">
-{{output.html}}
+{{ output.html }}
 </div>
 {%- endblock data_html %}
 
 {% block data_png %}
-<img src="data:image/png;base64,{{output.png}}">
+<img src="data:image/png;base64,{{ output.png }}">
 {%- endblock data_png %}
 
-
 {% block data_jpg %}
-<img src="data:image/jpeg;base64,{{output.jpeg}}">
+<img src="data:image/jpeg;base64,{{ output.jpeg }}">
 {%- endblock data_jpg %}
 
-
 {% block data_latex %}
-{{output.latex}}
+{{ output.latex }}
 {%- endblock data_latex %}
 
 {% block pyerr -%}
 <div class="box-flex1 output_subarea output_pyerr">
-<pre>{{super()}}</pre>
+<pre>{{ super() }}</pre>
 </div>
 {%- endblock pyerr %}
 
 {%- block traceback_line %}
-{{line| ansi2html}}
+{{ line | ansi2html }}
 {%- endblock traceback_line %}
 
-
 {%- block data_text %}
-<pre>{{output.text | ansi2html}}</pre>
+<pre>
+{{ output.text | ansi2html }}
+</pre>
 {%- endblock -%}
 
-
 {%- block display_data scoped -%}
 <div class="box-flex1 output_subarea output_display_data">
-{{super()}}
+{{ super() }}
 </div>
-{%- endblock display_data -%}
+{%- endblock display_data -%}
\ No newline at end of file
diff --git a/IPython/nbconvert/templates/html_full.tpl b/IPython/nbconvert/templates/html_full.tpl
index 07f1c53..626399b 100644
--- a/IPython/nbconvert/templates/html_full.tpl
+++ b/IPython/nbconvert/templates/html_full.tpl
@@ -1,14 +1,16 @@
 {%- extends 'html_basic.tpl' -%}
 
-{%- block header -%}<!DOCTYPE html>
+
+{%- block header -%}
+<!DOCTYPE html>
 <html>
 <head>
 <meta charset="UTF-8">
 <title>[{{nb.metadata.name}}]</title>
 {% for css in resources.inlining.css -%}
-<style type="text/css">
-{{css}}
-</style>
+    <style type="text/css">
+    {{ css }}
+    </style>
 {% endfor %}
 
 <style type="text/css">
@@ -32,9 +34,7 @@ pre {
 <!-- Custom stylesheet, it must be in the same directory as the html file -->
 <link rel="stylesheet" href="custom.css">
 
-<script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript">
-
-</script>
+<script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript"></script>
 <script type="text/javascript">
 init_mathjax = function() {
     if (window.MathJax) {
@@ -57,12 +57,12 @@ init_mathjax();
 </head>
 {%- endblock header -%}
 
-
 {% block body %}
-<body>{{ super() }}
+<body>
+{{ super() }}
 </body>
 {%- endblock body %}
 
-
 {% block footer %}
-</html>{% endblock footer %}
+</html>
+{% endblock footer %}
\ No newline at end of file
diff --git a/IPython/nbconvert/templates/latex/latex_article.tplx b/IPython/nbconvert/templates/latex/latex_article.tplx
index 3fbccce..a1af7a3 100644
--- a/IPython/nbconvert/templates/latex/latex_article.tplx
+++ b/IPython/nbconvert/templates/latex/latex_article.tplx
@@ -10,6 +10,10 @@
 
 ((*- extends 'sphinx.tplx' -*))
 
+
+
+
+
 ((* set parentdocumentclass = 'article' *))
 ((* set documentclass = 'howto' *))
 
diff --git a/IPython/nbconvert/templates/latex/latex_basic.tplx b/IPython/nbconvert/templates/latex/latex_basic.tplx
index 81412db..f389c04 100644
--- a/IPython/nbconvert/templates/latex/latex_basic.tplx
+++ b/IPython/nbconvert/templates/latex/latex_basic.tplx
@@ -1,12 +1,17 @@
 ((*- extends 'display_priority.tplx' -*))
 
+
 \nonstopmode
 
-((* block in_prompt *))((* endblock in_prompt *))
+((* block in_prompt *))
+((* endblock in_prompt *))
 
-((* block output_prompt *))((* endblock output_prompt *))
+((* block output_prompt *))
+((* endblock output_prompt *))
 
-((* block codecell *))\begin{codecell}((( super() )))
+((* block codecell *))
+\begin{codecell}
+((( super() )))
 \end{codecell}
 ((* endblock *))
 
@@ -18,59 +23,62 @@
 \end{codeinput}
 ((* endblock input *))
 
-
 ((= Those Two are for error displaying
 even if the first one seem to do nothing, 
 it introduces a new line
-
 =))
+
 ((* block pyerr *))
 \begin{traceback}
-\begin{verbatim}((( super() )))
+\begin{verbatim}
+((( super() )))
 \end{verbatim}
 \end{traceback}
 ((* endblock pyerr *))
 
 ((* block traceback_line *))
-((( line |indent| strip_ansi )))((* endblock traceback_line *))
+((( line | indent | strip_ansi )))
+((* endblock traceback_line *))
 ((= .... =))
 
-
 ((*- block output_group -*))
 \begin{codeoutput}
 ((( super() )))
-\end{codeoutput}((* endblock *))
+\end{codeoutput}
+((* endblock *))
 
 ((*- block data_png -*))
 \begin{center}
-\includegraphics[max size={0.7\textwidth}{0.9\textheight}]{(((output.png_filename)))}
+\includegraphics[max size={0.7\textwidth}{0.9\textheight}]{((( output.png_filename )))}
 \par
 \end{center}
 ((*- endblock -*))
 
 ((*- block data_jpg -*))
 \begin{center}
-\includegraphics[max size={0.7\textwidth}{0.9\textheight}]{(((output.jpeg_filename)))}
+\includegraphics[max size={0.7\textwidth}{0.9\textheight}]{((( output.jpeg_filename )))}
 \par
 \end{center}
 ((*- endblock -*))
 
 ((*- block data_svg -*))
 \begin{center}
-\includegraphics[width=0.7\textwidth]{(((output.svg_filename)))}
+\includegraphics[width=0.7\textwidth]{((( output.svg_filename )))}
 \par
 \end{center}
 ((*- endblock -*))
 
 ((*- block data_pdf -*))
 \begin{center}
-\includegraphics[width=0.7\textwidth]{(((output.pdf_filename)))}
+\includegraphics[width=0.7\textwidth]{((( output.pdf_filename )))}
 \par
 \end{center}
 ((*- endblock -*))
 
 ((* block pyout *))
-((* block data_priority scoped *))((( super() )))((* endblock *))
+((* block data_priority scoped *))
+((( super() )))
+((* endblock *))
 ((* endblock pyout *))
 
 ((* block data_text *))
@@ -81,22 +89,25 @@ it introduces a new line
 
 ((* block data_latex -*))
 ((*- if output.latex.startswith('$'): -*)) \begin{equation*}
-    ((( output.latex | strip_dollars)))
+    ((( output.latex | strip_dollars )))
     \end{equation*}
-((*- else -*)) ((( output.latex ))) ((*- endif *))
+((*- else -*))
+    ((( output.latex )))
+((*- endif *))
 ((* endblock *))
 
 ((* block stream *))
 \begin{Verbatim}[commandchars=\\\{\}]
-((( output.text | ansi2latex)))
+((( output.text | ansi2latex )))
 \end{Verbatim}
 ((* endblock stream *))
 
-((* block markdowncell scoped *))((( cell.source | markdown2latex )))
+((* block markdowncell scoped *))
+((( cell.source | markdown2latex )))
 ((* endblock markdowncell *))
 
 ((* block headingcell scoped -*))
-    ((( ('#' * cell.level + cell.source) | replace('\n', ' ') | markdown2latex )))
+((( ('#' * cell.level + cell.source) | replace('\n', ' ') | markdown2latex )))
 ((* endblock headingcell *))
 
 ((* block rawcell scoped *))
@@ -104,11 +115,9 @@ it introduces a new line
 ((* endblock rawcell *))
 
 ((* block unknowncell scoped *))
-unknown type  (((cell.type)))
+unknown type  ((( cell.type )))
 ((* endblock unknowncell *))
 
-
-
 ((* block body *))
 
 ((* block bodyBegin *))
diff --git a/IPython/nbconvert/templates/latex/latex_book.tplx b/IPython/nbconvert/templates/latex/latex_book.tplx
index 0f51a7e..1c380b1 100644
--- a/IPython/nbconvert/templates/latex/latex_book.tplx
+++ b/IPython/nbconvert/templates/latex/latex_book.tplx
@@ -10,6 +10,10 @@
 
 ((*- extends 'sphinx.tplx' -*))
 
+
+
+
+
 ((* set parentdocumentclass = 'report' *))
 ((* set documentclass = 'manual' *))
 
diff --git a/IPython/nbconvert/templates/latex/sphinx.tplx b/IPython/nbconvert/templates/latex/sphinx.tplx
index 6df9058..25d49df 100644
--- a/IPython/nbconvert/templates/latex/sphinx.tplx
+++ b/IPython/nbconvert/templates/latex/sphinx.tplx
@@ -9,6 +9,7 @@ Note: For best display, use latex syntax highlighting. =))
 
 ((*- extends 'display_priority.tplx' -*))
 
+
 \nonstopmode
 
 %==============================================================================
@@ -181,7 +182,9 @@ Note: For best display, use latex syntax highlighting. =))
             \tableofcontents 
         ((* endblock toc *))
 
-        ((* endblock bodyBegin *))((( super() )))((* block bodyEnd *))
+        ((* endblock bodyBegin *))
+        ((( super() )))
+        ((* block bodyEnd *))
 
         \renewcommand{\indexname}{Index}
         \printindex
@@ -222,7 +225,8 @@ Note: For best display, use latex syntax highlighting. =))
     ((= It's important to make sure that underscores (which tend to be common
     in IPYNB file titles) do not make their way into latex.  Sometimes this
     causes latex to barf. =))
-    ((*- endif -*)){((( cell.source | markdown2latex )))}
+    ((*- endif -*))
+    {((( cell.source | markdown2latex )))}
 ((*- endblock headingcell *))
 
 %==============================================================================
@@ -232,7 +236,7 @@ Note: For best display, use latex syntax highlighting. =))
 %          called since we know we want latex output.
 %==============================================================================
 ((*- block markdowncell scoped-*))
-    ((( cell.source | markdown2latex )))
+((( cell.source | markdown2latex )))
 ((*- endblock markdowncell -*))
 
 %==============================================================================
@@ -242,7 +246,7 @@ Note: For best display, use latex syntax highlighting. =))
 %          will not get touched by the templating system.
 %==============================================================================
 ((*- block rawcell *))
-    ((( cell.source | wrap_text(wrap_size) )))
+((( cell.source | wrap_text(wrap_size) )))
 ((* endblock rawcell -*))
 
 %==============================================================================
@@ -253,9 +257,8 @@ Note: For best display, use latex syntax highlighting. =))
 %          can't flow off of the page.
 %==============================================================================
 ((* block unknowncell scoped*))
-
-    % Unsupported cell type, no formatting
-    ((( cell.source | wrap_text | escape_latex )))
+% Unsupported cell type, no formatting
+((( cell.source | wrap_text | escape_latex )))
 ((* endblock unknowncell *))
 
 %==============================================================================
@@ -338,34 +341,40 @@ Note: For best display, use latex syntax highlighting. =))
 % Additional formating
 %==============================================================================
 ((* block data_text *))
-    ((( custom_verbatim(output.text) | ansi2latex)))
+((( custom_verbatim(output.text) | ansi2latex )))
 ((* endblock *))
 
 ((* block traceback_line *))
-    ((( conditionally_center_output(line | indent| strip_ansi) )))
+((( conditionally_center_output( line | indent| strip_ansi ) )))
 ((* endblock traceback_line *))
 
 %==============================================================================
 % Supported image formats
 %==============================================================================
 ((*- block data_png -*))
-    ((( conditionally_center_output(insert_graphics(output.png_filename)) )))
+((( conditionally_center_output(insert_graphics(output.png_filename)) )))
 ((*- endblock -*))
 
 ((*- block data_jpg -*))
-    ((( conditionally_center_output(insert_graphics(output.jpg_filename)) )))
+((( conditionally_center_output(insert_graphics(output.jpg_filename)) )))
 ((*- endblock -*))
 
 ((*- block data_svg -*))
-    ((( conditionally_center_output(insert_graphics(output.svg_filename)) )))
+((( conditionally_center_output(insert_graphics(output.svg_filename)) )))
 ((*- endblock -*))
 
 ((*- block data_pdf -*))
-    ((( conditionally_center_output(insert_graphics(output.pdf_filename)) )))
+((( conditionally_center_output(insert_graphics(output.pdf_filename)) )))
 ((*- endblock -*))
 
 ((*- block data_latex *))
-    ((* if resources.sphinx.centeroutput *))\begin{center}((* endif -*))((( output.latex | strip_math_space )))((*- if resources.sphinx.centeroutput *))\end{center} ((* endif -*))
+((* if resources.sphinx.centeroutput *))
+    \begin{center}
+((* endif -*))
+((( output.latex | strip_math_space )))
+((*- if resources.sphinx.centeroutput *))
+    \end{center}
+((* endif -*))
 ((*- endblock -*))
 
 %==============================================================================
@@ -439,14 +448,19 @@ Note: For best display, use latex syntax highlighting. =))
 % Name: conditionally_center_output
 % Purpose: This macro centers the output if the output centering is enabled.
 ((* macro conditionally_center_output(text) -*))
-    ((* if resources.sphinx.centeroutput *)){\centering ((* endif *))((( text )))((* if resources.sphinx.centeroutput *))}((* endif *))
+    ((* if resources.sphinx.centeroutput *))
+        {\centering
+    ((* endif *))
+    ((( text )))
+    ((* if resources.sphinx.centeroutput *))}
+    ((* endif *))
 ((*- endmacro *))
 
 % Name: insert_graphics
 % Purpose: This macro will insert an image in the latex document given a path.
 ((* macro insert_graphics(path) -*))
     \begin{center}
-    \includegraphics[max size={\textwidth}{\textheight}]{(((path)))}
+    \includegraphics[max size={\textwidth}{\textheight}]{((( path )))}
     \par
     \end{center}
-((*- endmacro *))
+((*- endmacro *))
\ No newline at end of file
diff --git a/IPython/nbconvert/templates/markdown.tpl b/IPython/nbconvert/templates/markdown.tpl
index 5768462..a759470 100644
--- a/IPython/nbconvert/templates/markdown.tpl
+++ b/IPython/nbconvert/templates/markdown.tpl
@@ -1,13 +1,19 @@
 {% extends 'display_priority.tpl' %}
+
+
 {% block in_prompt %}
-In[{{cell.prompt_number if cell.prompt_number else ' '}}]:{% endblock in_prompt %}
+In[{{ cell.prompt_number if cell.prompt_number else ' ' }}]:
+{% endblock in_prompt %}
 
-{% block output_prompt %}{% if cell.haspyout %}Out[{{cell.prompt_number}}]:
-{%- endif %}{%- endblock output_prompt %}
+{% block output_prompt %}
+{% if cell.haspyout %}
+Out[{{ cell.prompt_number }}]:
+{%- endif %}
+{%- endblock output_prompt %}
 
 {% block input %}
 ```
-{{ cell.input}}
+{{ cell.input }}
 ```
 {% endblock input %}
 
@@ -16,58 +22,53 @@ In[{{cell.prompt_number if cell.prompt_number else ' '}}]:{% endblock in_prompt 
 {% endblock pyerr %}
 
 {% block traceback_line %}
-{{ line |indent| strip_ansi }}{% endblock traceback_line %}
+{{ line | indent | strip_ansi }}
+{% endblock traceback_line %}
 
 {% block pyout %}
-{% block data_priority scoped %}{{ super()}}{% endblock %}
+{% block data_priority scoped %}
+{{ super() }}
+{% endblock %}
 {% endblock pyout %}
 
 {% block stream %}
-{{ output.text| indent }}
+{{ output.text | indent }}
 {% endblock stream %}
 
-
-
-
 {% block data_svg %}
-[!image]({{output.svg_filename}})
+[!image]({{ output.svg_filename }})
 {% endblock data_svg %}
 
 {% block data_png %}
-[!image]({{output.png_filename}})
+[!image]({{ output.png_filename }})
 {% endblock data_png %}
 
 {% block data_jpg %}
-[!image]({{output.jpg_filename}})
+[!image]({{ output.jpg_filename }})
 {% endblock data_jpg %}
 
-
-
 {% block data_latex %}
 $$
-{{output.latex}}
+{{ output.latex }}
 $$
 {% endblock data_latex %}
 
 {% block data_text scoped %}
-
-{{output.text | indent}}
-
+{{ output.text | indent }}
 {% endblock data_text %}
 
 {% block markdowncell scoped %}
-{{ cell.source | wrap_text(80)}}
+{{ cell.source | wrap_text(80) }}
 {% endblock markdowncell %}
 
 {% block headingcell scoped %}
-
 {{ '#' * cell.level }} {{ cell.source | replace('\n', ' ') }}
-
 {% endblock headingcell %}
 
-{% block rawcell scoped %}{{ cell.source  }}
+{% block rawcell scoped %}
+{{ cell.source }}
 {% endblock rawcell %}
 
 {% block unknowncell scoped %}
-unknown type  {{cell.type}}
-{% endblock unknowncell %}
+unknown type  {{ cell.type }}
+{% endblock unknowncell %}
\ No newline at end of file
diff --git a/IPython/nbconvert/templates/python.tpl b/IPython/nbconvert/templates/python.tpl
index b981752..f619206 100644
--- a/IPython/nbconvert/templates/python.tpl
+++ b/IPython/nbconvert/templates/python.tpl
@@ -1,40 +1,39 @@
 {%- extends 'null.tpl' -%}
 
+
 {% block in_prompt %}
-# In[{{cell.prompt_number if cell.prompt_number else ' '}}]:
+# In[{{ cell.prompt_number if cell.prompt_number else ' ' }}]:
 {% endblock in_prompt %}
 
 {% block output_prompt %}
-# Out[{{cell.prompt_number}}]:{% endblock output_prompt %}
+# Out[{{ cell.prompt_number }}]:
+{% endblock output_prompt %}
 
-{% block input %}{{ cell.input | ipython2python }}
+{% block input %}
+{{ cell.input | ipython2python }}
 {% endblock input %}
 
-
 {# Those Two are for error displaying
 even if the first one seem to do nothing, 
 it introduces a new line
-
 #}
-{% block pyerr %}{{ super() }}
+{% block pyerr %}
+{{ super() }}
 {% endblock pyerr %}
 
 {% block traceback_line %}
-{{ line |indent| strip_ansi }}{% endblock traceback_line %}
+{{ line | indent | strip_ansi }}
+{% endblock traceback_line %}
 {# .... #}
 
-
 {% block pyout %}
-{{ output.text| indent | comment_lines }}
+{{ output.text | indent | comment_lines }}
 {% endblock pyout %}
 
 {% block stream %}
-{{ output.text| indent | comment_lines }}
+{{ output.text | indent | comment_lines }}
 {% endblock stream %}
 
-
-
-
 {% block display_data scoped %}
 # image file:
 {% endblock display_data %}
@@ -52,5 +51,5 @@ it introduces a new line
 {% endblock rawcell %}
 
 {% block unknowncell scoped %}
-unknown type  {{cell.type}}
-{% endblock unknowncell %}
+unknown type  {{ cell.type }}
+{% endblock unknowncell %}
\ No newline at end of file
diff --git a/IPython/nbconvert/templates/reveal_internals/align_reveal_cells.tpl b/IPython/nbconvert/templates/reveal_internals/align_reveal_cells.tpl
index 6eadac8..c746f5e 100644
--- a/IPython/nbconvert/templates/reveal_internals/align_reveal_cells.tpl
+++ b/IPython/nbconvert/templates/reveal_internals/align_reveal_cells.tpl
@@ -1,7 +1,6 @@
 {%- extends 'reveal_internals/reveal_cells.tpl' -%}
 
 
-
 {%- block any_cell scoped -%}
 {%- if cell.metadata.align_type in ['Left'] -%}  
     {{ super() }}
diff --git a/IPython/nbconvert/templates/reveal_internals/reveal_cells.tpl b/IPython/nbconvert/templates/reveal_internals/reveal_cells.tpl
index b0c7238..8b016c7 100644
--- a/IPython/nbconvert/templates/reveal_internals/reveal_cells.tpl
+++ b/IPython/nbconvert/templates/reveal_internals/reveal_cells.tpl
@@ -1,7 +1,5 @@
 {%- extends 'html_basic.tpl' -%}
 
-
-
 {%- block any_cell scoped -%}
 {%- if cell.metadata.slide_type in ['-', 'slide', 'subslide'] -%}  
     {{ super() }}
diff --git a/IPython/nbconvert/templates/reveal_internals/slides.tpl b/IPython/nbconvert/templates/reveal_internals/slides.tpl
index 543379d..4da60a3 100644
--- a/IPython/nbconvert/templates/reveal_internals/slides.tpl
+++ b/IPython/nbconvert/templates/reveal_internals/slides.tpl
@@ -1,14 +1,13 @@
 {%- extends 'reveal_internals/subslides.tpl' -%}
 
 
-
 {%- block any_cell scoped -%}
 {%- if cell.metadata.slide_type in ['slide'] -%}  
     <section>
     <section>
 {%- endif -%}
     
-{{ super() }}
+    {{ super() }}
     
 {%- if cell.metadata.slide_helper in ['slide_end'] -%}
     </section>
diff --git a/IPython/nbconvert/templates/reveal_internals/subslides.tpl b/IPython/nbconvert/templates/reveal_internals/subslides.tpl
index 9a14900..1c8b36e 100644
--- a/IPython/nbconvert/templates/reveal_internals/subslides.tpl
+++ b/IPython/nbconvert/templates/reveal_internals/subslides.tpl
@@ -1,13 +1,12 @@
 {%- extends 'reveal_internals/align_reveal_cells.tpl' -%}
 
 
-
 {%- block any_cell scoped -%}
 {%- if cell.metadata.slide_type in ['subslide'] -%}  
     <section>
 {%- endif -%}
     
-{{ super() }}
+    {{ super() }}
     
 {%- if cell.metadata.slide_helper in ['subslide_end'] -%}
     </section>
diff --git a/IPython/nbconvert/templates/rst.tpl b/IPython/nbconvert/templates/rst.tpl
index e3b582d..6f22d12 100644
--- a/IPython/nbconvert/templates/rst.tpl
+++ b/IPython/nbconvert/templates/rst.tpl
@@ -1,75 +1,76 @@
 {%- extends 'display_priority.tpl' -%}
-{% block in_prompt -%}
-In[{{cell.prompt_number if cell.prompt_number else ' '}}]:
 
-.. code:: python
 
+{% block in_prompt -%}
+In[{{ cell.prompt_number if cell.prompt_number else ' ' }}]:
+.. code:: python
 {% endblock in_prompt %}
 
-{% block output_prompt %}{% if cell.haspyout -%}
-Out[{{cell.prompt_number}}]:{% endif %}{% endblock output_prompt %}
-
-{% block input %}{{ cell.input | indent}}
+{% block output_prompt %}
+{% if cell.haspyout -%}
+    Out[{{ cell.prompt_number }}]:
+{% endif %}
+{% endblock output_prompt %}
 
+{% block input %}
+{{ cell.input | indent}}
 {% endblock input %}
 
-{% block pyerr %}::
+{% block pyerr %}
+::
 {{ super() }}
 {% endblock pyerr %}
 
 {% block traceback_line %}
-{{ line |indent| strip_ansi }}{% endblock traceback_line %}
+{{ line | indent | strip_ansi }}
+{% endblock traceback_line %}
 
 {% block pyout %}
-{% block data_priority scoped %}{{ super()}}{% endblock %}
+{% block data_priority scoped %}
+{{ super() }}
+{% endblock %}
 {% endblock pyout %}
 
 {% block stream %}
 .. parsed-literal::
 
-{{ output.text| indent }}
+{{ output.text | indent }}
 {% endblock stream %}
 
-
-
-
-{% block data_svg %}.. image:: {{output.svg_filename}}
-
+{% block data_svg %}
+.. image:: {{ output.svg_filename }}
 {% endblock data_svg %}
 
-{% block data_png %}.. image:: {{output.png_filename}}
-
+{% block data_png %}
+.. image:: {{ output.png_filename }}
 {% endblock data_png %}
 
-{% block data_jpg %}..jpg image:: {{output.jpg_filename}}
-
+{% block data_jpg %}
+..jpg image:: {{ output.jpg_filename }}
 {% endblock data_jpg %}
 
-
-
-{% block data_latex %}.. math::
-
-{{output.latex| indent}}
-
+{% block data_latex %}
+.. math::
+{{ output.latex | indent }}
 {% endblock data_latex %}
 
-{% block data_text scoped %}.. parsed-literal::
-
-{{output.text | indent}}
-
+{% block data_text scoped %}
+.. parsed-literal::
+{{ output.text | indent }}
 {% endblock data_text %}
 
-{% block markdowncell scoped %}{{ cell.source | markdown2rst }}
+{% block markdowncell scoped %}
+{{ cell.source | markdown2rst }}
 {% endblock markdowncell %}
 
 {% block headingcell scoped %}
 {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2rst }}
-
 {% endblock headingcell %}
 
-{% block rawcell scoped %}{{ cell.source  }}
+{% block rawcell scoped %}
+{{ cell.source }}
 {% endblock rawcell %}
 
 {% block unknowncell scoped %}
 unknown type  {{cell.type}}
-{% endblock unknowncell %}
+{% endblock unknowncell %}
\ No newline at end of file
diff --git a/IPython/nbconvert/templates/skeleton/README.md b/IPython/nbconvert/templates/skeleton/README.md
index 86079f6..cda024f 100644
--- a/IPython/nbconvert/templates/skeleton/README.md
+++ b/IPython/nbconvert/templates/skeleton/README.md
@@ -3,4 +3,4 @@
 This contain skeleton template that you probably don't want
 to inherit directly.
 
-do not moify the content of the 'tex' folder which is generated by running 'make' in this folder.
+do not modify the content of the 'tex' folder which is generated by running 'make' in this folder.
diff --git a/IPython/nbconvert/templates/slides_reveal.tpl b/IPython/nbconvert/templates/slides_reveal.tpl
index 9039e17..afd1651 100644
--- a/IPython/nbconvert/templates/slides_reveal.tpl
+++ b/IPython/nbconvert/templates/slides_reveal.tpl
@@ -29,9 +29,9 @@ document.write( '<link rel="stylesheet" href="{{resources.reveal.url_prefix}}/cs
 <![endif]-->
 
 {% for css in resources.inlining.css -%}
-<style type="text/css">
-{{css}}
-</style>
+    <style type="text/css">
+    {{ css }}
+    </style>
 {% endfor %}
 
 <style type="text/css">
@@ -95,11 +95,11 @@ text-align: inherit;
 
 {% block body %}
 <body>
-<div class="reveal"><div class="slides">
-
+<div class="reveal">
+<div class="slides">
 {{ super() }}
-
-</div></div>
+</div>
+</div>
 
 <!--
 Uncomment the following block and the addthis_widget.js (see below inside dependencies)