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

LaTeX: table spacing sometimes broken on 3.x branch from \sphinxAtStartPar mark-up #8838

Closed
jfbu opened this issue Feb 6, 2021 · 1 comment · Fixed by #8840
Closed

LaTeX: table spacing sometimes broken on 3.x branch from \sphinxAtStartPar mark-up #8838

jfbu opened this issue Feb 6, 2021 · 1 comment · Fixed by #8840

Comments

@jfbu
Copy link
Contributor

jfbu commented Feb 6, 2021

Describe the bug
A clear and concise description of what the bug is.

Extra vertical
Capture d’écran 2021-02-06 à 16 17 15
whitespace in table cells, particularly merged ones

To Reproduce
Steps to reproduce the behavior:

.. raw:: latex

   %\def\sphinxAtStartPar{}


.. table:: longtable not ok
   :class: longtable

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

.. table:: longtable not ok (2)
   :class: longtable

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


.. tabularcolumns:: |*{4}{l|}

.. table:: tabular not ok

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


.. table:: tabulary worse of all

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

Expected behavior

Capture d’écran 2021-02-06 à 16 18 39

One gets this by letting the raw directive inject \def\sphinxAtStartPar{}.

Environment info

  • OS: [e.g. Unix/Linux/Mac/Win/other with version]
  • Python version: [e.g. 3.7.1]
  • Sphinx version: current 3.x branch after
  • Sphinx extensions: [e.g. sphinx.ext.autodoc, recommonmark]
  • Extra tools: [e.g. Browser, tex or something else]

Caused by #8781 merge

@jfbu jfbu added this to the 3.5.0 milestone Feb 6, 2021
@jfbu jfbu added the regression label Feb 6, 2021
jfbu added a commit to jfbu/sphinx that referenced this issue Feb 6, 2021
This reverts commit 17642a5.

Fixes sphinx-doc#8838. For some reason the \nobreak causes breakage in table
vertical spacing for merge cells in tabular and longtable, and regarding
tabulary for all cells...

Reverting this will cause as described in the reverted commit message
some much less annoying problem in certain circumstances when a long
word has no hyphenation point.
@jfbu jfbu closed this as completed in #8840 Feb 6, 2021
@jfbu
Copy link
Contributor Author

jfbu commented Feb 12, 2021

Reopening because the #8840 revert was a temporary fix and #8877 does the good job

@jfbu jfbu reopened this Feb 12, 2021
@jfbu jfbu closed this as completed in 683e64e Feb 12, 2021
jfbu added a commit that referenced this issue Feb 12, 2021
Fix #8838 by forcing horizontal mode before inserting the penalty
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant