diff options
author | Georg Brandl <georg@python.org> | 2010-07-17 19:52:16 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-07-17 19:52:16 +0200 |
commit | 3f01087461a21970bf98f6c374d1df33f53a4bbd (patch) | |
tree | dd1ad73a6cdf269b17b5a776de80aa593a0e9bf2 | |
parent | 95992afb2000de2afe66ea4aafc6d6140463f352 (diff) | |
download | sphinx-3f01087461a21970bf98f6c374d1df33f53a4bbd.tar.gz |
Fix bug in LaTeX label writing: do not generate \phantomsections in \section{}.
-rw-r--r-- | sphinx/writers/latex.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index ea12f003..15e55b15 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -963,8 +963,11 @@ class LaTeXTranslator(nodes.NodeVisitor): def add_target(id): # indexing uses standard LaTeX index markup, so the targets # will be generated differently - if not id.startswith('index-'): - self.body.append(self.hypertarget(id)) + if id.startswith('index-'): + return + # do not generate \phantomsection in \section{} + anchor = not self.in_title + self.body.append(self.hypertarget(id, anchor=anchor)) # postpone the labels until after the sectioning command parindex = node.parent.index(node) |