Change:
document.head.appendChild(styleTemplate); const katex = require('@iktakahiro/markdown-it-katex'); <ins> const macros = {}; </ins> markdownItRenderer.extendMarkdownIt((md: markdownIt.MarkdownIt) => { return md.use(katex, { globalGroup: true, enableBareBlocks: true, <ins> macros </ins> }); }); }

Discussion:
<!-- Please search existing issues to avoid creating duplicates. --- VS Code version: 1.57.0-insider Jupyter Extension version (available under the Extensions sidebar): v2021.6. Python Extension version (available under the Extensions sidebar): v2021.6.-dev OS (Windows Linux distro) and version: MacOS Big Sur 11.4 Python and/or Anaconda version: 3.8.5 Type of virtual environment used (N/A ...): conda Jupyter server running: Local I started using VSCode-insiders recently and loved the way new jupyter UI looks. But I noticed that two of the features that I used to use, does not work. CSS for Markdown cells. newcommand in Katex I usually add the common CSS and latex/katex newcommands on the the first markdown cell: ! Then in any markdown cell, I am able to use those: ! Here is the output: ! None of the above features work with VS Code Insiders: ! Note 1: The CSS works if it is in the same cell. But that means I have to repeat all the needed CSS in each cell. newcommand does not even work when defined in same cell. Note 2: I found an issue which has some different problems with Insiders:
The newcommand macro is supported in KaTeX (). Here's a screenshot of math rendering correctly in the KaTeX demo playground: ! Additionally, the ra command is correctly registered and rendered in the new native notebooks interface if defined and used in the same equation block: ! So this may be due to the way that the markdown-it-katex plugin works.
One issue per issue please. Let's track here since it more info about it has been posted Please split the css issue to a separate issue
I will check if something is changed in markdown-it-katex plugin. I did not check in the same equation block, as it does not help much :) If I have to define it for every equation block that will become painful soon (thought might still be helpful for longer/complicated blocks). Ideally ability to define these in the first cell would be most useful (IMHO).
Any chance that maybe this is somehow related to CSS related "block" you mentioned in the other issue: ?

KaTeX supports macros such as if the macros are used within the same math block, such as By default, KaTeX does not "persist" the macros to new math blocks. However, [KaTeX has an option called "globalGroup"}() which enables KaTeX to persist such macros. I submitted a pull request which sets . This should fix the issue.
Hi all, I am experiencing the same issue here. Thanks for the PR but it seems that I am still experiencing the issue on 1.61.0, in which I believe your PR is merged. I think this feature was available in earlier builds e.g. 1.5x and perhaps some changes in between corrupted the feature.
Unfortunately that PR did not fix the issue. Help still wanted on this one
It would be wonderful if had global effect in all vscode jupyter cells. Fingers crossed this can be fixed
Any updates on this?
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected. If things still don't seem right, please ensure you're on version of Insiders (today's or later - you can use in the command palette to check), and leave a comment letting us know what isn't working as expected. Happy Coding!