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

So… no issue opened?

I noticed that there is a pending change to table headers, where headers don’t have to be first in the table. I was thinking that actually resolves the reason I posted this, because then it’s possible to use a row gutter to implement a double line. Still maybe it can bear discussing if that’s a good solution.

Does it resolve the ability to use double lines in tables? Or does it enable the use of workarounds to make double lines everywhere? Because a workaround already exists, at least for other places. If you are using header without the need for its repetition, then it’s only for later accessibility (and styling). In this case semantically using header, but also semantically adding empty cells above it is a net-zero gain, IMO. If you really want to, you can just not use header and use the empty cell hack now. This is not the same as having a (built-in/non-hacky) way to create double lines.