Commits

Christoph Reller committed c14ee71

Insert newline around figure environments for latex.

  • Participants
  • Parent commits d02871f
  • Branches alt_win

Comments (0)

Files changed (2)

sphinxcontrib/tikz.py

     if node['caption']:
         if node['stringsubst']:
             node['tikz'] = node['tikz'] % {'wd': getcwd()}
-        latex = '\\begin{figure}[htp]\\centering\\begin{tikzpicture}' + \
+        latex = '\n\\begin{figure}[htp]\\centering\\begin{tikzpicture}' + \
                 node['tikz'] + '\\end{tikzpicture}' + '\\caption{' + \
-                self.encode(node['caption']).strip() + '}\\end{figure}'
+                self.encode(node['caption']).strip() + '}\\end{figure}\n'
     else:
         latex = '\\begin{center}\\begin{tikzpicture}' + node['tikz'] + \
             '\\end{tikzpicture}\\end{center}'

sphinxcontrib3/tikz.py

     if node['caption']:
         if node['stringsubst']:
             node['tikz'] = node['tikz'] % {'wd': getcwd()}
-        latex = '\\begin{figure}[htp]\\centering\\begin{tikzpicture}' + \
+        latex = '\n\\begin{figure}[htp]\\centering\\begin{tikzpicture}' + \
                 node['tikz'] + '\\end{tikzpicture}' + '\\caption{' + \
-                self.encode(node['caption']).strip() + '}\\end{figure}'
+                self.encode(node['caption']).strip() + '}\\end{figure}\n'
     else:
-        latex = '\\begin{center}\\begin{tikzpicture}' + node['tikz'] + \
-            '\\end{tikzpicture}\\end{center}'
+        latex = '\n\\begin{center}\\begin{tikzpicture}' + node['tikz'] + \
+            '\\end{tikzpicture}\\end{center}\n'
     self.body.append(latex)
 
 def depart_tikz(self,node):