Fix incorrect p column width calculation in LaTeX leading to overfull and over-wide tables
This commit is contained in:
parent
d1ab5a6c3d
commit
dad59c3d3d
BIN
example.pdf
BIN
example.pdf
Binary file not shown.
@ -219,9 +219,9 @@ class LaTeXRenderer(mistletoe.latex_renderer.LaTeXRenderer):
|
|||||||
|
|
||||||
for cell in token.children:
|
for cell in token.children:
|
||||||
if cell.colnum == 0:
|
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:]),
|
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>}',
|
cells1.append(format('\\multicolumn{2}{<coldef>}{\\bfseries Column <label>}',
|
||||||
coldef=coldef,
|
coldef=coldef,
|
||||||
|
Loading…
Reference in New Issue
Block a user