summaryrefslogtreecommitdiff
path: root/docutils
diff options
context:
space:
mode:
authorgrubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2006-01-10 14:58:27 +0000
committergrubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2006-01-10 14:58:27 +0000
commita2461f582a703ae324d9176d274e03a3bfcf4d12 (patch)
tree5e546382dd0a78591ffa93437870656b8a77b107 /docutils
parenta202cc61da620e48a3985c28154628ed690221a0 (diff)
downloaddocutils-a2461f582a703ae324d9176d274e03a3bfcf4d12.tar.gz
Fix: figure align: center
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@4287 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
-rw-r--r--docutils/docutils/writers/latex2e/__init__.py3
-rw-r--r--docutils/test/functional/expected/standalone_rst_latex.tex4
2 files changed, 4 insertions, 3 deletions
diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py
index cf7af05fd..eca39798d 100644
--- a/docutils/docutils/writers/latex2e/__init__.py
+++ b/docutils/docutils/writers/latex2e/__init__.py
@@ -1382,7 +1382,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.body.append(':]')
def visit_figure(self, node):
- if not node.attributes.has_key('align'):
+ if (not node.attributes.has_key('align') or
+ node.attributes['align'] == 'center'):
align = 'center'
else:
align = 'flush'+node.attributes['align']
diff --git a/docutils/test/functional/expected/standalone_rst_latex.tex b/docutils/test/functional/expected/standalone_rst_latex.tex
index ba5b63bb0..49d33a277 100644
--- a/docutils/test/functional/expected/standalone_rst_latex.tex
+++ b/docutils/test/functional/expected/standalone_rst_latex.tex
@@ -925,14 +925,14 @@ This is the legend.
This paragraph might flow around the figure...
A centered figure:
-\begin{figure}[htbp]\begin{flushcenter}
+\begin{figure}[htbp]\begin{center}
\includegraphics[width=50]{../../../docs/user/rst/images/biohazard.png}
\caption{This is the caption.}{\small
This is the legend.
The legend may consist of several paragraphs.
-}\end{flushcenter}\end{figure}
+}\end{center}\end{figure}
This paragraph might flow around the figure...