PgBiel / typst-tablex

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

compiler warning after typst.app released to 0.7.0 #38

Open simfeng opened 1 year ago

simfeng commented 1 year ago

[layout did not converge within 5 attempts hint: check if any states or queries are updating themselvesline 1]

PgBiel commented 1 year ago

That is unfortunately a limitation of the current tablex implementation which can manifest itself depending on your table. This should be improved, if not fixed, on the planned overhaul for version 0.1.0. Thanks for reporting!

PgBiel commented 1 year ago

By the way, feel free to share examples of tables which cause this warning to occur for further investigation.

ondohotola commented 1 year ago

This one triggers it, but if you remove one line (or the two header command lines) it doesn't.

#import "@preview/tablex:0.0.4": *
#align(center)[
   #tablex(
      columns: (2),
      repeat-header: true,
      header-rows: 1,
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
   )
]
simfeng commented 1 year ago

here is my code in ieee template

#import "@preview/tablex:0.0.4": tablex, hlinex, vlinex, colspanx, rowspanx, 
#import "template.typ": *
#show: ieee.with(
  title: "",
  abstract: [
  ],
  authors: (
  ),
  index-terms: (),
  bibliography-file: "refs.bib",
)

// #set cite(style: "chicago-author-date")
#let mtkgr = "aaaaaaa"
#let top5 = "Top-5"
#let top1 = "Top-1"
#let test_table = tablex(
  columns: 5,
  align: center + horizon,
  auto-lines: false,
  repeat-header: true,

  /* --- header --- */
  hlinex(),
  rowspanx(2)[], colspanx(2)[*Food Acc / %*], (), colspanx(2)[*Ingredient F1 / %*], (),
  (),  (), [*#top1*], [*#top5*], [*Micro*], [*Macro*],
  hlinex(),
  /* -------------- */
  [$s$], [$-$], [$-$], [$-$], [$-$],
  [$mtkgr$], [$-$], [$#sym.hyph$], [$#sym.hyph$], [$#sym.hyph$],
  [$mtkgr_0$], [$-$], [$#sym.hyph$], [$#sym.hyph$], [$#sym.hyph$],
  [$mtkgr_0$], [$-$], [$#sym.hyph$], [$#sym.hyph$], [$#sym.hyph$],
  [$mtkgr_{0.3}$], [$-$], [$#sym.hyph$], [$#sym.hyph$], [$#sym.hyph$],
  hlinex(),
)
#figure(
  placement: top,
  test_table, 
  caption:[table name.],
  kind: "table",
  supplement: [Table]
) <test_figure>

and there is easy way to fix it is to #let mtkgr = "aaaaaa" reduce a char a, I can also do #let top1 = "Top-", also work. So, I think is the text length bigger then the column length will trigger this problem, as shown in the figure below, the last row has to much char a.

截屏2023-08-08 21 16 30

hope this helps.

PgBiel commented 1 year ago

Thank you for the examples, everyone. I think this might be related to how headers work right now (they will be reworked in v0.1.0). Not 100% sure if that's the cause, though.

For future readers: feel free to add more examples as replies to this thread!

wlupton commented 1 year ago

This triggers it:

#import "@preview/tablex:0.0.4": tablex

#tablex(
  tablex(
    tablex(
      lorem(20) 
    )
  )
)

It doesn't happen if 20 is reduced to 10.

jannisko commented 1 year ago

Found another example which causes it. In this case, as soon as the table spans 3 pages, the warning pops up:

#import "@preview/tablex:0.0.4": tablex

#tablex(
  repeat-header: true,
  ..lorem(219).split("o")
)

Not sure why it would happen at 3 and not 5 but anyways.

PgBiel commented 1 year ago

This triggers it:

#import "@preview/tablex:0.0.4": tablex

#tablex(
  tablex(
    tablex(
      lorem(20) 
    )
  )
)

It doesn't happen if 20 is reduced to 10.

This specific case seems to have been fixed with my latest commits in main for the soon-to-be-released v0.0.5 :+1: (Make sure to eventually give it a shot :eyes:)

ondohotola commented 1 year ago

This one triggers it, but if you remove one line (or the two header command lines) it doesn't.

#import "@preview/tablex:0.0.4": *
#align(center)[
   #tablex(
      columns: (2),
      repeat-header: true,
      header-rows: 1,
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
      [Test], [test],
   )
]

Still triggers on 0.0.5

ondohotola commented 1 year ago

import "@preview/tablex:0.0.4": tablex

tablex(

repeat-header: true, ..lorem(219).split("o") )

Still triggered in 0.0.5

PgBiel commented 1 year ago

Thanks for checking. I haven't addressed the issue with repeatable headers yet - this will come in v0.1.0.