summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2013-02-21 20:48:05 +0000
committergrubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2013-02-21 20:48:05 +0000
commitcd9a7ae9d077b7e45ba59316b049b18f29c717e8 (patch)
treedc264bcc759dae0faa4704fd47a382bfc8e9cf96
parent1663f13c6f3544ef062d996b28882edc9908ca3a (diff)
downloaddocutils-cd9a7ae9d077b7e45ba59316b049b18f29c717e8.tar.gz
FIX [ docutils-Bugs-3594442 ] complex table formatting error
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7617 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r--docutils/writers/latex2e/__init__.py5
-rw-r--r--test/functional/expected/standalone_rst_latex.tex6
2 files changed, 9 insertions, 2 deletions
diff --git a/docutils/writers/latex2e/__init__.py b/docutils/writers/latex2e/__init__.py
index 5176db724..b45c579c3 100644
--- a/docutils/writers/latex2e/__init__.py
+++ b/docutils/writers/latex2e/__init__.py
@@ -1972,6 +1972,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
count = node['morerows'] + 1
self.active_table.set_rowspan(
self.active_table.get_entry_number()-1,count)
+ # TODO why does multirow end on % ? needs to be checked for below
self.out.append('\\multirow{%d}{%s}{%%' %
(count,self.active_table.get_column_width()))
self.context.append('}')
@@ -1995,9 +1996,13 @@ class LaTeXTranslator(nodes.NodeVisitor):
# header / not header
if isinstance(node.parent.parent, nodes.thead):
+ if self.out[-1].endswith("%"):
+ self.out.append("\n")
self.out.append('\\textbf{%')
self.context.append('}')
elif self.active_table.is_stub_column():
+ if self.out[-1].endswith("%"):
+ self.out.append("\n")
self.out.append('\\textbf{')
self.context.append('}')
else:
diff --git a/test/functional/expected/standalone_rst_latex.tex b/test/functional/expected/standalone_rst_latex.tex
index dc3e0e60b..bdb68babd 100644
--- a/test/functional/expected/standalone_rst_latex.tex
+++ b/test/functional/expected/standalone_rst_latex.tex
@@ -1783,7 +1783,8 @@ A table with multirow header
\setlength{\DUtablewidth}{\linewidth}
\begin{longtable*}[c]{|p{0.156\DUtablewidth}|p{0.238\DUtablewidth}|}
\hline
-\multirow{2}{0.16\DUtablewidth}{%\textbf{%
+\multirow{2}{0.16\DUtablewidth}{%
+\textbf{%
XXX
}} & \textbf{%
Variable Summary
@@ -1795,7 +1796,8 @@ Description
\hline
\endfirsthead
\hline
-\multirow{2}{0.16\DUtablewidth}{%\textbf{%
+\multirow{2}{0.16\DUtablewidth}{%
+\textbf{%
XXX
}} & \textbf{%
Variable Summary