diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 2d08d4cfdd..71e3508551 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -874,6 +874,7 @@ class LaTeXTranslator(nodes.NodeVisitor): self.body.append('\\\\\n') if any(self.remember_multirow.values()): linestart = 1 + col = self.table.colcount for col in range(1, self.table.col + 1): if self.remember_multirow.get(col): if linestart != col: diff --git a/tests/root/markup.txt b/tests/root/markup.txt index de1bcaecb2..9e8c6bc863 100644 --- a/tests/root/markup.txt +++ b/tests/root/markup.txt @@ -187,7 +187,7 @@ Tables | 2 | Empty cells: | | +----+----------------+----+ -Table with multirow and multicol: +Tables with multirow and multicol: .. only:: latex @@ -199,6 +199,12 @@ Table with multirow and multicol: | x | multi-column cell | x | +----+---------------------+----+ + +----+ + | 1 | + + + + | | + +----+ + Figures -------