Can't do math in text in inline math

Steps to reproduce

  1. Paste $math \text{ text $math$ text } math$

Expected result

<div class="cm-line"><img class="cm-widgetBuffer" aria-hidden="true"><span class="math" contenteditable="false"><mjx-container class="MathJax" jax="CHTML" display="true" style="position: relative;"><mjx-math display="true" class="MJX-TEX" aria-hidden="true" style="margin-left: 0px; margin-right: 0px;"><mjx-mi class="mjx-i"><mjx-c class="mjx-c1D45A TEX-I"></mjx-c></mjx-mi><mjx-mi class="mjx-i"><mjx-c class="mjx-c1D44E TEX-I"></mjx-c></mjx-mi><mjx-mi class="mjx-i"><mjx-c class="mjx-c1D461 TEX-I"></mjx-c></mjx-mi><mjx-mi class="mjx-i"><mjx-c class="mjx-c210E TEX-I"></mjx-c></mjx-mi><mjx-mrow><mjx-mtext class="mjx-n"><mjx-c class="mjx-cA0"></mjx-c><mjx-c class="mjx-c74"></mjx-c><mjx-c class="mjx-c65"></mjx-c><mjx-c class="mjx-c78"></mjx-c><mjx-c class="mjx-c74"></mjx-c><mjx-c class="mjx-cA0"></mjx-c></mjx-mtext><mjx-texatom texclass="ORD"><mjx-mi class="mjx-i"><mjx-c class="mjx-c1D45A TEX-I"></mjx-c></mjx-mi><mjx-mi class="mjx-i"><mjx-c class="mjx-c1D44E TEX-I"></mjx-c></mjx-mi><mjx-mi class="mjx-i"><mjx-c class="mjx-c1D461 TEX-I"></mjx-c></mjx-mi><mjx-mi class="mjx-i"><mjx-c class="mjx-c210E TEX-I"></mjx-c></mjx-mi></mjx-texatom><mjx-mtext class="mjx-n"><mjx-c class="mjx-cA0"></mjx-c><mjx-c class="mjx-c74"></mjx-c><mjx-c class="mjx-c65"></mjx-c><mjx-c class="mjx-c78"></mjx-c><mjx-c class="mjx-c74"></mjx-c><mjx-c class="mjx-cA0"></mjx-c></mjx-mtext></mjx-mrow><mjx-mi class="mjx-i"><mjx-c class="mjx-c1D45A TEX-I"></mjx-c></mjx-mi><mjx-mi class="mjx-i"><mjx-c class="mjx-c1D44E TEX-I"></mjx-c></mjx-mi><mjx-mi class="mjx-i"><mjx-c class="mjx-c1D461 TEX-I"></mjx-c></mjx-mi><mjx-mi class="mjx-i"><mjx-c class="mjx-c210E TEX-I"></mjx-c></mjx-mi></mjx-math><mjx-assistive-mml unselectable="on" display="block"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mi>m</mi><mi>a</mi><mi>t</mi><mi>h</mi><mrow><mtext>&nbsp;text&nbsp;</mtext><mrow data-mjx-texclass="ORD"><mi>m</mi><mi>a</mi><mi>t</mi><mi>h</mi></mrow><mtext>&nbsp;text&nbsp;</mtext></mrow><mi>m</mi><mi>a</mi><mi>t</mi><mi>h</mi></math></mjx-assistive-mml></mjx-container></span><img class="cm-widgetBuffer" aria-hidden="true"></div>

Actual result

$math text{ text math text } math$

only the innermost math is rendered as math
In math blocks this works fine

Environment

  • Operating system: Windows 10
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v1.0.3
    Installer version: v0.15.9
    Operating system: Windows 10 Home Single Language 10.0.19044
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: light
    Community theme: Obsidianite
    Snippets enabled: 2
    Restricted mode: off
    Plugins installed: 17
    Plugins enabled: 14
    1: Latex Environments v0.3.0
    2: Templater v1.15.3
    3: Excalidraw v1.7.27
    4: Dataview v0.5.47
    5: Advanced Tables v0.17.3
    6: Obsidian Functionplot v1.2.1
    7: Commander v0.3.0
    8: Shell commands v0.16.0
    9: Plotly v0.0.6
    10: Latex Suite v1.6.4
    11: Extended MathJax v0.3.0
    12: MathLinks v0.2.5
    13: Obsidian Math+ v0.4.2
    14: TikZJax v0.5.1

RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.


Additional information

Also reproducible in sandbox without plugins
In reading mode displayed as error

P.S.
Expected result:

math text math text math

couldn't paste because "limit of 5" (even though I only had 2)

thanks. the truth is that we don’t support it and I am not sure when we will. I’ll leave this here in bug reports.

@vlad2305m You can use alternative delimiter \(...\) for inline math inside the \text{...} command:

$math \text{ text \(math\) text } math$

This will render correctly as:

Screenshot 2022-11-14 at 15.36.57

3 Likes