How do I set the line spacing like LaTeX?

I created the function below:

#let citacao(body) = block(
  width: 100%,
  inset: (
    left: 4cm,
    top: 0pt,
    bottom: 0pt,
    right: 0pt,
  ),
  breakable: true,
)[
  #set text(size: 10pt)
  #set par(leading: 11.5pt - 1em)
  #body
]

But it isn’t producing the desired result, likely because 1em is based on 12pt rather than 10pt. Could someone help me? Undesired result:


Desired result (Edit: produced in LaTeX):

In other words, I need a 10pt font with 11.5pt line spacing, but that is only possible using the subtraction 11.5pt - 1em.

Hello @Elayson,

I have failed to reproduce your results. For example:

#let citacao(body, size) = block(
  width: 100%,
    inset: (
    left: 4cm,
    top: 0pt,
    bottom: 0pt,
    right: 0pt,
  ),
  breakable: true,
)[
  #set text(size: 10pt)
  #set par(leading: 11.5pt - size)
  #body
]

1em
#citacao(lorem(22), 1em)

10pt
#citacao(lorem(22), 10pt)

12pt
#citacao(lorem(22), 12pt)

Leads to:

Are you using Typst 0.15.1? Is that code originally included into a show rule? Can you try the code I have provided and confirm if you still get the issue?

This may well be of interest:

On a side note, if you could please edit the title of you post to be in accordance with our guidelines:

We hope that this will make it easier for others to find answers to the same question.

Im using Typst 0.15.1. The first image I sent was created in Typst. The second was created in LaTeX. I used the code you sent me, and the result was the same. I edited my title to make it clearer. I read a post about how to set the interlinespacing, but I didn’t understand it. I wouldn’t be able to say if it’s the same problem I’m facing.

Edit: Can I exchange 1em for 10pt?