mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #4044 (extra row height in PDF output from empty multicell)
This commit is contained in:
parent
0e39d92c92
commit
f453fe7bf0
1
CHANGES
1
CHANGES
@ -30,6 +30,7 @@ Bugs fixed
|
||||
* #3969: private instance attributes causes AttributeError
|
||||
* #4041: C++, remove extra name linking in function pointers.
|
||||
* #4038: C, add missing documentation of ``member`` role.
|
||||
* #4044: An empty multicolumn cell causes extra row height in PDF output
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -1463,7 +1463,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
if cell.width > 1 or cell.height > 1:
|
||||
self.body.append('\\begin{varwidth}[t]{\\sphinxcolwidth{%d}{%d}}\n'
|
||||
% (cell.width, self.table.colcount))
|
||||
context = ('\\par\n\\vskip-\\baselineskip\\strut\\end{varwidth}%\n') + context
|
||||
context = ('\\par\n\\vskip-\\baselineskip\\vbox{\\hbox{\\strut}}\\end{varwidth}%\n') + context
|
||||
self.needs_linetrimming = 1
|
||||
if len(node) > 2 and len(node.astext().split('\n')) > 2:
|
||||
self.needs_linetrimming = 1
|
||||
|
@ -18,13 +18,13 @@ consecutive multirow at end of row (1-4 and 1-5)
|
||||
\begin{varwidth}[t]{\sphinxcolwidth{1}{5}}
|
||||
cell1-1
|
||||
\par
|
||||
\vskip-\baselineskip\strut\end{varwidth}%
|
||||
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
|
||||
}%
|
||||
&\sphinxmultirow{3}{2}{%
|
||||
\begin{varwidth}[t]{\sphinxcolwidth{1}{5}}
|
||||
cell1-2
|
||||
\par
|
||||
\vskip-\baselineskip\strut\end{varwidth}%
|
||||
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
|
||||
}%
|
||||
&
|
||||
cell1-3
|
||||
@ -32,20 +32,20 @@ cell1-3
|
||||
\begin{varwidth}[t]{\sphinxcolwidth{1}{5}}
|
||||
cell1-4
|
||||
\par
|
||||
\vskip-\baselineskip\strut\end{varwidth}%
|
||||
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
|
||||
}%
|
||||
&\sphinxmultirow{2}{5}{%
|
||||
\begin{varwidth}[t]{\sphinxcolwidth{1}{5}}
|
||||
cell1-5
|
||||
\par
|
||||
\vskip-\baselineskip\strut\end{varwidth}%
|
||||
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
|
||||
}%
|
||||
\\
|
||||
\cline{3-3}\sphinxtablestrut{1}&\sphinxtablestrut{2}&\sphinxmultirow{2}{6}{%
|
||||
\begin{varwidth}[t]{\sphinxcolwidth{1}{5}}
|
||||
cell2-3
|
||||
\par
|
||||
\vskip-\baselineskip\strut\end{varwidth}%
|
||||
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
|
||||
}%
|
||||
&\sphinxtablestrut{4}&\sphinxtablestrut{5}\\
|
||||
\cline{5-5}\sphinxtablestrut{1}&\sphinxtablestrut{2}&\sphinxtablestrut{6}&\sphinxtablestrut{4}&
|
||||
|
@ -17,7 +17,7 @@ cell1-1
|
||||
\begin{varwidth}[t]{\sphinxcolwidth{1}{3}}
|
||||
cell1-2
|
||||
\par
|
||||
\vskip-\baselineskip\strut\end{varwidth}%
|
||||
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
|
||||
}%
|
||||
&
|
||||
cell1-3
|
||||
@ -26,7 +26,7 @@ cell1-3
|
||||
\begin{varwidth}[t]{\sphinxcolwidth{1}{3}}
|
||||
cell2-1
|
||||
\par
|
||||
\vskip-\baselineskip\strut\end{varwidth}%
|
||||
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
|
||||
}%
|
||||
&\sphinxtablestrut{5}&
|
||||
cell2-3
|
||||
@ -36,7 +36,7 @@ cell2-3
|
||||
\begin{varwidth}[t]{\sphinxcolwidth{2}{3}}
|
||||
cell3-2
|
||||
\par
|
||||
\vskip-\baselineskip\strut\end{varwidth}%
|
||||
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
|
||||
}%
|
||||
\sphinxstopmulticolumn
|
||||
\\
|
||||
@ -47,7 +47,7 @@ cell4-1
|
||||
\begin{varwidth}[t]{\sphinxcolwidth{3}{3}}
|
||||
cell5-1
|
||||
\par
|
||||
\vskip-\baselineskip\strut\end{varwidth}%
|
||||
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
|
||||
\sphinxstopmulticolumn
|
||||
\\
|
||||
\hline
|
||||
|
Loading…
Reference in New Issue
Block a user