Using multiple dollar signs in edit mode results in MathJax styling inappropriately

Steps to reproduce

Type the following:

FIRE says that to live on $60k per year in retirement I would need $1.5M total. Or I can cut my expenses to $40k ($1M).

Expected result

Standard non-formatted text.

Actual result

Edit mode:

image

Preview mode is styled correctly:

FIRE says that to live on $60k per year in retirement I would need $1.5M total. Or I can cut my expenses to $40k ($1M).

Environment

  • Operating system: MacOS 10.15.7
  • Obsidian version: 0.11.12

Additional information

1 Like

I’m fairly sure this is expected behavior. Does it work if you escape (i.e., \$) the dollar signs?

Yes I understand it is expected behavior when attempting to use LaTeX, but it also is an annoying side effect when using regular dollar signs instead of LaTeX. It works correctly when entering the escaped version.

Since the number of people who will use dollar signs to mean dollar signs is probably much higher than those who will use LaTeX this seems a bit backwards.

I don’t know what the solution should be though, since I myself also use LaTeX in Obsidian, but not nearly as much. Perhaps it should be resolved through a CSS snippet, but that would then require people to jump through a hoop to get “regular” behavior. Perhaps a toggle to style LaTeX in edit mode, but then that is creating yet another toggle which also seems undesirable.

The fundamental problem is that making it work “properly” for normal use means it doesn’t work “properly” for LaTeX use, and vice versa.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.