Skip to content

KaTeX wrong alignment for inline math block due to height #2922

Closed
@Quar

Description

Issuehunt badges

Current behavior

It seems version 0.11.15 has wrong alignment for inline math block, for example:

Test
=====


If we try $x = a$, it does not work.

If we let $x = a$, and $y = a$, then $x = y$, none of them align correctly.

If we try $x^{b^b}$, it aligned well.

If we try $x = a^b$, it aligned well, but does not work with $x = a$.

will be shown as:

image

Expected behavior

image

Steps to reproduce

  1. just type in the markdown code block
Test
=====


If we try $x = a$, it does not work.

If we let $x = a$, and $y = a$, then $x = y$, none of them align correctly.

If we try $x^{b^b}$, it aligned well.

If we try $x = a^b$, it aligned well, but does not work with $x = a$.

Environment

  • Version : 0.11.15
  • OS Version and name : macOS 10.14.3

Brief Investigation

Noting it renders correctly if the math block having superscript like a b .

Further checking in developer mode, found that for the correctly rendered block like a b it has

<span class="struct" style="height:0.849108em;"></span>

while for the inappropriately rendered block like a , it has

<span class="struct" style="height:0.43056em;"></span>

image

after change the height:0.43056em to height:0.849108em, it seems aligned well

image


IssueHunt Summary

amedora amedora has been rewarded.

Sponsors (Total: $40.00)

Tips

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    improvement request 🔨Issue concerns an existing feature that needs improvement.rewarded on issuehunt 🎁Issue has been resolved and a contributor has been rewarded.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions