Skip to content

Incorrect introspection in outline for headings using weak page breaks #4527

Closed

Description

@tingerrr

Description

The page numbers reported in the outline of the following code are off by one:

#outline()

#set page(numbering: "I.")
#set heading(numbering: "1.")
#show heading: it => pagebreak(weak: true) + it

= Hello
#lorem(1000)

= World
#lorem(1000)

image
World is located on page IV.

This was introduced somewhere between a2c9807 and 34990f7.

Reproduction URL

No response

Operating system

Linux

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Jul 9, 2024
  2. added
    urgent
    introspection
    on Jul 9, 2024
  3. Coekjan commented on Jul 9, 2024

    @Coekjan
    Contributor

    I used git bisect to find out that the bug was introduced at a52987a .

  4. laurmaedje commented on Jul 9, 2024

    @laurmaedje
    Member

    Yeah, I know what the bug is. The Tag ends up before the pagebreak in the new system. Need to find some way to deal with that.

  5. added a commit that references this issue on Aug 21, 2024
  6. Sagmedjo commented on Aug 28, 2024

    @Sagmedjo

    Could you please reopen this issue? My outline spans two pages, and the numbering is off by one until the page numbering switches from Roman numerals ("I") to Arabic numerals ("1"). Once the switch occurs, the problem disappears, and the counter resets correctly at the introduction.

    I'm using version 0.11.1.

  7. tingerrr commented on Aug 28, 2024

    @tingerrr
    ContributorAuthor

    Could you post an MRE?

  8. Sagmedjo commented on Aug 28, 2024

    @Sagmedjo

    Sorry, what do you mean by MRE?

  9. laurmaedje commented on Aug 28, 2024

    @laurmaedje
    Member

    I'm using version 0.11.1.

    The open/close status of issues reflects the state of the main branch. Please check if the issue persists if you compile Typst from the main branch.

    MRE = Minimum Reproducible Example

  10. Sagmedjo commented on Aug 28, 2024

    @Sagmedjo

    I've pinpointed the issue: everything was functioning correctly, but I mistakenly relied on a template, assuming it was properly configured. It turns out the creator began the page numbering at 0 and neglected to add page breaks after the outlines, even though the pages were separated. This led to the problem I encountered, but it’s not related to Typst.

    Apologies for any confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugintrospectionurgent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions