#[0.11.0-rc1] Accessing context from state updates

4 messages · Page 1 of 1 (latest)

hardy dove
#

This should clarify: #contributors message

pale escarp
#

you should be able to pull the measure out of the update:

#let s = state("s")
#s.update((:))

#let my-ctx(it) = {
  set text(size: 20pt)
  context it()
}

#my-ctx(() => {
  let width = measure(h(1em)).width
  s.update(d => {
    d.insert("1em", width)
    d
  })
})
hardy dove
#

In the future it will probably become a hard error

#

To not do so