typst icon indicating copy to clipboard operation
typst copied to clipboard

Align equation number vertically to the formula baseline - `number-align` in `math.equation`

Open asmarcz opened this issue 9 months ago • 1 comments

Description

When a single-line math formula is presented, I would like to have the equation number aligned with the correct baseline. Now, if you include for example a sum, the height of the block is adjusted and the equation number is aligned with respect to the total height. This is not the case in LaTex, for example. Compare the first (LaTex) and second (Typst) snippets along with a rendered images.

\begin{equation}
    c_{t+1}(v) = c_{t}(v) - deg(v) \cdot  \mathbb{1}(c_{t}(v) - deg(v)) + \sum_{u \in N(v)} \mathbb{1}(c_{t}(u) - deg(u)) \quad \forall v \in V
\end{equation}

image

#set math.equation(numbering: "(1)", number-align: end + horizon)

$ c_(t+1)(v) = c_(t)(v) - deg(v) dot.c bb(1)(c_(t)(v) - deg(v)) + sum_(u in.small N(v)) bb(1)(c_(t)(u) - deg(u)) wide forall v in V $

image

Use Case


asmarcz avatar Apr 25 '24 13:04 asmarcz

Hi - I wrote the number-align feature. I think this issue of undesired output should better be categorized as a bug and let me fix it.

Leedehai avatar Apr 26 '24 22:04 Leedehai