Commits

bmu committed e3886f1

allow pagerefs

Comments (0)

Files changed (1)

sphinx/writers/latex.py

             id = self.curfilestack[-1] + ':' + uri[1:]
             #self.body.append(self.hyperlink(id))
             self.body.append('\\autoref{%s}' % id)
-            raise nodes.SkipNode
             if self.builder.config.latex_show_pagerefs and not \
                     self.in_productionlist:
-                self.context.append('}} (%s)' % self.hyperpageref(id))
+                self.context.append(' (%s)' % self.hyperpageref(id))
             else:
-                self.context.append('}}')
+                self.context.append('')
         elif uri.startswith('%'):
             # references to documents or labels inside documents
             hashindex = uri.find('#')
                 id = uri[1:].replace('#', ':')
             #self.body.append(self.hyperlink(id))
             self.body.append('\\autoref{%s}' % id)
-            raise nodes.SkipNode
             if len(node) and hasattr(node[0], 'attributes') and \
                    'std-term' in node[0].get('classes', []):
                 # don't add a pageref for glossary terms
-                self.context.append('}}')
+                self.context.append('')
             else:
                 if self.builder.config.latex_show_pagerefs:
-                    self.context.append('}} (%s)' % self.hyperpageref(id))
+                    self.context.append(' (%s)' % self.hyperpageref(id))
                 else:
-                    self.context.append('}}')
+                    self.context.append('')
         else:
             self.builder.warn('unusable reference target found: %s' % uri,
                               (self.curfilestack[-1], node.line))