PgBiel / typst-tablex

More powerful and customizable tables in Typst
MIT License
370 stars 12 forks source link

Tables can overrun the right margin #42

Closed wlupton closed 11 months ago

wlupton commented 1 year ago

I haven't yet tried to reproduce this problem in a small document. Please let me know if you'd like me to try to do this.

Please see the beginning part of the Typst code for a table, and how it renders.

#figure(
  kind: table,
  caption: [Table 1: XML Description Markup])[
  #tablex(
    columns: (auto, auto, auto),
    align: (auto, auto, auto),
    fill: table-fill.with(columns: 3, header-rows: 1),
    header-rows: 1,
    repeat-header: true,
    header-hlines-have-priority: false,
    auto-hlines: true,
    auto-vlines: false,
    (), vlinex(), vlinex(), (),
    [Name], [Markup Example], [Description],
    [Italics], [`''italic text''`], [Two apostrophes on each side of
      some text will result in the contained text being emphasized in
      italics.],
    [Bold], [`'''bold text'''`], [Three apostrophes on each side of some
      text will result in the contained text being emphasized in bold.],
    [Bold italics], [`'''''b+i text'''''`], [Five apostrophes on each
      side of some text will result in the contained text being
      emphasized in bold italics.],
    [Paragraph], [This paragraph just ended.], [A line break is
      interpreted as a paragraph break.],
...

Screenshot 2023-08-09 at 15 11 00

PgBiel commented 1 year ago

I believe this might be due to some bad interaction with centering, but I'm not sure. I will have to investigate this later. Thanks for the report!

PgBiel commented 1 year ago

Hi, I couldn't reproduce your issue, but I've pushed a fix to main which might help (with https://github.com/PgBiel/typst-tablex/commit/f00b91c7d9383ebd194fb9e36ee5999339c38891). Can you try and see if the latest version in main makes a difference in your case (possibly fixes the issue)? Maybe also share a minimal repro if possible so I can conduct my own tests. Thanks!

PgBiel commented 11 months ago

Closing due to inactivity; feel free to reopen if the issue is still reproducible.