Double lines and tables: a feature request?

This is based off a question asked on the forum here, but my question is instead: should I post a feature request for this? (Based on this question.)

A feature request for a line stroke that produces a double line.

  • Because to draw double lines in tables, we need to use multiple rows
    • But then the double line can not be above the table.header
  • Because drawing double lines with a tiling makes the line too wide, see below

Picture: this is pretty good, there is a double line above the table.header drawn with a tiling. But because of stroke width (of the tiling, not of the lines), it juts out wider than the regular table.hline

bild

#let dhpat(sep, stroke) = tiling(
  size: (10pt, (sep + std.stroke(stroke).thickness) * 10),
  {
    let t = std.stroke(stroke).thickness / 2 + 0.1pt
    let theline = line(length: 10pt, stroke: stroke)
    place(dy: t, theline)
    place(dy: t + sep, theline)
  }
)

// problem: the top double line is longer than the table.hlines()
#set table.hline(stroke: 0.08em)
#table(
  columns: 2,
  stroke: (x, y) => 0pt,
  align: (left, center),
  table.hline(stroke: (thickness: 6pt, paint: dhpat(2pt, 0.8pt), cap: "butt")),
  table.header([Mach range], [Flow physics]),
  table.hline(),
  $M_p <= 0.1$, [Incompressible],
  $0.1 <= M_p <= 0.65$, [Compressible],
  table.hline(),
  table.cell(colspan: 2, inset: 0.12em, {}),
  table.hline(),
)
1 Like

If you want to use a feature that is built into Typst, create a feature request. All details about it can be discussed there.

Also, the topic feels unnecessary in General, as even the title tells me that it belongs to Questions.

The question is not strictly speaking about using Typst, so it’s fine in General. I believe @bluss is asking whether or not to create an issue on typst/typst.

As for the question, I think it’s best to create an issue to reference the difficult of double lines in tables. Maybe it can be solved without implementing specifically double line stroke :person_shrugging:.

Clearly, there is something missing because it shouldn’t be that hard. I would probably expect two consecutive hline to merge together in a sensible manner.

2 Likes