#Variable Figure Supplements with kind

9 messages · Page 1 of 1 (latest)

merry oyster
#

I would like to create a template rule that sets the figure supplement for regular figures to "Fig. " and the supplement for Tables to "Table".

Essentially, a "set where" clause would work the best (eg set figure.where(kind: image)(supplement: "Fig. ")), although of course this does not exist.

I could rewrite the entirety of figure rendering using a show clause to do this, but it seems obtuse.

Any ideas?

Desired result is attached.

#

Alternatively I'd like to just overwrite the lang file's supplement for image figures

#

This doesn't work either, counter-intuitively: show figure.where(kind: table): set figure(supplement: "TEST")

timber tree
#

for now

#

?render

#set figure(supplement: it => {
  if it.func() == table {
    "Table"
  } else {
    "Fig."
  }
})

#figure(rect(), caption: "aa")
#figure(table(), caption: "aa")
timber tree
#

will do