Fix empty cell in table header causes LaTeX error (#1574)

This commit is contained in:
Takeshi KOMIYA 2015-12-24 12:41:07 +09:00
parent 02f013aba5
commit ee7e3cc078
2 changed files with 14 additions and 2 deletions

View File

@ -1061,6 +1061,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.remember_multirowcol[self.table.col] = node.get('morecols')
self.table.col += node.get('morecols')
if isinstance(node.parent.parent, nodes.thead):
if len(node) == 1 and isinstance(node[0], nodes.paragraph) and node.astext() == '':
pass
else:
self.body.append('\\textsf{\\relax ')
context += '}'
while self.remember_multirow.get(self.table.col + 1, 0):

View File

@ -187,6 +187,15 @@ Tables
| 2 | Empty cells: | |
+----+----------------+----+
.. table:: empty cell in table header
===== ======
\
===== ======
1 2
3 4
===== ======
Tables with multirow and multicol:
.. only:: latex