How to enable word wrapping of long strings in tables that allows for correct copy-paste of cell contents?

I don’t know of a fix for copying split up content but for this question:

@Y.D.X created a function as an answer to Scale content to max height and width keeping aspect ratio .

#let fit-content(max-width: 100%, max-height: 9pt, body) = layout(available => {
  let max-width = if type(max-width) == length {
    max-width
  } else {
    assert.eq(type(max-width), ratio)
    max-width * available.width
  }

  let (width, height) = measure(body)
  let factor = 100% * calc.min(max-width / width, max-height / height)

  scale(factor, reflow: true, body)
})


#table(
  columns: 3,
  [Normal], [Another normal column], fit-content(`veryveryveryveryveryveryveryveryverylongraw`)
)

1 Like