sphinx-doc / sphinx-doc/sphinx
LaTeX: Empty cells create extra row height
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When adding an empty cell in a table with \ , the pdflatex target creates a row with extra (double) height. This does not happen if the cell is truly empty (just spaces), but this doesn't work for the first cell in a row. For example:
Table example
=============
======== ======== ========
Foo Bar Meh
-------- -------- --------
1.234 4.567 7.890
======== ======== ========
======== ======== ========
\ Bar Meh
-------- -------- --------
1.234 4.567 7.890
======== ======== ========
======== ======== ========
Bar Meh
-------- -------- --------
1.234 4.567 7.890
======== ======== ========
The first table is fine. The second table has the top left cell empty and gets double height in the PDF. The third table shows what happens if the \ is not used here. And the result:

How to Reproduce
Just a default project with the file shown above should work. Then make latexpdf.
Expected behavior
The row heights of the second table should be the same as in the first one.
Your project
N/A
Screenshots
No response
OS
Kubuntu 18.04
Python version
3.6.9
Sphinx version
4.5.0
Sphinx extensions
No response
Extra tools
No response
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in a default project using the table shown in the report, then run make latexpdf and compare the three generated table layouts. Trace the LaTeX output for the empty first cell and determine why \ adds extra row height. Done means the second table has the same row heights as the first.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- latex, python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100