vscode-latex-basics
vscode-latex-basics copied to clipboard
Support macro `\cacheMeCode` from robust-externalize
This is a follow-up on #79 #77.
This PR adds support for \cacheMeCode[options]{code}. Both the content of [] and {} can span over several lines.
@dflvunoooooo @tobiasBora Currently the code part is considered as verbatim. Would it make sense to support embedded language and if so how can it be inferred from the optional argument?
Thanks a lot! So a few remarks:
- I use the convention that environments start with upper case letter and command with lower case letters,
\CacheMe(or rather\cacheMe) is morally the command version of\begin{CacheMe}, that we decided to keep in LaTeX form as it actually parses the code as LaTeX (removing%…), so I guess it would make sense to do the same for\cacheMe\cacheMeCode[preset options]{code}is indeed the equivalent of\begin{CacheMeCode}{preset options}code\end{CacheMeCode}(or rather will, I wrote it recently and I'll push it soonish once I finish working on a nicer way to work with python & sagemath). But the idea is exactly the same : you can parse the language exactly like inCacheMeCodeto print it accordingly.
Thanks for the explanations. I fixed the macro name to only consider \cacheMeCode. As for the CacheMe environment, the standard LaTeX grammar can already handle the macro \cacheMe.
I will add the recognition of embedded languages for \cacheMeCode.
@tobiasBora I hope to be back on track to finalize this PR.
If you have time, could you test this new grammar? Embedded languages should now be properly recognized inside the \cacheMeCode macro.
@tobiasBora By any chance, could you test this PR before I merge it.
I don't use vscode and I can't access my laptop now, so it might be hard for me to test but the user that requested this feature originally may have more luck? @dflvunoooooo
But thanks for the great work!
Thank you for further enhancing the code. I am currently traveling, will be back in a week. Maybe I manage to test it sooner. I will keep in touch.
I checked the new version. Looks very good! At least for python and gnuplot. :) Thank you for your work! Sorry it did take me so long to check.