Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
asmarcz opened this issue Apr 25, 2024 · 1 comment · Fixed by #4024
Closed
Labels
bug Something isn't working math Related to math syntax, layout, etc.

Comments

@asmarcz
Copy link

asmarcz commented Apr 25, 2024

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 asmarcz added the feature request New feature or request label Apr 25, 2024
@Leedehai
Copy link
Contributor

Leedehai commented Apr 26, 2024

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.

@laurmaedje laurmaedje added bug Something isn't working math Related to math syntax, layout, etc. and removed feature request New feature or request labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working math Related to math syntax, layout, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants