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 in show. #23

Closed
Tetragramm opened this issue Nov 4, 2024 · 2 comments
Closed

Wrong heading with figure in show. #23

Tetragramm opened this issue Nov 4, 2024 · 2 comments

Comments

@Tetragramm
Copy link

Tetragramm commented Nov 4, 2024

Using the following show rule with hydra(2, skip-starting: false) produces the previous heading's name for this page. Following pages are correct (until the next header)

  show heading.where(level: 2): it => {
    pagebreak(weak:true)
    figure(placement:top, scope: "parent", outlined:false,
      it.body
    )
  }

This might be related to either or both of Issue 17 or Issue 8. But an important difference is that this is actually the first thing on the page, as indicated by the pagebreak.

Any advice on a workaround? I do need the figure, unfortunately. The display should span both columns of the page.

@tingerrr
Copy link
Owner

tingerrr commented Nov 4, 2024

Yes, indeed, it is related to #8 and #17, specifically because this is a float who's real position is somewhere within the page, hydra thinks there may be content before this heading, prompting it to show that one still.

You're likely missing the use-last parameter, which instructs hydra to consider headings on the current page (maybe a little bit of a misnomer). With use-last: true it will consider any level: 2 heading on the current page and take the last one and work as you likely intended. Could you give that a try and see if that solves the issue for you?

skip-starting and use-last kind of oppose each other, this is a little bit of a rough edge in the API. I'll improve this in the next version, alongside the much-needed doc improvements.

@Tetragramm
Copy link
Author

That does work, thank you. And since I'm using a pagebreak, I'm guaranteed not to have another on the same page.

Apologies, I thought I had tried all the parameters, but either the situation with the document was different and it didn't work, or I missed this one. Thank you for your help!

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