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

Fix #8838 by forcing horizontal mode before inserting the penalty #8877

Merged
merged 1 commit into from Feb 12, 2021

Conversation

jfbu
Copy link
Contributor

@jfbu jfbu commented Feb 12, 2021

Relates

This is better fix of #8838 than #8840. I have understood the underlying LaTeX problem.

With this input:

.. tabularcolumns:: |*{4}{p{2cm}|}

.. table:: tabular not ok

   +------------------------+------------+----------+------------------+
   | Header row, column 1   | Header 2   | Header 3 | Header 4         |
   +========================+============+==========+==================+
   | body row               | ...        | ...      | aaaaaaaaaaaaaaaa |
   +------------------------+------------+----------+------------------+
   | body row, merged columns            | column 3 | column 4         |
   +------------------------+------------+----------+------------------+

one gets

Capture d’écran 2021-02-12 à 17 48 10

with #8840 but the better

Capture d’écran 2021-02-12 à 17 48 45

with this one. (it is deliberate here that I use a string that TeX does not hyphenate; else there would be no overflow)

My other tests give results ok.

For example

.. table:: tabulary

   +------------------------+------------+----------+----------+
   | Header row, column 1   | Header 2   | Header 3 | Header 4 |
   +========================+============+==========+==========+
   | body row               | ...        | ...      |          |
   +------------------------+------------+----------+----------+
   | body row, merged columns            | column 3 | column 4 |
   +------------------------+------------+----------+----------+
   | body row, merged columns and rows   |          |          |
   |                                     |          |          |
   | let's make this 2 paragraphs        | column 3 | column 4 |
   +-------------------------------------+----------+----------+

@tk0miya I know merging at such late date into 3.x is a bit annoying because we have refactored a lot latex on master then merging 3.x in master may be complicated but I think this one will be ok, so I am proposing to merge into 3.x.

@jfbu
Copy link
Contributor Author

jfbu commented Feb 12, 2021

Merging now so as to reduce your workload on release day.. I checked I could merge 3.x into master with no help so I will do it afterwards to get latex merge done.

@jfbu jfbu merged commit a148909 into sphinx-doc:3.x Feb 12, 2021
@jfbu jfbu deleted the latex_better_fix_8838 branch February 12, 2021 20:45
@tk0miya
Copy link
Member

tk0miya commented Feb 12, 2021

@tk0miya I know merging at such late date into 3.x is a bit annoying because we have refactored a lot latex on master then merging 3.x in master may be complicated but I think this one will be ok, so I am proposing to merge into 3.x.

No problem. Are there any tasks before the release? I think releasing this weekend is not important. So we can postpone it if needed.

@jfbu
Copy link
Contributor Author

jfbu commented Feb 13, 2021

@tk0miya No task left in my scope before release, go ahead!

@tk0miya
Copy link
Member

tk0miya commented Feb 14, 2021

Okay, I'm going to package it now.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants