Merge pull request #2708 from jfbu/jfbu_fixtabularcolspecs

Fix #2707: (latex) the column width is badly computed for tabular
This commit is contained in:
Jean-François B
2016-06-22 09:54:44 +02:00
committed by GitHub
2 changed files with 8 additions and 3 deletions
+5
View File
@@ -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
-------------
+3 -3
View File
@@ -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')