##box(height:1fr,[...]) not possible, alternatives to fill remaining space?

1 messages · Page 1 of 1 (latest)

kind mist
#

I want to place an image in the remaining space available on a given page. I do not want it to overflow to the next page. Naturally I want the image to be as large as possible. Filling the "remaining" width is possible using width:1fr, but this does not work for the height. How can I create a box with the largest possible dimensions WITHOUT it overflowing to the next page.

As an example, the following will produce a 2-page document, where I want it to only be one page:

#lorem(50)

#box(width: 100%,height: 100%,fill: red)
thin cloak
#

Does height: 1fr on the box and height: 100% on the image work?

kind mist
#

Well, box cannot take a fractional height.

error: expected relative length or auto, found fraction
  ┌─ test.typ:5:25
  │
5 │ #box(width: 100%,height: 1fr,fill: red)
  │ 
thin cloak
#

You can try a table with rows: 1fr