Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in detecting math context for latex snippet #1

Open
goodmorning-hwt opened this issue May 13, 2024 · 2 comments
Open

Error in detecting math context for latex snippet #1

goodmorning-hwt opened this issue May 13, 2024 · 2 comments

Comments

@goodmorning-hwt
Copy link

The repository aims to facilitate the transition from Ultisnips to Yasnippet. However, I encountered an issue related to detecting math context.

When utilizing the following Ultisnips code:

context "math()"
snippet "hat" "hat" riA
\hat{$1}$0
endsnippet

I received the following output:

Parse error: latex-snippets/tex.snippets: 104: 'context "math()"'

It seems that the detection of the math context is not functioning correctly. Any assistance in resolving this matter would be greatly appreciated.

@goodmorning-hwt goodmorning-hwt changed the title Error in detecting math context Error in detecting math context for latex snippet May 13, 2024
@goodmorning-hwt
Copy link
Author

According to ChatGPT, in YASnippet the line is described like # condition: (and (eq major-mode 'latex-mode) (texmathp))

@jamescherti
Copy link
Owner

jamescherti commented May 16, 2024

Thank you for posting the issue and bringing this to my attention.

I have pushed a change to ignore context for now, as context is not yet supported by Ultyas. Please try the latest version of Ultyas and confirm that context is ignored. The latest version will at least allow you to generate Yasnippet snippets that contain contexts.

I plan to implement context support or a feature to add elisp code to Ultisnips snippets from Ultisnips comments and will let you know once it's available. Contributions are also welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants