wei2912 / obsidian-latex

MIT License
146 stars 21 forks source link

Setting for preamble.sty location #11

Open JeppeKlitgaard opened 3 years ago

JeppeKlitgaard commented 3 years ago

Hi @xldenis

Thank you for making this plugin - I am finding it super useful.

I do find it slightly untidy to have my preamble in the root of the vault though, and I am wondering if you would implement a setting that can be used to specify the path to the preamble file? Perhaps this could include the option to specify more than one preamble file as well.

If you don't want to implement this yourself, I would be happy to submit a PR for it at some point during the next month.

xldenis commented 3 years ago

Hi! That sounds like a great idea. If you want to write a PR for it that will definitely be welcomed, otherwise I'll add this to my todo list, but I likely can't touch it until after a paper deadline in early july.

JeppeKlitgaard commented 3 years ago

Fantastic!

I have a few busy weeks ahead as well, but after that I'll have a look at putting together a quick PR!

Hunanbean commented 2 years ago

Here's hoping that you have time to institute this setting!

Thank you for the plugin. I consider it essential.

xldenis commented 2 years ago

oh hey! yea, I think this should be fairly simple to achieve.

JeppeKlitgaard commented 2 years ago

I have a personal setup that does this currently, but I am not sufficiently happy with the state of the code to make it available. I am having some trouble with the reliability of loading the MathJax, particularly on 0.13.

xldenis commented 2 years ago

If you push your code I can also take over. I'm currently investigating the issues with the live preview mode. Unfortunately, the way Obsidian & MathJax are built means this plugin is necessarily going to be a major hack.

JeppeKlitgaard commented 2 years ago

@xldenis I implemented this as part of another plugin I am making, but which is not yet published -- it really was just a setting and a vault read call, so nothing fancy

Elaws commented 2 years ago

Hi! Are there any news on that great FR ? Thanks :)

amzon-ex commented 2 years ago

Hi, noting the nature of this FR, I wonder if it would be possible to "choose the closest preamble" - i.e. have folder-level preamble settings.

The method would be this: Look for a preamble.sty file in the folder the note is contained in. If not found, check progressively the parent folders, until the root, which would be the global preamble.

Would this be possible to implement?

mayurankv commented 1 year ago

That suggestion from @amzon-ex sounds really useful!

xldenis commented 1 year ago

I'm no longer actively maintaining this, as indicated in the README I would be happy to hand off this plugin to someone else. If someone wants to write a PR, I'm happy to merge it though.