artisticat1 / obsidian-latex-suite

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

[BUG] auto enlarge brackets ignores existing explicit size control #268

Open a-viv-a opened 8 months ago

a-viv-a commented 8 months ago

Description

When bracket enlargement is triggered, existing size control will be ignored, leading to confusing errors.

To Reproduce

Start with

$$
\big(  \big) 
$$

Then inside the parentheses, trigger bracket enlargement (I reproduced with starting a fraction, 1/).

This results in the following which won't render, because it is invalid.

$$
\big\left(  \frac{1}{} \big \right) 
$$

Expected Behavior

Expected result would be

$$
\big(  \frac{1}{} \big) 
$$

or maybe

$$
\left(  \frac{1}{} \right) 
$$

although I strongly disagree with this "expected" behavior. The user explicitly configured the parenthesis size, and if it worked in this way there would be no means to change parenthesis size, as auto enlarge brackets will run for the entire environment if you use one of the triggers later.

I ran into this case when putting underbrackets on fractions inside parentheses and feeling that the parentheses was too large.

Additional Info

Thank you so much for an incredible extension! You enable me to do math proofs and notes, as someone unable to handwrite. :heart:

a-viv-a commented 8 months ago

Just noticed this is arguably a duplicate of #156, but since this has a more explicit reproduction I'll wait for a response before closing.

artisticat1 commented 8 months ago

although I strongly disagree with this "expected" behavior. The user explicitly configured the parenthesis size...

Agreed, this is unintended behaviour — I can look into this for a future release. I'll go ahead and close #156 in favour of this issue.

Thank you so much for an incredible extension! You enable me to do math proofs and notes, as someone unable to handwrite. ❤️

Glad the plugin is of use to you! 💚