[feature request]: Support for function extension snippets
See original GitHub issueThis plugin works well enough and very elegantly allows me to edit latex formulas.
If it could support function fragments, it would be perfect! My thoughts are as follows.
mxi(3)
outputs a 3x3
unit matrix and mxi(6)
outputs a 6x6
unit matrix.I can also customize h(3)
to output three-level headings.
Also, it would be easier to debug and backup if the configuration file could be separated into an md file.
Thanks for any replies, I really love this plugin!
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Project-level extensions and snippets · Issue #8102 · ...
We have a custom set of snippets written per-project and would like to include them in the project repo, like our launch.json, tasks.json....
Read more >Snippets in Visual Studio Code
Snippets in Visual Studio Code. Code snippets are templates that make it easier to enter repeating code patterns, such as loops or conditional-statements....
Read more >Snippets - GitLab Docs
With GitLab snippets, you can store and share bits of code and text with other users. You can comment on, clone, and use...
Read more >Sending a code snippet in Zoom Team Chat
The code snippet feature allows you to copy and paste code using Zoom Team Chat and apply code formatting and syntax highlighting that......
Read more >Code Snippets – WordPress plugin
Code Snippets is an easy, clean and simple way to run code snippets on your site. It removes the need to add custom...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Haha, thank you! I’d be happy to have help with testing. I’ll let you know when I have things ready.
So, I’ve come up with an idea for how to achieve this. To achieve your example with “a33pmx” above, here’s what it would look like.
We can use the regular expression
([A-Za-z])([0-9])([0-9])pmx
to match the string “a33pmx”. This regex captures the groups “a”, “3”, and “3”. I assume these are the symbol of the matrix, the number of rows, and the number of columns.
Then we can write a function in javascript that takes the inputs “a”, “3”, and “3” as parameters and generates the corresponding matrix output in LaTeX. The plugin will pass in the capture groups to the function as an array.
Finally, we put all this together in a snippet that we can run by typing “a33pmx<kbd>Tab</kbd>”.
Similarly, we can create a snippet for unit matrices, as you suggested in your first post.
Here typing “mxi6<kbd>Tab</kbd>” will create a 6x6 unit matrix.
How does this sound?
It’s in the backlog at the moment, but any PRs to implement this would be welcome.