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
As indicated in the title, if a table is defined in a multi-row or multi-column (or both) cell of another table, then the produce latex file will not be valid.
How to Reproduce
This minimal rst is enough to trigger the problem:
(The + at the middle of the first line is intended to trigger a multi-column cell)
I could dig a bit more into the issue and from what I found it seems that the needs_linetrimming value of the LatexTranslator class is not properly used.
With the example I gave above, we enter visit_entry and depart_entry both twice:
First we go into visit_entry for the outer table, in which we set self.needs_linetrimming to 1
Then we go into visit_entry a second time, this time for the inner table. In this case we wouldn't be setting self.needs_linetrimming to 1 but in any case it is already set.
Then we go into depart_entry for the inner table, and since self.needs_linetrimming == 1 we then call popbody even though it was needed for the entry of the outer table.
Finally, we go into depart_entry a second time, for the outer table, in which we will not call popbody because self.needs_linetrimming was set to 0 in the previous call of depart_entry
One way to fix this would be to use node attributes to set it on the entry node which actually needs line trimming.
The text was updated successfully, but these errors were encountered:
Thanks for report. Other "nested tables" issues include #11498 and #11515. The latex table rendering code is complex particularly for rendering merged cells especially when they involve both multiple rows and multiple columns.
Describe the bug
As indicated in the title, if a table is defined in a multi-row or multi-column (or both) cell of another table, then the produce latex file will not be valid.
How to Reproduce
This minimal rst is enough to trigger the problem:
(The
+
at the middle of the first line is intended to trigger a multi-column cell)Environment Information
Sphinx extensions
Additional context
I could dig a bit more into the issue and from what I found it seems that the
needs_linetrimming
value of the LatexTranslator class is not properly used.With the example I gave above, we enter
visit_entry
anddepart_entry
both twice:visit_entry
for the outer table, in which we setself.needs_linetrimming
to1
visit_entry
a second time, this time for the inner table. In this case we wouldn't be settingself.needs_linetrimming
to1
but in any case it is already set.depart_entry
for the inner table, and sinceself.needs_linetrimming == 1
we then callpopbody
even though it was needed for the entry of the outer table.depart_entry
a second time, for the outer table, in which we will not callpopbody
becauseself.needs_linetrimming
was set to0
in the previous call ofdepart_entry
One way to fix this would be to use node attributes to set it on the
entry
node which actually needs line trimming.The text was updated successfully, but these errors were encountered: