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

Unexpected linebreak in heading #4189

Open
1 task done
tmistele opened this issue May 19, 2024 · 7 comments
Open
1 task done

Unexpected linebreak in heading #4189

tmistele opened this issue May 19, 2024 · 7 comments
Labels
bug Something isn't working layout Related to layout, positioning, etc.

Comments

@tmistele
Copy link

Description

I tried the following code:

#set heading(numbering: "1.")
#set par(justify: true)

= Theory

It produces the following unexpected output (screenshot of the pdf created by typst compile)

image

This is with version 0.11.1 (I think. typst --version says typst 0.11.0 (4f8bbb01). I compiled myself from git). It seems to have worked with 0.11.0

image

What is strange is that I cannot reproduce the issue in the typst web app with any version I try. Perhaps I'm doing something wrong.

Reproduction URL

No response

Operating system

Linux

Typst version

  • I am using the latest version of Typst
@tmistele tmistele added the bug Something isn't working label May 19, 2024
@Enivex
Copy link
Collaborator

Enivex commented May 19, 2024

I can reproduce this. Presumably the cause is a commit not included in the 0.11.1 release.

@Enivex Enivex added the text Text layout, shaping, internationalization, etc. label May 19, 2024
@MDLC01
Copy link
Contributor

MDLC01 commented May 19, 2024

This seems related to #3398.

@tmistele
Copy link
Author

tmistele commented May 19, 2024

Fwiw, git bisect points to 6d0c159 for me
cc @haenoe

@Enivex Enivex added layout Related to layout, positioning, etc. and removed text Text layout, shaping, internationalization, etc. labels May 19, 2024
@laurmaedje laurmaedje changed the title Unexpected linebreak in headline Unexpected linebreak in heading May 21, 2024
@haenoe
Copy link
Contributor

haenoe commented May 25, 2024

Hey, thanks for tagging me.
I did some basic triaging and it seems to me that the problem is in the laying out that the BlockElem performs.
The weird thing is this commit seems to fix that (in the very simple example provided above).
I will look more into it, any remarks are greatly appreciated :D

@laurmaedje
Copy link
Member

It's likely a problem with measurement and floating point. But the relevant code doesn't exist anymore on my layout refactoring branch, so probably not worth it to try and fix it there.

@haenoe
Copy link
Contributor

haenoe commented May 25, 2024

Yeah that is also what I suspected, thanks for validating :D
Just out of curiosity, what changes with the layout refactoring? Is the branch public? ^^'

@laurmaedje
Copy link
Member

It's not yet public, but I'll probably create a first PR soon-ish and describe things there.

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

No branches or pull requests

5 participants