cdominik / cdlatex

Fast input methods to enter LaTeX environments and math with GNU Emacs
230 stars 47 forks source link

cannot expand yas-snippet inside inline math environment when no other char is inserted #21

Closed roiholtzman closed 3 years ago

roiholtzman commented 3 years ago

I am trying to use yas-snippet inside inline math mode like: $inline math mode$. When my cursor is in between two $ chars, i.e. $|$, then the snippet cannot be expanded. But, if I put in a whitespace (or any other character): $ |$, it does get expanded. When I am in an equation environment as \begin{equation} ... \end{\equation} the snippet gets expanded all the time.

What could be the problem?

roiholtzman commented 3 years ago

There is another problem that I have that I think is related to this one. In math inline mode like $inline math mode$, when I add a parenthesis (like (, {, [ etc) I do not get a closing parenthesis. Moreover, when I delete the leading $, the closing $ does not get deleted.

(I am in org-cdlatex-mode).

cdominik commented 3 years ago

org-cdlatex-mode does not deal with parenthesis at all.

roiholtzman commented 3 years ago

So what is in charge of closing the parenthesis? Why does it work in latex mode and not in org mode?

cdominik commented 3 years ago

On Mon, Jun 21, 2021 at 3:29 PM roiholtzman @.***> wrote:

So what is in charge of closing the parenthesis? Why does it work in latex mode and not in org mode?

I am not sure. I guess LaTeX mode has its own implementation, org-mode not. I guess if you switch off what LaTeX does and use smartparens both in org-mode and LaTeX mode, that might be a stable solution.

Carsten

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/cdominik/cdlatex/issues/21#issuecomment-865034127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIABM3M6KEI5EJTUB2GU3TT45DDANCNFSM4TGAJCTA .

roiholtzman commented 3 years ago

Sorry for my beginner's knowledge, but I am not sure how to do that... If you have any quick pointers on that I would be grateful. (maybe it would be better to move the discussion to this issue which I opened per your request https://github.com/cdominik/cdlatex/issues/28)