RyotaUshio / obsidian-latex-theorem-equation-referencer

A powerful indexing & referencing system for theorems & equations in your Obsidian vault.
https://ryotaushio.github.io/obsidian-latex-theorem-equation-referencer/
MIT License
165 stars 6 forks source link

Move towards latex syntax #213

Open mayurankv opened 10 months ago

mayurankv commented 10 months ago

I just wanted to create a new issue about ideally moving towards default latex syntax. I understand that this is potentially fairly complicated and dependent upon MathJax in Obsidian but it would be great if referencing in this plugin used similar syntax to latex. I.e. using \ref and \eqref and \label. This way there would be less compatibility issues with other markdown tools like pandoc.

I have looked into hacking the MathJax and it's pretty hard but assigning an id to the reference and being able to parse for \ref{id} in plaintext (not in math delimiters) and replace that with a math link would be great. There is still a problem with this in that the original wiki link wouldn't exist so probably wouldn't show up in back links or graph view etc. but I think this would be a great addition.

I see the end goal of this plugin as being able to use normal latex commands as usual and it would be good to have a thread/discussion to keep track of existing disparities and methods to overcome them!

RyotaUshio commented 10 months ago

Thanks again for the insightful suggestion. But for me, it's too much pain to give up Obsidian's great linking functionaliity.

As for the Obsidian→Pandoc compatibility, I'm thinking about adding a feature that converts thereom callouts and theorem/equation references into the pandoc format.

For Pandoc→Obsidian, it will be possible to make a pandoc filter. In fact, in the past I have tried converting .tex into .md files with formats compatible with this plugin. And it partially succeeded. (You can see the super-dirty code in the import branch of this repo) But this attempt failed mainly due to the fact that tex is much more complex than markdown. But if we only care markdown-to-markdown conversion, we can expect this kind of issue never occurs.

RyotaUshio commented 10 months ago

Another drawback of using the pure latex syntax is that it will make your notes depend on this plugin more and more. What if I suddenly stopped working on this plugin and nobody wants to maintain it instead of me? For me, it has a relatively high priority to eliminate plugin-dependent stuff.