You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
latex tables: Fix rendering for merged vertical cells
The table from issue #9313:
.. table::
:class: standard nocolorrows
+--------------------+----------------+
| 2 rows and 2 cols | 1 row x 3 cols |
| +----+-----+-----+
| | A | B | C |
+---+----------------+----+-----+-----+
| 1 | 2 | 3 | 4 | 5 |
+---+----------------+----+-----+-----+
has merged vertical cells that notably needs to draw a vertical line on
the left and right-hand side of the cells in the 2x2 grid area. If you
add a column to the left of this:
.. table::
:class: standard nocolorrows
+---+---+----------------+----------------+
| X | 2 rows and 2 cols | 1 row x 3 cols |
| | +----+-----+-----+
| | | A | B | C |
+---+---+----------------+----+-----+-----+
| Y | 1 | 2 | 3 | 4 | 5 |
+---+---+----------------+----+-----+-----+
then the 2x2 area should *not* draw a column line to the left of the
area.
We can fix this by adjusting the \multicolumn invocation to adjust when
it emits the colspec.
Notably, this commit does *not* consider the other broken case where a
person maybe just wants the table borders like:
.. tabularcolumns:: |llllll|
.. table::
:class: standard nocolorrows
+---+---+----------------+----------------+
| | 2 rows and 2 cols | 1 row x 3 cols |
| X | +----+-----+-----+
| | | A | B | C |
+---+---+----------------+----+-----+-----+
| Y | 1 | 2 | 3 | 4 | 5 |
+---+---+----------------+----+-----+-----+
That has an impact in this area of the code, but to correctly consider
that one has to parse out the given colspec to determine which columns
have borders between them. (This line of code has a bug for this case
as the colspec being emitted should be conditional if the specific column
actually has it enabled, but the supporting code only determines if a
vertical line is enabled anywhere rather than which columns.)
0 commit comments