I have some pipe tables with some long rows and when they get converted to LaTeX, the columns widths add up to more than one, resulting in the table extending into and beyond the margin of the page.
I can reproduce the behavior for even a small table with the --columns argument set small enough. For example, if test.md is:
| test | header | row |
|-------+--------+--------|
| first | row | elemnt |
The relative column widths are calculated by looking
at the widths of the separator lines, relative to
the total column width as set by `--columns`. (To
be precise, we take the number of dashes in the
separator line and add 1, then divide by the
value of `--columns`.)
So, if you set `--columns=12`, then a separator that is 6
characters wide will have a width of 50%. If you have
three separators, each more than 6 characters wide, then
the relative column widths will sum to more than 100%.
So, the solution is simply to scale your separator lines
appropriately.
A possible change in pandoc would be to renormalize column
widths after this calculation, so that they never exceed
100% total. This is probably worth doing.
I have some pipe tables with some long rows and when they get converted to LaTeX, the columns widths add up to more than one, resulting in the table extending into and beyond the margin of the page.
I can reproduce the behavior for even a small table with the
--columns
argument set small enough. For example, iftest.md
is:Then running
yields
where the columns widths in a row sum to more than one
\columnwidth
. In fact, narowing the--columns
make the problem worse:produces