Fix #4206: latex: reST label between paragraphs loses paragraph break

This commit is contained in:
Takeshi KOMIYA 2017-11-01 14:33:22 +09:00
parent e03ec5b9fb
commit 29c62c64f5
2 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,8 @@ Features added
Bugs fixed Bugs fixed
---------- ----------
* #4206: latex: reST label between paragraphs loses paragraph break
Testing Testing
-------- --------

View File

@ -1919,6 +1919,12 @@ class LaTeXTranslator(nodes.NodeVisitor):
# will be generated differently # will be generated differently
if id.startswith('index-'): if id.startswith('index-'):
return return
# insert blank line, if the target follows a paragraph node
index = node.parent.index(node)
if index > 0 and isinstance(node.parent[index - 1], nodes.paragraph):
self.body.append('\n')
# do not generate \phantomsection in \section{} # do not generate \phantomsection in \section{}
anchor = not self.in_title anchor = not self.in_title
self.body.append(self.hypertarget(id, anchor=anchor)) self.body.append(self.hypertarget(id, anchor=anchor))