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

Using the Snippets in markdown files #1

Open
frogiraffe opened this issue Oct 2, 2023 · 2 comments
Open

Using the Snippets in markdown files #1

frogiraffe opened this issue Oct 2, 2023 · 2 comments

Comments

@frogiraffe
Copy link

Is there any way to make the snippets work in markdown files like they did in here. I use obsidian to take notes so i only use "$$math$$" in the markdown files. I tried to understand how it works but unfortunately im not experienced with custom snippets

@evesdropper
Copy link
Owner

Ah yes, this is currently not supported - there are two ways to solve this: either extend tex snippets to markdown, or make some changes to the current snippet expansion conditions so it works seamlessly on markdown. I'd like to implement the latter, and it'll involve some treesitter code, which I'm not immediately familiar with. That being said, I'll do my best to add it in soon, and I'll let you know when changes have been pushed.

@no-vici
Copy link

no-vici commented May 23, 2024

Is there any way to make the snippets work in markdown files like they did in here. I use obsidian to take notes so i only use "$$math$$" in the markdown files. I tried to understand how it works but unfortunately im not experienced with custom snippets

Put this line some where above you snippets in markdown.lua:

-- in a markdown file: search for json, then tex or anything else you'd like it to.
require("luasnip").filetype_extend("markdown", { "json", "tex" })

Then hook the conditions or something similar to Conditional expansion into your markdown without worrying about VimTeX.

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

3 participants