Commits

bmu  committed af85afc

some additional changes for numbered_nodes

  • Participants
  • Parent commits e3886f1

Comments (0)

Files changed (1)

File sphinx/writers/latex.py

             self.body.append(u'\\caption{%s} \\\\\n' % self.table.caption)
         if self.table.caption is not None:
             for id in self.next_table_ids:
-                self.body.append(self.hypertarget(id, anchor=False))
+                #self.body.append(self.hypertarget(id, anchor=False))
+                # move label into the table to get a proper autoref
+                endmacro += self.hypertarget(id, anchor=False)
             self.next_table_ids.clear()
         if self.table.longtable:
             self.body.append('\\hline\n')
                 return
             elif isinstance(next, nodes.table):
                 # same for tables, but only if they have a caption
-                for n in node:
+                for n in next:
                     if isinstance(n, nodes.title):
                         if node.get('refid'):
                             self.next_table_ids.add(node['refid'])
                 self.context.append(' (%s)' % self.hyperpageref(id))
             else:
                 self.context.append('')
+            raise nodes.SkipNode
         elif uri.startswith('%'):
             # references to documents or labels inside documents
             hashindex = uri.find('#')
                     self.context.append(' (%s)' % self.hyperpageref(id))
                 else:
                     self.context.append('')
+            raise nodes.SkipNode
         else:
             self.builder.warn('unusable reference target found: %s' % uri,
                               (self.curfilestack[-1], node.line))