I'm trying to include a LaTeX code snippet in a Markdown cell in a notebook, using a fenced code block:
While editing, it looks like this:

Rendered it looks like this:

As you can see, the code is rendered as code, but also there are $$s inserted before and after the document environment.
I believe this is due to MathJax, which detects a possible math environment and marks it explicitly as such.
The same happens if I use an indented code block, or an explicit HTML <code> tag.
I propose that MathJax in the extension is configured to ignore code snippets, probably using the skipHtmlTags configuration option
@allefeld Thanks for filing. I just checked it out and I confirm the same repro that you do. Looks like our math handling code is getting in the way there.
similiar problem in torch module

Most helpful comment
@allefeld Thanks for filing. I just checked it out and I confirm the same repro that you do. Looks like our math handling code is getting in the way there.