flavio20002 / typst-orange-template

The Legrand Orange Book implemented in Typst
Other
64 stars 2 forks source link

Referencing figures #18

Open cnt5bs opened 3 months ago

cnt5bs commented 3 months ago

I appreciate your contribution; thank you. I had a problem when referencing figures with the "@" operation. I have modified "typst-orange.typ" to correct the problem:

  set figure(
    gap: 1.3em,
    numbering: it => {
      locate(loc => {
        // cnt5bs
        // let chapter = counter(heading.where(level: 1)).at(loc).first()
        let chapter = context counter(heading.where(level: 1)).get().at(0)
        box[#chapter.#it] 
      })
    }
  )

Be at peace.