这是indexloc提供的服务,不要输入任何密码
Skip to content

Explicit use of x (y) in cellx(x: ...) causes table rows to be uneven when rows parameter is set #97

@Andrew15-5

Description

@Andrew15-5

Here is the working example:

source

#import "@preview/tablex:0.0.6": tablex, rowspanx, colspanx, cellx

#set page(width: auto, height: auto)
#set text(size: 10pt)

#tablex(
  align: center + horizon,
  rows: 5mm,
  columns: (7mm, 10mm, 23mm, 15mm, 10mm, 70mm, 5mm, 5mm, 5mm, 5mm, 12mm, 18mm),
  ..range(5), cellx(rowspan: 3, colspan: 7)[],
  ..range(5),
  ..range(5),

  ..range(5), rowspanx(5)[], colspanx(3)[], colspanx(2)[], [],
  ..range(5), rowspanx(3)[], rowspanx(3)[], rowspanx(3)[], cellx(rowspan: 3, colspan: 2)[], rowspanx(3)[],
  colspanx(2)[], ..range(3),
  colspanx(2)[], ..range(3),
  colspanx(2)[], ..range(3), colspanx(4)[], colspanx(2)[],

  colspanx(2)[], ..range(3), rowspanx(3)[], cellx(rowspan: 3, colspan: 6)[],
  colspanx(2)[], ..range(3),
  colspanx(2)[], ..range(3),
)

part of output

image

But adding x: 5, causes not only text on 1st, 5th, 9th, 11th rows to shift a bit, but also extends the last row's height:

source

#import "@preview/tablex:0.0.6": tablex, rowspanx, colspanx, cellx

#set page(width: auto, height: auto)
#set text(size: 10pt)

#tablex(
  align: center + horizon,
  rows: 5mm,
  columns: (7mm, 10mm, 23mm, 15mm, 10mm, 70mm, 5mm, 5mm, 5mm, 5mm, 12mm, 18mm),
  ..range(5), cellx(x: 5, rowspan: 3, colspan: 7)[],
  ..range(5),
  ..range(5),

  ..range(5), rowspanx(5)[], colspanx(3)[], colspanx(2)[], [],
  ..range(5), rowspanx(3)[], rowspanx(3)[], rowspanx(3)[], cellx(rowspan: 3, colspan: 2)[], rowspanx(3)[],
  colspanx(2)[], ..range(3),
  colspanx(2)[], ..range(3),
  colspanx(2)[], ..range(3), colspanx(4)[], colspanx(2)[],

  colspanx(2)[], ..range(3), rowspanx(3)[], cellx(rowspan: 3, colspan: 6)[],
  colspanx(2)[], ..range(3),
  colspanx(2)[], ..range(3),
)

part of output

image

If I remove the unnecessary ..range(5), then most rows' text will move and the second to last row now also will extend its height.

source

#import "@preview/tablex:0.0.6": tablex, rowspanx, colspanx, cellx

#set page(width: auto, height: auto)
#set text(size: 10pt)

#tablex(
  align: center + horizon,
  rows: 5mm,
  columns: (7mm, 10mm, 23mm, 15mm, 10mm, 70mm, 5mm, 5mm, 5mm, 5mm, 12mm, 18mm),
  cellx(x: 5, rowspan: 3, colspan: 7)[],
  ..range(5),
  ..range(5),

  ..range(5), rowspanx(5)[], colspanx(3)[], colspanx(2)[], [],
  ..range(5), rowspanx(3)[], rowspanx(3)[], rowspanx(3)[], cellx(rowspan: 3, colspan: 2)[], rowspanx(3)[],
  colspanx(2)[], ..range(3),
  colspanx(2)[], ..range(3),
  colspanx(2)[], ..range(3), colspanx(4)[], colspanx(2)[],

  colspanx(2)[], ..range(3), rowspanx(3)[], cellx(rowspan: 3, colspan: 6)[],
  colspanx(2)[], ..range(3),
  colspanx(2)[], ..range(3),
)

part of output

image

P.S. I'm using MuPDF in the screenshots.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions