iOS MathJax (LaTeX) text characters misaligned jello effect - Also in Publish with Safari

At least in iPad OS and presumably in MacOS as well, (some) characters aren‘t aligned with the baseline.

This bug is a known MathJax Issue, however a solution has to be implemented internally to fix the Issue, because settings have to be altered upon loading MathJax. It happens because of RoundOf issues in WebKit.

Steps to reproduce

  1. Write some consequensive letters (best observed in \text{})
  2. Observe misaligned characters

Expected result

All letters should share a baseline

Actual result

Instead, the letters appear vertically offset:

  • Screenshot of the bug: image

Environment

This issue can be observed in iOS and isn‘t bound to Obsidian.
I‘m sadly not able to test this in MacOS, but according to the MathJax Bug-Report it should be present there as well.


Additional information

The solution is given in above mentioned Issue and here.

You may either add:

MathJax = {
  chtml: {
    mtextInheritFont: true
  }
}

or

MathJax = {
  chtml: {
    mtextFont: Times
  }
}

to inherit the Editor-Font or define a manual font, which doesn‘t have such issues.

Setting this on WebKit systems should resolve the issue!

1 Like

On mac we use chrome not webkit, so it doesn’t happen.
I think we’ll wait for the upstream fix.

Screenshot 2024-07-15 at 9.36.55 AM

This is still painful a year and a half later.

2 Likes

Steps to reproduce

Use mbox in an equation, e.g.:

$\mbox{softmax}(\frac{QK^T}{\sqrt{d_k}})V$

Did you follow the troubleshooting guide?

Yes

Expected result

Rendering like in LaTeX or Obsidian itself:

Screenshot 2024-06-29 at 11.57.16

Actual result

Rendered in Publish as:

Screenshot 2024-06-29 at 11.58.11

Notice that the letters in softmax are rendered as math symbols (squiggly), whereas they should be rendered as normal text.

(I also tried the amsmath \text command, but it has the same issue.)

Environment

SYSTEM INFO:
Obsidian version: v1.6.5
Installer version: v1.5.12
Operating system: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 23.5.0
Login status: logged in
Catalyst license: insider
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none

1 Like

I’ve been trying to force a newer version of mathjax with a style to fix this but have had no luck. Is this possible? If so how would I do it?

Still no fix after 3 years.