How to measure leading in a paragraph?

#context par.leading will give you the current value of leading at that exact location in the document. However, anything with context returns content so you can’t use this as a numerical value like 5 * #context par.leading.

Rather, any calculations and their resulting content should be done within this context expression, like so (see Why is the value I receive from context always content?):

#context {
  let leading = par.leading
  // your place calculation
  // return your place + box
}
1 Like