mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
Merge pull request #2708 from jfbu/jfbu_fixtabularcolspecs
Fix #2707: (latex) the column width is badly computed for tabular
This commit is contained in:
@@ -12,6 +12,7 @@ Incompatible changes
|
||||
* LaTeX package newfloat (which was shipped with Sphinx since 1.3.4) is no
|
||||
longer a dependency of sphinx.sty (ref #2660)
|
||||
|
||||
|
||||
Features added
|
||||
--------------
|
||||
|
||||
@@ -33,10 +34,14 @@ Features added
|
||||
* public names for latex environments and parameters used by note, warning,
|
||||
and other admonition types, allowing full customizability from the
|
||||
``'preamble'`` key (ref: feature request #2674, #2685)
|
||||
* latex better computes column widths of some tables (as a result, there will
|
||||
be slight changes as tables now correctly fill the line with; ref: #2708)
|
||||
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* #2707: (latex) the column width is badly computed for tabular
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
|
||||
@@ -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 = ('*{%d}{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')
|
||||
|
||||
Reference in New Issue
Block a user