mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Remove unneeded coding from LaTeXTranslator.visit_figure()
This commit is contained in:
parent
f3f829664d
commit
8b74d93ad9
@ -1853,28 +1853,14 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
(node['align'] == 'right' and 'r' or 'l', length or '0pt'))
|
||||
self.context.append(ids + '\\end{wrapfigure}\n')
|
||||
elif self.in_minipage:
|
||||
if ('align' not in node.attributes or
|
||||
node.attributes['align'] == 'center'):
|
||||
self.body.append('\n\\begin{center}')
|
||||
self.context.append('\\end{center}\n')
|
||||
else:
|
||||
self.body.append('\n\\begin{flush%s}' % node.attributes['align'])
|
||||
self.context.append('\\end{flush%s}\n' % node.attributes['align'])
|
||||
self.body.append('\n\\begin{center}')
|
||||
self.context.append('\\end{center}\n')
|
||||
else:
|
||||
if ('align' not in node.attributes or
|
||||
node.attributes['align'] == 'center'):
|
||||
# centering does not add vertical space like center.
|
||||
align = '\n\\centering'
|
||||
align_end = ''
|
||||
else:
|
||||
# TODO non vertical space for other alignments.
|
||||
align = '\\begin{flush%s}' % node.attributes['align']
|
||||
align_end = '\\end{flush%s}' % node.attributes['align']
|
||||
self.body.append('\n\\begin{figure}[%s]%s\n' % (
|
||||
self.elements['figure_align'], align))
|
||||
self.body.append('\n\\begin{figure}[%s]\n\\centering\n' %
|
||||
self.elements['figure_align'])
|
||||
if any(isinstance(child, nodes.caption) for child in node):
|
||||
self.body.append('\\capstart\n')
|
||||
self.context.append(ids + align_end + '\\end{figure}\n')
|
||||
self.context.append(ids + '\\end{figure}\n')
|
||||
|
||||
def depart_figure(self, node):
|
||||
# type: (nodes.Node) -> None
|
||||
|
Loading…
Reference in New Issue
Block a user