forked from sphinx-doc/sphinx
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove some redundant code in LaTeX writer
visit_figure
modified: sphinx/writers/latex.py
- Loading branch information
Showing
1 changed file
with
5 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1554,28 +1554,14 @@ def visit_figure(self, node): | |
(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']) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
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'] | ||
This comment has been minimized.
Sorry, something went wrong.
jfbu
Author
Owner
|
||
self.body.append('\\begin{figure}[%s]%s\n' % ( | ||
self.elements['figure_align'], align)) | ||
self.body.append('\\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): | ||
self.body.append(self.context.pop()) | ||
|
this code is never executed if I understand correctly f545805#diff-81c44cde8d80608ae558b93878f9be8aL1547 above