Skip to content

Conversation

ntjess
Copy link
Contributor

@ntjess ntjess commented Sep 2, 2023

Use case: I want my slide header to always take up one line, regardless of how long that line is. This function solves the problem by allowing text to shrink to it's requested width

show heading.where(level: 2): it => {
  layout(layout-size => {
    fit-to-width(width: layout-size.width, it)
  })
}

#set page(height: auto)
#slide[
  == Lorem
]

#slide[
  == #lorem(10)
]

#slide[
  == #lorem(15)
]

Results in:

image

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.

1 participant