Skip to content

modern-technique-report:0.1.1 #2335

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

modern-technique-report:0.1.1 #2335

wants to merge 1 commit into from

Conversation

geoextra
Copy link

@geoextra geoextra commented May 8, 2025

I am submitting

  • a new package
  • an update for a package
  • FIX: Fixed the unexpected argument: fill exception caused by a breaking move of the fill property in Typst 0.13.0

@geoextra geoextra marked this pull request as draft May 13, 2025 14:14
@elegaanz
Copy link
Member

Hello, is there a particular reason this PR is a draft?

@geoextra
Copy link
Author

Hi, thanks for checking in!

There are more breaking changes in Typst 0.13 which I only discovered now.
From the changelog:

  • Removed body and page fields from outline entry
  • Added indented, prefix, inner, body, and page methods on outline entries to simplify writing of show rules

I'm struggling to migrate this part of the outline as I'm inexperienced with Typst:

show outline.entry.where(
  level: 1
): it => {
  set text(13pt, font: title-font)
  v(10pt)
  if type(it.body) == content {
    let cont = it.body
    strong(cont)
    h(1fr)
    strong(it.page) 
  } else {
    let cont = it.body.children
    grid(
      columns: 7,
      strong(cont.slice(0, 4).join(none)), h(0.4em), strong(cont.slice(6).join()), h(0.5em), h(1fr), h(0.5em), strong(it.page),
    )
  }
  v(-20pt)
}
show outline.entry.where(
  level: 2
): it => {
  set text(font: font, size: 10pt)
  let cont = it.body.children

  h(1em)
  cont.slice(0, 4).join(none)
  cont.slice(6).join()
  h(0.3em)
  box(width: 1fr)[#it.fill]
  h(0.3em)
  it.page
    
  v(-18pt)
}

I know that page and body become methods, but I haven't found a way to still access the childrens property. Is there a clean way to re-implement this outline?

@elegaanz
Copy link
Member

I'm not entirely sure what the proper way to use the new API is. I think it will be easier for you to get help by asking on the Discord (in the #support channel) or the forum (on which you can login using your typst.app account), I encourage you to make a post there.

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

Successfully merging this pull request may close these issues.

2 participants