PgBiel / typst-tablex

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

Repeat-header erratic behavior #43

Open wlupton opened 1 year 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.

I've observed that repeat-header appears to work erratically. Please see below the beginnings of some tables, and how they render.

#figure(
  kind: table,
  caption: [Table 7: InstanceRef Facet Definition])[
  #tablex(
    columns: (auto, auto),
    align: (auto, auto),
    fill: table-fill.with(columns: 2, header-rows: 1),
    header-rows: 1,
    repeat-header: true,
    header-hlines-have-priority: false,
    auto-hlines: true,
    auto-vlines: false,
    (), vlinex(), (),
    [Name], [Description],
    [targetParent],
    [
      Specifies the Path Name of the Multi\-Instance Object (table) of
      which an instance (row) is being referenced. \
      "{i}" placeholders and explicit Instance Identifiers are not
      permitted in the Path Name. targetParentScope can be used to
      specify Path Names relative to the Root or Service Object or the
      current object.
    ],

Screenshot 2023-08-09 at 15 23 20

#figure(
  kind: table,
  caption: [Table 12: XML Bibliographic References])[
  #tablex(
    columns: (auto, auto),
    align: (auto, auto),
    fill: table-fill.with(columns: 2, header-rows: 1),
    header-rows: 1,
    repeat-header: true,
    header-hlines-have-priority: false,
    auto-hlines: true,
    auto-vlines: false,
    (), vlinex(), (),
    [Name], [Description],
    [id], [The bibliographic reference ID.],

Screenshot 2023-08-09 at 15 23 50

#figure(
  kind: table,
  caption: [Table 18: XML Command Definition])[
  #tablex(
    columns: (auto, auto),
    align: (auto, auto),
    fill: table-fill.with(columns: 2, header-rows: 1),
    header-rows: 1,
    repeat-header: true,
    header-hlines-have-priority: false,
    auto-hlines: true,
    auto-vlines: false,
    (), vlinex(), (),
    [Name], [Description],
    [name], [The command name
      (#link(<sec:general-notation>)[Section 3.1]).],
    [async], [Whether this command is asynchronous or not.],

Screenshot 2023-08-09 at 15 24 21

ondohotola commented 1 year ago

Noticed it too but can not reliably reproduce/predict.

Message ID: ***@***.***>
PgBiel commented 1 year ago

This is indeed a bug caused by how tablex uses introspection to produce headers. This should hopefully be fixed in v0.1.0, which will bring a rework to the rendering system. Thanks for the report!