io12 / org-fragtog

Automatically toggle Org mode LaTeX fragment previews as the cursor enters and exits them
MIT License
404 stars 14 forks source link

Problem about determination of latex-fragment #3

Closed wugouzi closed 4 years ago

wugouzi commented 4 years ago

Thanks for your packages. I find that when typing space before $, it will determine wrongly and begin to generate picture. For example, when the context is $x\in$ and then type a space $x\in $. Or with $x\in X$ and then delete 'X" $x\in $

io12 commented 4 years ago

Good catch. I will look into this.

io12 commented 4 years ago

It turns out that org-mode doesn't recognize $x\in $ as a LaTeX fragment. If you render it to a PDF it won't render properly. If you use the syntax \(x\in \) it works. According to the org-mode documentation, this is to prevent conflicts when writing currency amounts (e.g. I have $100). https://orgmode.org/manual/LaTeX-fragments.html