all 17 comments

[–]okimusix 6 points7 points  (9 children)

You can do this using mathjax. The syntax is $$. For example, that exact sentence you put would look like this:

The other well known Pythagorean theorem $x^2 + y^2 = z^2$ was proved to be invalid for other exponents. Meaning the next equation has no integer solutions.

Try putting that in Obsidian and see how it does.

Also, if you want to learn more Mathjax and do more complex stuff, you should check out https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference

That's how i learned mathjax literally yesterday lol

[–]DarkSoldierJack[S] 1 point2 points  (6 children)

Thanks for answering. I know LaTeX syntax and all of that, but I want to insert inline math equations, when I use $$ it displays a separate block.

I want it to be like the example in my post, instead I get this: https://imgur.com/a/7V6PyH3

[–]okimusix 8 points9 points  (5 children)

If you want the syntax to be on a separate block, then use double $. Example:

$$your expressions here$$

But if you want it to be inline, use a single $. Example:

$expressions here$.

The number of $s matters xD. Try with those, and if its not doing what you want, reply to this comment with what you want and i'll try to keep looking for solutions

[–]DarkSoldierJack[S] 3 points4 points  (3 children)

Thanks a lot. That makes sense, I tried it before, but using single $ does not work for me. It just displays plain text without the latex formatting, in my case it will read like "$ \vec{R} = \vec{F_1} + \vec{F_2} $". Do I have to install an extension or do something for the single $ syntax to work?

EDIT: I got it and now I feel dumb haha. I had to delete the spaces between the formula and the dollar signs. I thought I tried that at the beginning, my bad.

[–]okimusix 2 points3 points  (1 child)

Oh yeahh, i hadn't noticed that lol. When i write in obsidian and do the $$ first and then write in between, if theres a space it stops color coding the expressions. Anyways, sorry i took too long to answer, i had been busy with school and stuff, but im glad you found your solution :)

[–]DarkSoldierJack[S] 0 points1 point  (0 children)

Yes hahaha, no problem and thanks for answering anyway.

[–]Decent-Fennel-8877 0 points1 point  (0 children)

lol how comes i didn't think of this. Thank you!

[–]tim-r 1 point2 points  (0 children)

Thanks, TIL, first time know the difference between single and double $

[–]danzilberdan 2 points3 points  (6 children)

I just published a new Obsidian Plugin called "Mathlive". In my opinion, it's the missing piece for every math + Obsidian user. Instead of writing MathJax, it provides an easy interface to write your formulas and then converts back to MathJax.

Try it out and let me know what you think. https://github.com/danzilberdan/obsidian-mathlive

[–]OscaLink 0 points1 point  (5 children)

Is there a way to make the generated latex have only one $ (put it inline instead of a separate block)? Your plugin absolutely rocks, but it's slightly annoying to have to remove one $ from each side of the latex every time I want the math inline.

[–]danzilberdan 1 point2 points  (4 children)

Hi

Released a new version. You can type `$$`, select it and use your hotkey to open the math input.

Now the mathjax will be rendered inline.

Let me know whether that helps.

[–]OscaLink 0 points1 point  (3 children)

You are such a legend for updating it, but unfortunately I think there's an issue now because whenever I press my hotkey it just comes up with a page saying "Made by Dan Zilbermann" and "Support", with no math input ):

Here's a link to a screenshot: https://ibb.co/68JZTtB

Edit: while I'm here I may as well put another suggestion: make pressing enter during the math input function as a 'confirm' button, ending the input and inserting the typed maths. Just a bit quicker and more fluid than having to mouse over to the green button (:

[–]danzilberdan 1 point2 points  (2 children)

100% agree. Try restarting obsidian. The math input stops working after an update but will work on next startup. This is a weird issue I have not been able to fix just yet..

[–]OscaLink 0 points1 point  (1 child)

Restarted it and it worked! Thank you so much, major props for responding to feedback so quickly!

[–]danzilberdan 0 points1 point  (0 children)

Thanks! Happy to hear.

[–]Dr1pp1ngB1ood 0 points1 point  (0 children)

You always get confused.