Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paragraphs in longtable don't work in Latex output #1580

Closed
shimizukawa opened this issue Jan 3, 2015 · 3 comments
Closed

Paragraphs in longtable don't work in Latex output #1580

shimizukawa opened this issue Jan 3, 2015 · 3 comments
Assignees
Milestone

Comments

@shimizukawa
Copy link
Member

There is another problem when you have multiple paragraphs in one table cell, for example like this:

+----+----+
| 00 | X  |
+----+----+
| 01 | X  |
+----+----+
| 02 | P1 |
|    |    |
|    | P2 |
+----+----+
| 03 | X  |
+----+----+
| 04 | X  |
...
| 30 | X  |
+----+----+

This works in HTML, and in Latex as long as there are not over 30 rows. P1 and P2 are separate paragraphs on separate lines.

But above 30 rows, the latex writer switches from tabulary to longtable. For some reason that causes the paragraphs P1 and P2 to get merged onto the same line.


@shimizukawa
Copy link
Member Author

From Peter Suter on 2014-09-29 08:48:21+00:00

The self.table.has_problematic mode of sphinx/writers/latex.py (i.e. changing colspec from l to p) seems to help. I'm not sure what the downsides are though.

Should if self.table: self.table.has_problematic = True be added to LaTeXTranslator.visit_paragraph?

Or should LaTeXTranslator.depart_table just be changed to always use p for self.table.longtable?

Or maybe there is a better solution?

tex.stackexchange has many more or less complicated suggestions for how to force line breaks in table cells...

@shimizukawa
Copy link
Member Author

From Peter Suter on 2014-10-08 09:18:09+00:00

(As a workaround the .. tabularcolumns:: directive can be used to override the broken default colspec.)

@tk0miya tk0miya self-assigned this Jan 7, 2016
@tk0miya tk0miya added this to the 1.3.4 milestone Jan 7, 2016
@tk0miya
Copy link
Member

tk0miya commented Jan 7, 2016

Fixed at 2be21e3.
Thank you for reporting

@tk0miya tk0miya closed this as completed Jan 7, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants