Math block live preview

Is there any way to preview a math block in Obsidian live preview

e.g.

 ```math
 f(x)
 ```

You could use latex:

$$
f(x)
$$

It gives a preview

My problem is when displaying math on github markdown using the following formula, it’s not showing correctly.

$$
t=\frac{\hat{b}j - b_j}{s{\hat{b}_j}}
$$

I can only work it around using the math block. But it’s not showing in obsidian.

```math
t=\frac{\hat{b}_j - b_j}{s_{\hat{b}_j}}
```

Therefore, I am wondering if obsidian supports previewing the math block.

Your latex code is missing underscores. What is the reference to GitHub? I use latex a lot in R notebooks which display normally on GitHub pages.

The original code is:

$$
t=\frac{\hat{b}_j - b_j}{s_{\hat{b}_j}}
$$

It’s not showing correctly in a markdown file on GitHub. But a math block works.

What do you mean that is not showing correctly on GitHub? Are you syncing the file from your vault to github, and it fails to show properly on GitHub but OK within Obsidian?

Yes. The problem is with the following math equation.

$$
t=\frac{\hat{b}_j - b_j}{s_{\hat{b}_j}}
$$

This shows correctly in Obsdian, but not showing properly on Github markdown. Only changing the $$ $$ fence to a math block shows properly on Github. I wonder if there is anyway Obsidan may support math block so that I can use math block in both Obsidian and Github markdown. The screenshot of the first post is previewing in Obsidian.

Here is the screenshot when viewing in GitHub. The first is using the math fence, and the second is using a math block.

Ok I understand. I realize that I save my notebooks to html and use GitHub’s Pages feature to view them. You could save your vault as html and put that on GitHub.

Thanks. I will try that. Another follow up question: is there any way to export the vault as one pdf?

There’s a plugin but imo results aren’t pretty. I find exporting to html produces great results.

1 Like

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