obsidian-latex-suite icon indicating copy to clipboard operation
obsidian-latex-suite copied to clipboard

FR: suppose more LaTeX code in the conceal feature

Open YIRU69 opened this issue 2 years ago • 13 comments

image image Above the pic, suppose more latex code in the conceal feature

  1. \lim\limits-->lim
  2. \displaystyle{\frac{A}{B}}-->A/B
  3. \sum\limits_{}-->$\sum$
  4. \cdots -->...

YIRU69 avatar May 30 '22 08:05 YIRU69

Thank you for the suggestions!

Regarding \frac{A}{B}, it might be misleading if you've written e.g. \frac{A}{B}C which gets displayed as A/BC.

I'll try to handle \limits, \displaystyle and dots.

artisticat1 avatar May 30 '22 08:05 artisticat1

@artisticat1 Maybe try to add () just like \frac{A}{B}C-->(A/B)C.

YIRU69 avatar May 30 '22 09:05 YIRU69

image Converted to ((A+B/C+D)/(a+b/c+d))

YIRU69 avatar May 30 '22 09:05 YIRU69

I think that \lim_{a \to b} may to convert to same like \sum. Convert the a \tp b to subscript image

YIRU69 avatar May 30 '22 09:05 YIRU69

@artisticat1 Maybe try to add () just like \frac{A}{B}C-->(A/B)C.

Yeah, I thought of that too. I wasn't sure about it though since (A/B)C implies there are brackets surrounding the fraction, like (\frac{A}{B})C, when there are none.

image Converted to ((A+B/C+D)/(a+b/c+d))

That looks nice, however! I'll definitely give this a shot.

artisticat1 avatar May 30 '22 09:05 artisticat1

I think that \lim_{a \to b} may to convert to same like \sum. Convert the a \tp b to subscript image

A problem with converting a \to b to subscript is that there is no unicode character for a subscript arrow. I can implement this by using e.g. <sub></sub> html tags instead, maybe in a future release.

artisticat1 avatar May 30 '22 09:05 artisticat1

a as subscript and b as superscript. Can it work?

YIRU69 avatar May 30 '22 09:05 YIRU69

This style may be adjusted. It's just the aesthetic aspect, I don't care it. And I really appreciate your plugin. image

YIRU69 avatar May 30 '22 09:05 YIRU69

a as subscript and b as superscript. Can it work?

Yep, is this what you mean? image

artisticat1 avatar May 30 '22 13:05 artisticat1

This style may be adjusted. It's just the aesthetic aspect, I don't care it. And I really appreciate your plugin. image

Yep, the style depends on which font you're using. Some fonts don't include characters for these symbols, so they fall back to Times New Roman. Consolas looks better, in that all the characters are aligned:

image

artisticat1 avatar May 30 '22 13:05 artisticat1

Correct! But I mean that make the a as subscript and b as superscript and a,b from \lim_{a \to b} image

YIRU69 avatar May 30 '22 13:05 YIRU69

@artisticat1 Hi, I find displaystyle still show on the new releases. Do you have other considerations?

YIRU69 avatar Jun 11 '22 00:06 YIRU69

Yes, I'll deal with \displaystyle in a future release! :)

artisticat1 avatar Jun 11 '22 09:06 artisticat1

Fractions are now concealed in 1.4.5.

artisticat1 avatar Sep 18 '22 12:09 artisticat1