mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #2707: (latex) the column width is badly computed for tabular
MEMO: the used formula is correct as long as package array is loaded. Package array (which modifies how the width of vertical rules is counted in the total width of the tabular) is a dependency of packages tabulary, and eqparbox, and possibly others which are currently loaded by sphinx.sty. Even if usage of package tabulary is dropped in future version of sphinx.sty, there would still remain the dependency on array via eqparbox, and the formula configured in latex.py will remain correct.
This commit is contained in:
parent
452c8b162c
commit
303f163b0a
@ -1052,9 +1052,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
self.body.append(self.table.colspec)
|
||||
else:
|
||||
if self.table.has_problematic:
|
||||
colwidth = 0.95 / self.table.colcount
|
||||
colspec = ('p{%.3f\\linewidth}|' % colwidth) * \
|
||||
self.table.colcount
|
||||
colspec = ('p{\\dimexpr(\\linewidth-\\arrayrulewidth)/%d'
|
||||
'-2\\tabcolsep-\\arrayrulewidth\\relax}|' % \
|
||||
self.table.colcount) * self.table.colcount
|
||||
self.body.append('{|' + colspec + '}\n')
|
||||
elif self.table.longtable:
|
||||
self.body.append('{|' + ('l|' * self.table.colcount) + '}\n')
|
||||
|
Loading…
Reference in New Issue
Block a user