Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbreakable block becomes invalid when moved into differently sized region #3866

Closed
1 task done
jkunimune opened this issue Apr 4, 2024 · 1 comment · Fixed by #5017
Closed
1 task done

Unbreakable block becomes invalid when moved into differently sized region #3866

jkunimune opened this issue Apr 4, 2024 · 1 comment · Fixed by #5017
Labels
bug Something isn't working layout Related to layout, positioning, etc.

Comments

@jkunimune
Copy link

jkunimune commented Apr 4, 2024

Description

I have a document with two columns of text and a figure that is over half the height of the page. When I compile my document, the figure is where I expect it, but the following text isn't pushed down far enough, and overlaps both the figure and its caption. I would expect it to position the text below the caption; there's even enough space to fit a full paragraph down there if it does.

This doesn't happen every time I have a figure this tall. It seems the paragraphs need to line up just right for it, but I haven't able to find a way to predict when it will or won't happen.

Minimum working example:

#text(weight: 700, 1.75em, lorem(17))
#pad(x: 2em, {
  v(1.1em)
  heading(outlined: false, numbering: none, text(0.85em)[Abstract])
  lorem(150)
  v(1.1em)
})

#show: columns.with(2, gutter: 0.5in)

= Introduction

#lorem(50)

#figure(
  rect(width: 2.3in, height: 1.9in),
  caption: lorem(10),
)

#lorem(50)

#figure(
  rect(width: 2.5in, height: 7in),
  caption: lorem(10),
)

#lorem(30)

#lorem(30)

#lorem(30)

#lorem(30)

The problem is on page 2:
imagen

Reproduction URL

https://typst.app/project/rr9vwQjcgU17NGm79GAU5O

Operating system

Web app

Typst version

  • I am using the latest version of Typst
@jkunimune jkunimune added the bug Something isn't working label Apr 4, 2024
@laurmaedje laurmaedje added the layout Related to layout, positioning, etc. label Apr 13, 2024
@laurmaedje
Copy link
Member

laurmaedje commented Jul 5, 2024

Minimized:

#v(10cm)
#show: columns.with(2)
#lorem(250)
#block(rect(width: 100%, height: 20cm), breakable: false)
#lorem(30)

The problem is that the unbreakable block overflows when layouted with the base size of the first region (less height), is then migrated into the second region, but there we do have more base space, so we need to relayout.

@laurmaedje laurmaedje changed the title Tall figures in columns overlap with text Unbreakable block becomes invalid when moved into differently sized region Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working layout Related to layout, positioning, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants