def visit_figure(self, node):
ids = ''
if node.get('refuri'):
ids += self.hypertarget(node['refuri'], withdoc=False, anchor=False)
for id in sorted(self.pop_hyperlink_ids('figure')):
ids += self.hypertarget(id, anchor=False)
if node['ids']:
ids += self.hypertarget(node['ids'][0], anchor=False)
if (len(node.children) and
isinstance(node.children[0], nodes.image) and
node.children[0]['ids']):
ids += self.hypertarget(node.children[0]['ids'][0], anchor=False)
for c in node.children:
if isinstance(c, nodes.caption):
caption = c.astext()
node.caption = caption
ids += self.hypertarget('figure:%s' % caption,
withdoc=False,
anchor=False)
break
self.restrict_footnote(node)
self.body.append('\\begin{figure}[tb]\\begin{center}')
# The context is added to the body in depart_figure()
if ids:
self.context.append(ids)
self.context.append('\\end{center}\\end{figure}\n')
评论列表
文章目录