How to change figure caption justification?

There actually is a difference, as only when using a show-set rule, the behavior can be changed later in the document again.

#show figure.caption: set align(left)
...
#show figure.caption: set align(center)

Trying to do the same in the “long form” won’t work, as the inner-most show rule (i.e. the bottom one) is applied first. Therefore, if you have something like this

#show figure: it => {
  set align(left)
  it
}

#show figure: it => {
  set align(center)
  it
}

#figure(...)

you can imagine it to be evaluated first to this

#show figure: it => {
  set align(left)
  it
}

#{
  set align(center)
  figure(...)
}

and then to this

#{
  set align(center)
  set align(left)
  figure(...)
}

The final alignment is now still left, even though it should have been overridden to center.

6 Likes