typst-orange-template icon indicating copy to clipboard operation
typst-orange-template copied to clipboard

Referencing figures

Open cnt5bs opened this issue 1 year ago • 0 comments

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.

cnt5bs avatar Apr 06 '24 15:04 cnt5bs