artisticat1 / obsidian-latex-suite

Make typesetting LaTeX as fast as handwriting through snippets, text expansion, and editor enhancements
MIT License
1.38k stars 55 forks source link

[DOCS] Vertical and diagonal ellipses in matrices #311

Closed borenstein closed 4 months ago

borenstein commented 4 months ago

Description

When I am creating a matrix in my notes, I almost always need \vdots and \ddots. But when I try to type either of these in while using Latex Suite, eager substitution turns it into, e.g., \\ddot{s}.

I tried to fix this by adding snippets for vdots and ddots, but these interfere with the existing snippets, resulting in additionally problematic behavior.

The only solution I've found so far is to disable the plugin and then re-enable it. I'm sure there is a correct way to do it, but I can't figure out what it is.

Importance

This is a fundamental piece of functionality, without which the plugin most definitely does not let me type math as fast as I can handwrite it, or even as fast as I can type it without the plugin. Given the 150,000 users of the plugin, I'm absolutely certain there must be a way to do this, but I don't know what it is.

artisticat1 commented 4 months ago

Yes, this seems like an oversight with the current default snippets.

Some ideas to solve this:

borenstein commented 4 months ago

Thank you! I like the idea of disabling ddot and then creating new ddots and vdots snippets. I tried to figure out how to do this, but I admit that I'm a little confused about how to reason around the snippets, because it seems like there must be some kind of execution priority. Could you please tell me what changes to make? Thank you for your patience.

artisticat1 commented 4 months ago
{trigger: '\\dot{d}s', replacement: '\\ddots', options: 'mA'},
{trigger: '\\dot{v}s', replacement: '\\vdots', options: 'mA'},

should work if you're looking to implement my first two suggestions.

You can have a read through the docs if you're confused about execution order.

borenstein commented 4 months ago

🙌 Bravo!!