# Block Math Syntax discrepancy between editor and reading mode (LaTeX)

**URL:** <https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922>\
**Category:** Bug reports\
**Tags:** reading, repro, important, math, editor-parser\
**Created:** [May 3, 2026, 9:03pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922 "2026-05-03T21:03:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [May 3, 2026, 9:03pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/1 "2026-05-03T21:03:37Z")

</div>

Currently the only block math supported by Obsidian should be in the following form:

```auto
text
$$x+1$$
text

```

or

```auto
text
$$
x+1
$$
text

```

Anything else should NOT be interpreted as a math block. The reading mode follows this rule, the editor does not and may give to the user the impression that a valid math block was inserted. When this happens, there is a discrepancy between what appears in editor mode and what appears in reading mode. Sometimes, the document is severely broken in reading mode, with resulting negative consequences to the document parsing made by obsidian’s indexer (missing links, outline not working).

The solution is either to fix the editor parser to act like the reader one, or viceversa.

---

<div class="post-metadata">

**Author:** ![gruenschnabel](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@gruenschnabel](https://forum.obsidian.md/u/gruenschnabel)\
**Post date:** [April 20, 2026, 9:08pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/2 "2026-04-20T21:08:54Z")

</div>

**Once you’ve done the above, delete everything above this line.**

### Steps to reproduce

- Open an empty note.
- Add one or multiple headings.
- Add a (LaTeX) math block ($$ … $$) before one or more of the headings.
- Immediately after the last $$ type a space and some letters.
- Finally type [[# somewhere in the document and/or open the outline in the sidebar.

#### Example

Full example note (only part inside code block):

```auto
# H1
[[#H2]]
$$
a+b=c
$$ abc
# H2

```

Rendered, the abc after $$ only appears in the next row, looking like a line break.  
The link to H2 isn’t working and H2 doesn’t show up in outline.

### Did you follow the troubleshooting guide? [Y/N]

Yes

### Expected result

I expect [[# to suggest all existing headings in the document. Also I expect to see all existing headings in the outline. Alternatively, I expect some visual cue that there is a problem with the syntax - be it the maths block not being correctly displayed.

### Actual result

All headings after the maths block are gone from the outline and not possible to link to via [[#

### Environment

SYSTEM INFO:  
Obsidian version: 1.12.7  
Installer version: 1.8.10  
Operating system: Windows 11 Pro 10.0.26100  
Login status: not logged in  
Language: de  
Insider build toggle: off  
Live preview: on  
Base theme: adapt to system  
Community theme: none  
Snippets enabled: 0  
Restricted mode: on  
RECOMMENDATIONS:  
none

Same behaviour on Android 16 (1.12.7) and older version (1.6.7) on Kubuntu (only had old version available, assuming this is a general behavior).

* * *

### Additional information

none

---

<div class="post-metadata">

**Author:** ![ariehen](https://forum.obsidian.md/user_avatar/forum.obsidian.md/ariehen/32/46932_2.png) [@ariehen](https://forum.obsidian.md/u/ariehen)\
**Post date:** [April 20, 2026, 9:22pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/3 "2026-04-20T21:22:49Z")

</div>

If you switch to Reading view, you’ll see it’s not rendering correctly:

 ![IMG_0185](https://forum.obsidian.md/uploads/default/original/3X/b/c/bc369baafae909f90822de9ee1e07a13515b756a.jpeg)

The `$$`s should be in their own lines.

```auto
# H1
[[#H2]]
$$
a+b=c
$$ 
abc
# H2

```

↑ works as expected.

---

<div class="post-metadata">

**Author:** ![gruenschnabel](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@gruenschnabel](https://forum.obsidian.md/u/gruenschnabel)\
**Post date:** [April 20, 2026, 9:26pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/4 "2026-04-20T21:26:25Z")

</div>

In that case, the actual bug is that it renders correctly and without any visual cue in editing view.

---

<div class="post-metadata">

**Author:** ![Jopp](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/j/8e7dd6/32.png) [@Jopp](https://forum.obsidian.md/u/Jopp)\
**Post date:** [April 21, 2026, 5:01am UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/5 "2026-04-21T05:01:18Z")

</div>

That’s no bug.

One pair of `$$` opens the math block **after which** you can insert a formula.  
Another pair of `$$` closes the math block.

You add more (math) expressions **after the closing pair**. That’s not the logic of a closing math block.

---

<div class="post-metadata">

**Author:** ![gruenschnabel](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@gruenschnabel](https://forum.obsidian.md/u/gruenschnabel)\
**Post date:** [May 3, 2026, 8:12pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/6 "2026-05-03T20:12:47Z")

</div>

Like I said, in that case the actual bug is that rendering in default editing mode is incorrectly. There’s no way to even spot there’s something wrong, not even while editing the math block itself.

This is what it looks like to the editing person:

 ![image](https://forum.obsidian.md/uploads/default/original/3X/7/a/7abb1cb5e289dee2bfc2dd81c6d84be87a983f0c.png)

THe math block visibly ends after the equation, you can’t even notice the missing line break. The only visible clue that the line break is missing is the missing headings - which is quite obscure.

If that’s intended behavior, I expect it to behave like code blocks. That is, if you (accidentally) type something after the ending ``` on the same line, the code block visibly continues - both in editing and reading mode. This is a bug with rendering in the default editing view.

---

<div class="post-metadata">

**Author:** ![Nathaniel](https://forum.obsidian.md/user_avatar/forum.obsidian.md/nathaniel/32/59783_2.png) [@Nathaniel](https://forum.obsidian.md/u/Nathaniel)\
**Post date:** [November 9, 2025, 3:21pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/7 "2025-11-09T15:21:28Z")

</div>

I was puzzled by a backlink not appearing in the linked mentions pane, and I was able to track down a way to reproduce it. Basically if you enter an equation without a newline after it, like this

```plaintext
Here is an equation
$$
   x = x + 1
$$and here is some text after it

```

instead of

```plaintext
Here is an equation
$$
   x = x + 1
$$
and here is some text after it

```

then any links after that won’t be counted as backlinks in the document they link to. This is hard to spot because the live preview renders identically in both cases, so you can’t easily see if you’ve done this.

### Steps to reproduce

- open the sandbox vault
- create a file ‘Test 1’ with the following text

```plaintext
Here is an equation
$$
   x = x + 1
$$and here is some text after it

[[Test 2]]

```

- click the link to create the ‘Test 2’ file
- open the linked mentions panel

The link from ‘Test 1’ won’t be listed as a backlink.

However, either of the following will cause it to be listed again

- put a newline (or even a space) after the second `$$`, or
- move the `[[Test 2]]` link before the equation

### Did you follow the troubleshooting guide? [Y]

### Expected result

Either backlinks should appear in both cases or else there should be an error or other indication that the syntax is incorrect.

### Actual result

If a document contains an equation entered this way, any links after the equation are not counted as backlinks.

### Environment

SYSTEM INFO:  
Obsidian version: v1.9.14  
Installer version: v1.8.4  
Operating system: Darwin Kernel Version 23.6.0: Thu Apr 24 20:26:36 PDT 2025; root:xnu-10063.141.1.705.2~1/RELEASE\_X86\_64 23.6.0  
Login status: not logged in  
Language: en  
Insider build toggle: off  
Live preview: on  
Base theme: adapt to system  
Community theme: none  
Snippets enabled: 0  
Restricted mode: on

RECOMMENDATIONS:  
none

* * *

---

<div class="post-metadata">

**Author:** ![ariehen](https://forum.obsidian.md/user_avatar/forum.obsidian.md/ariehen/32/46932_2.png) [@ariehen](https://forum.obsidian.md/u/ariehen)\
**Post date:** [November 9, 2025, 11:08pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/8 "2025-11-09T23:08:49Z")

</div>

I’m fairly certain the opening and closing double `$$`s for MathJax blocks need to be on their own lines with nothing else. Your

```auto
Here is an equation
$$
   x = x + 1
$$and here is some text after it

[[Test 2]]

```

example isn’t working/rendering in Reading view (in addition to causing the backlinks issue).

source mode | reading view

![Obsidian_Ms12Py4Bds](https://forum.obsidian.md/uploads/default/original/3X/3/8/38eda5845eda0f243f69cb34e2e277e429029fd7.gif)

---

<div class="post-metadata">

**Author:** ![Nathaniel](https://forum.obsidian.md/user_avatar/forum.obsidian.md/nathaniel/32/59783_2.png) [@Nathaniel](https://forum.obsidian.md/u/Nathaniel)\
**Post date:** [November 10, 2025, 12:12pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/9 "2025-11-10T12:12:59Z")

</div>

The issue is that in live preview they render identically. So if you always work in the live preview pane as I do, then you can’t tell if you’ve made this mistake or not. It can easily happen by accident, and then the backlinks stop working with no indication as to why.

I agree that it should probably be considered incorrect syntax, but then it shouldn’t render as if it’s correct in the live preview.

Even though it is incorrect syntax, I guess that shouldn’t prevent backlinks from working. [This message](https://forum.obsidian.md/t/backlinks-not-appearing-consistently-in-graphs-or-linked-mentions/4364/7) suggests that bugs of the form “a specific kind of bad syntax stops backlinks from working” have been fixed before.

---

<div class="post-metadata">

**Author:** ![Nathaniel](https://forum.obsidian.md/user_avatar/forum.obsidian.md/nathaniel/32/59783_2.png) [@Nathaniel](https://forum.obsidian.md/u/Nathaniel)\
**Post date:** [November 10, 2025, 12:14pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/10 "2025-11-10T12:14:47Z")

</div>

I didn’t think to check before, but this also affects the graph view, not just backlinks. (To reproduce, follow the steps above and enter the graph view - the nodes “Test 1” and “Test 2” will not be linked.)

---

<div class="post-metadata">

**Author:** ![mycasid](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/m/779978/32.png) [@mycasid](https://forum.obsidian.md/u/mycasid)\
**Post date:** [November 10, 2025, 4:31pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/11 "2025-11-10T16:31:52Z")

</div>

similar bugs/syntax errors:

- [Quote and math block break internal links](https://forum.obsidian.md/t/quote-and-math-block-break-internal-links/106649)
- [Speciffic Indexing Bug with Latex $$ Syntax](https://forum.obsidian.md/t/speciffic-indexing-bug-with-latex-syntax/106692)

---

<div class="post-metadata">

**Author:** ![SomeSpace](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/s/c6cbf5/32.png) [@SomeSpace](https://forum.obsidian.md/u/SomeSpace)\
**Post date:** [October 9, 2025, 7:39am UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/12 "2025-10-09T07:39:25Z")

</div>

### Steps to reproduce

1. Create new empty node, say “Parent”
2. Create another node, say “Child”. With the following content

```auto
 >$$
\frac{d}{dx}(x^{n})=nx^{n-1}
$$

[[Parent]]

```

### Did you follow the troubleshooting guide? [Y/N]

Y

### Expected result

The Child note should be linked to the Parent node. Graph view should show connection between them.

### Actual result

The graph view doesn’t show the connection.  
In addition, Child’s outgoing links panel seems empty (and so Parent’s backlinks).

### Environment

SYSTEM INFO:  
Obsidian version: v1.9.14  
Installer version: v1.9.14  
Operating system: Windows 10 Pro 10.0.19045  
Login status: not logged in  
Language: en  
Insider build toggle: off  
Live preview: on  
Base theme: adapt to system  
Community theme: none  
Snippets enabled: 0  
Restricted mode: on

RECOMMENDATIONS:  
none

* * *

### Additional information

 ![image](https://forum.obsidian.md/uploads/default/original/3X/1/0/10128542bb74834442278b095689ecd1720905fa.png)

---

<div class="post-metadata">

**Author:** ![mycasid](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/m/779978/32.png) [@mycasid](https://forum.obsidian.md/u/mycasid)\
**Post date:** [October 9, 2025, 8:47am UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/13 "2025-10-09T08:47:00Z")

</div>

huh, what an odd bug.

fwiw the syntax for display math in block quotes should be

```auto
> $$
> \frac{d}{dx}(x^{n})=nx^{n-1}
> $$

```

and with this syntax the link afterward is tracked correctly. however this does not get rendered correctly, with `>` showing up in the equation. this is fixed by the community plugin [Better Math in Callouts & Blockquotes](https://github.com/RyotaUshio/obsidian-math-in-callout).

---

<div class="post-metadata">

**Author:** ![anon5277159](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/a/b5a626/32.png) [@anon5277159](https://forum.obsidian.md/u/anon5277159)\
**Post date:** [October 9, 2025, 9:50am UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/14 "2025-10-09T09:50:55Z")

</div>

Hi.

I don’t know why, but this appears to work:

```auto
> $$
\> \frac{d}{dx}(x^{n})=nx^{n-1}
\> $$

[[Parent]]

```

 ![math in callout](https://forum.obsidian.md/uploads/default/original/3X/2/a/2a3307bbebfca1232151dd89d5189951643ffaa9.jpeg)

---

<div class="post-metadata">

**Author:** ![CawlinTeffid](https://forum.obsidian.md/user_avatar/forum.obsidian.md/cawlinteffid/32/82899_2.png) [@CawlinTeffid](https://forum.obsidian.md/u/CawlinTeffid)\
**Post date:** [October 10, 2025, 2:15pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/15 "2025-10-10T14:15:23Z")

</div>

> [@SomeSpace](#):
>
> The graph view doesn’t show the connection.  
> In addition, Child’s outgoing links panel seems empty (and so Parent’s backlinks).

If you switch to Reading View (which usually renders things more accurately) you’ll see that the link is included as part of the equation. This probably explains what you’re seeing. I’m not sure if it’s the correct behavior or not.

> [@Quote and math block break internal links](https://forum.obsidian.md/t/quote-and-math-block-break-internal-links/106649/2):
>
> with this syntax the link afterward is tracked correctly. however this does not get rendered correctly, with `>` showing up in the equation.

This appears to be a quirk of Live Preview. It displays correctly in Reading View.

SYSTEM INFO:  
Operating system: ios 18.6.2 (Apple iPhone14,5)  
Obsidian version: 1.9.14 (241)  
API version: v1.9.14  
Login status: logged in  
Language: en  
Catalyst license: none  
Live preview: on  
Base theme: adapt to system  
Community theme: none  
Snippets enabled: 0  
Restricted mode: on

RECOMMENDATIONS:  
none

---

<div class="post-metadata">

**Author:** ![Kepler-69c](https://forum.obsidian.md/user_avatar/forum.obsidian.md/kepler-69c/32/71291_2.png) [@Kepler-69c](https://forum.obsidian.md/u/Kepler-69c)\
**Post date:** [October 7, 2024, 7:38pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/16 "2024-10-07T19:38:56Z")

</div>

### Steps to reproduce

Add a latex block (not inline latex) directly after a text (1) or inside a comment (2). All titles and subtitles after the latex block stop being updated in the `outline` side panel.  
1)

```md
some text $$equation$$

```

2)

```md
> comment
> $$
equation
> $$

```

or

```md
> comment
> $$ equation $$

```

### Did you follow the [troubleshooting guide](https://forum.obsidian.md/t/about-the-bug-reports-category/24/10)? [Y/N] Y

### Environment

```log
SYSTEM INFO:
	Obsidian version: v1.6.7
	Installer version: v1.5.3
	Operating system: Darwin Kernel Version 19.6.0: Tue Jun 21 21:18:39 PDT 2022; root:xnu-6153.141.66~1/RELEASE_X86_64 19.6.0
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 9
	Plugins enabled: 3
		1: Periodic Notes v0.0.17
		2: Calendar v1.5.10
		3: Advanced Tables v0.22.0

RECOMMENDATIONS:
	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 happens on Linux (Flatpak, AppImage), same Obsidan version.

---

<div class="post-metadata">

**Author:** ![ariehen](https://forum.obsidian.md/user_avatar/forum.obsidian.md/ariehen/32/46932_2.png) [@ariehen](https://forum.obsidian.md/u/ariehen)\
**Post date:** [October 7, 2024, 11:25pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/17 "2024-10-07T23:25:54Z")

</div>

In a quick test, this breaks, i.e., doesn’t show the following headings in the Outline tab:

```auto
> comment
> $$
  \begin{vmatrix}a & b\\ c & d \end{vmatrix}=ad-bc 
  $$

```

The headings are fine using this, but you end up with an unwanted `>` in the math block.

```auto
> comment
> $$
  \begin{vmatrix}a & b\\ c & d \end{vmatrix}=ad-bc 
> $$

```

These seem working and the headings are fine:

```auto
> comment $$\begin{vmatrix}a & b\\ c & d \end{vmatrix}=ad-bc$$

> comment
> $$
  \begin{vmatrix}a & b\\ c & d \end{vmatrix}=ad-bc$$

```

* * *

Related:

> [@Live preview: support math block in quotes](https://forum.obsidian.md/t/live-preview-support-math-block-in-quotes/32564):
>
> Steps to reproduce Write a display math block with more than one line in blockquote. For example: \> $$ \> a+b+c \> $$ Expected result The math equation to be rendered correctly with no confusion. Actual result The leading character \> of blockquote is also rendered as a part of the math equation. [image] Environment Operating system: Mac OS 12.12 Debug info: SYSTEM INFO: Obsidian version: v0.13.24 Installer version: v0.12.19 Operating system: Darwin Kernel Version 21.3.0: Wed Jan 5 21…

---

<div class="post-metadata">

**Author:** ![clehene](https://forum.obsidian.md/user_avatar/forum.obsidian.md/clehene/32/42868_2.png) [@clehene](https://forum.obsidian.md/u/clehene)\
**Post date:** [November 13, 2023, 11:20pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/18 "2023-11-13T23:20:27Z")

</div>

# heading 1

Typing [[# heading here will find “heading 1”

$$$$

# heading 2

typing [[# here will only show “heading 1”.  
Basically all links are broken in the sense that they are not reachable in search, nor will they work.

Since empty $$$$ blocks are/seem legal, this is a bug.  
The bigger issue is that because $$$$ are invisible, it’s hard to spot what’s causign the problem. I did a binary search through the doc to figure out what’s wrong.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [August 27, 2024, 4:11pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/19 "2024-08-27T16:11:45Z")

</div>

Renamed for clarity.

---

<div class="post-metadata">

**Author:** ![third\_nature](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/t/71e660/32.png) [@third\_nature](https://forum.obsidian.md/u/third_nature)\
**Post date:** [January 27, 2026, 8:58pm UTC](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922/20 "2026-01-27T20:58:41Z")

</div>

Steps to reproduce

Have a line of text which ends with a `$$` LaTeX equation, with a newline directly before the closing `$$`.

### Did you follow the troubleshooting guide? [Y/N]

Y

### Expected result

Headings and LaTeX both work normally. In particular, headings can still be linked to from outside the file, and they show up in the outline pane.

### Actual result

Headings cannot be linked to from outside such a file, and do not show up in outline pane.

### Environment

SYSTEM INFO:  
Obsidian version: v1.11.5  
Installer version: v1.8.4  
Operating system: Darwin Kernel Version 25.2.0: Tue Nov 18 21:07:05 PST 2025; root:xnu-12377.61.12~1/RELEASE\_ARM64\_T6020 25.2.0  
Login status: logged in  
Language: en  
Catalyst license: none  
Insider build toggle: off  
Live preview: on  
Base theme: adapt to system  
Community theme: none  
Snippets enabled: 0  
Restricted mode: on  
RECOMMENDATIONS:  
none

* * *

### Additional information

 ![Screenshot 2026-01-27 at 14.56.52](https://forum.obsidian.md/uploads/default/original/3X/5/9/59638c2f81f91ecf443dcf4db2c38807914f42cc.jpeg)

 ![Screenshot 2026-01-27 at 14.56.18](https://forum.obsidian.md/uploads/default/original/3X/8/3/83dc627f2b0fb0ee83be6f4a54f8a51267fe7e0b.jpeg)

[Next page](https://forum.obsidian.md/t/block-math-syntax-discrepancy-between-editor-and-reading-mode-latex/113922.md?page=2)
