Menu

#324 table with empty multicolumn cell produces LaTeX with missing bracket

closed-fixed
nobody
5
2020-03-03
2017-09-06
Eric3
No

Running the following input file through rst2latex.py:

+----+----+----+----+
| c1 | c2 | c3 | c4 |
+----+----+----+----+
| d1 | d2 | d34     |
+----+----+---------+

will produce this for the second row:

d1
 & 
d2
 & \multicolumn{2}{p{0.13\DUtablewidth}|}{%
d34
} \\
\hline

If we make the last cell blank:

+----+----+----+----+
| c1 | c2 | c3 | c4 |
+----+----+----+----+
| d1 | d2 |         |
+----+----+---------+

we get:

d1
 & 
d2
 & \multicolumn{2}{p{0.13\DUtablewidth}|}{%} \\
\hline

which produces an error in LaTeX, because the closing bracket is commented out by the % that's intended to mask the following line break (writers/latex2e/__init__.py:2102).

Tested on the current docutils snapshot, revision 8173, under Python 2.7.13 (Homebrew-installed) on OS X 10.11.6.

Discussion

  • Günter Milde

    Günter Milde - 2017-09-07
    • status: open --> closed-fixed
     
  • Günter Milde

    Günter Milde - 2017-09-07

    Fixed in revision 8174.
    Thank you for the report.

     

Log in to post a comment.