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

Wrong heading with figure(placement: auto) #17

Open
St0wy opened this issue May 30, 2024 · 3 comments
Open

Wrong heading with figure(placement: auto) #17

St0wy opened this issue May 30, 2024 · 3 comments

Comments

@St0wy
Copy link

St0wy commented May 30, 2024

Without placement auto, hydra correctly does not display Heading 1 in the header :
image

But when using placement auto, the image is placed at the top and hydra interprets this as being part of section 1 :
image

Maybe it's related to #16.

@tingerrr
Copy link
Owner

This is actually expected behavior at the moment, hydra has no knowledge of the actual first element, as Typst doesn't expose a mechanism to inspect pages like that yet. Currently, hydra does some elaborate measuring to detect pages that start with headings.

It's very similar to #8, where the underlying issue is the same.

I wonder, though, in this particular case, is the floating behavior desired? With typst#4141 one could prevent both the incorrect heading in hydra and the image floating past its encompassing section heading. If not, hydra would need to do the same kind of detection it would need to do in #8 for placed elements too.

@St0wy
Copy link
Author

St0wy commented May 30, 2024

Yeah I thought it might be a problem with what hydra can know about the document.

As for the figure with placement auto, I don't think the placement is really wrong, having it under the title would look wierd maybe ? Usually figures are considered "outside" of the text when floating like that, but I do agree that it would be nice to have a way to flush figures before the end of the section, but not sure about the begining.

Feel free to close this issue if you think that it's too redundant with #16 :)

@tingerrr
Copy link
Owner

tingerrr commented Jun 3, 2024

I'll keep this open, because hydra doesn't consider any floating elements yet, while it arguably should.

I'll just have to see how much of that can be done reasonably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants