#layout(size => {
  let body = [
#show figure.where(kind: "tytable"): set block(breakable: false)
#figure(
  kind: "tytable",
  supplement: "Table",

block[
  #let style-dict = (
  )

  #let style-array = (
  )

  #let get-style(x, y) = {
    let key = str(y) + "_" + str(x)
    if key in style-dict { style-array.at(style-dict.at(key)) } else { none }
  }

  #show table.cell: it => {
    if style-array.len() == 0 { return it }
    let style = get-style(it.x, it.y)
    if style == none { return it }
    let tmp = it
    if ("fontsize" in style) { tmp = text(size: style.fontsize, tmp) }
    if ("color" in style) { tmp = text(fill: style.color, tmp) }
    if ("indent" in style) { tmp = pad(left: style.indent, tmp) }
    if ("underline" in style) { tmp = underline(tmp) }
    if ("italic" in style) { tmp = emph(tmp) }
    if ("bold" in style) { tmp = strong(tmp) }
    if ("mono" in style) { tmp = math.mono(tmp) }
    if ("strikeout" in style) { tmp = strike(tmp) }
    if ("smallcaps" in style) { tmp = smallcaps(tmp) }
    if ("rotate" in style) {
      let a = if "align" in style { style.align } else { left }
      tmp = align(a, rotate(style.rotate, reflow: true, tmp))
    }
    tmp
  }

  #table(
    columns: (auto, auto),
    stroke: none,
    rows: auto,
    align: (x, y) => {
      let style = get-style(x, y)
      if style != none and "align" in style { style.align } else { (right, right).at(x) }
    },
    fill: (x, y) => {
      let style = get-style(x, y)
      if style != none and "background" in style { style.background }
    },
    table.hline(y: 0, start: 0, end: 2, stroke: 0.08em + black),
    table.hline(y: 1, start: 0, end: 2, stroke: 0.05em + black),
    table.hline(y: 3, start: 0, end: 2, stroke: 0.08em + black),
    table.header(
      repeat: true,
      [A],[B],
    ),
    [1],[2],
    [3],[4],
  )
]
)
  ]
  let body-size = measure(body)
  let target-height = size.height * 0.5
  if true {
    let factor = target-height / body-size.height * 100%
    scale(x: factor, y: factor, reflow: true, body)
  } else {
    body
  }
})