Overwrote default mathjax function

What I’m trying to do

I accidentally used \def while trying to write out a mathjax function. This ended up overwriting the default \frac command.

I need assistance removing the macro I accidentally created and restore \frac’s default behavior.

Where do macros get stored? Can I manually clear them out of a file? Can I delete them all with a single command? Can I reset all of the mathjax settings?

Things I have tried

I’ve tried googling for this issue, but I can’t find any answer besides deleting Obsidian and reinstalling it (I would really prefer to not have to reconfigure all of my plugins!).

I’ve also tried looking through my vault’s .obsidian folder for any configs where it might be stored, and can’t find anything outside of a database (which I’m not sure how to access).

It’s wild to me that it’s so easy to break such a core part of obsidian, I have to imagine there’s a way to fix this without deleting and reinstalling everything.

I have no idea why it worked this time, but I restarted the app again and the \frac command started working as it used to. I don’t know if I incorrectly used \def before and it didn’t permanently save.

Any clarity on why restarting the app worked would be appreciated!

In mathjax you can indeed set commands, like it is possible in latex. If you define a certain command in for example note X, and open note X, it will be active for that entire session and for all your other notes. It acts as a global setting. After restart it is cleared, until you open that note X again, then it will be activated again.

(If you open obsidian always with a specific note, you can activate certain commands there and it will be affecting all notes you will be opening afterwards)

1 Like

@JayKim To make sure I understand:

If I create a mathjax field like $\def\abc{123}$ in a note. As long as I leave it in the note, each time I open the note it will set the macro for the rest of the time I have Obsidian open.

If I delete the field and restart the app, it will be as if I never set it?

As far as I know yes

1 Like

@JayKim Thank you!

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