Fix #2361: additional paragraphs inside the "compound" directive are indented

This commit is contained in:
Takeshi KOMIYA 2016-03-02 10:55:09 +09:00
parent 131057599d
commit 569a5bedca
2 changed files with 9 additions and 1 deletions

View File

@ -30,6 +30,7 @@ Bugs fixed
* #2331: Fix code-blocks are filled by block in dvi; remove ``xcdraw`` option from xcolor package
* Fix the confval type checker emits warnings if unicode is given to confvals which expects string value
* #2360: Fix numref in LaTeX output is broken
* #2361: Fix additional paragraphs inside the "compound" directive are indented
Documentation
-------------

View File

@ -1267,7 +1267,14 @@ class LaTeXTranslator(nodes.NodeVisitor):
depart_field_body = depart_definition
def visit_paragraph(self, node):
self.body.append('\n')
# insert blank line, if the paragraph follows a non-paragraph node in a compound
index = node.parent.index(node)
if (index > 0 and isinstance(node.parent, nodes.compound) and
not isinstance(node.parent[index - 1], nodes.paragraph) and
not isinstance(node.parent[index - 1], nodes.compound)):
self.body.append('\\noindent\n')
else:
self.body.append('\n')
def depart_paragraph(self, node):
self.body.append('\n')