Fix incorrect p column width calculation in LaTeX leading to overfull and over-wide tables

This commit is contained in:
RunasSudo 2019-09-15 00:33:25 +10:00
parent d1ab5a6c3d
commit dad59c3d3d
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
2 changed files with 2 additions and 2 deletions

Binary file not shown.

View File

@ -219,9 +219,9 @@ class LaTeXRenderer(mistletoe.latex_renderer.LaTeXRenderer):
for cell in token.children:
if cell.colnum == 0:
coldef = format(r'p{\dimexpr\linewidth-<colx>\tabucolX-<colnd>\tabcolsep\relax}',
coldef = format(r'p{\dimexpr\linewidth-1cm-1ex-<colx>\tabucolX-<colnd>\tabcolsep\relax}',
colx=sum(col.weight for col in token.children[1:]),
colnd=2 * (len(token.children) - 1)
colnd=2*len(token.children)
)
cells1.append(format('\\multicolumn{2}{<coldef>}{\\bfseries Column <label>}',
coldef=coldef,