Vscode-jupyter: LaTeX code snippet in Markdown cell

Created on 23 Jun 2020  路  2Comments  路  Source: microsoft/vscode-jupyter

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:
image

Rendered it looks like this:
image

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

bug

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.

All 2 comments

@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

image

Was this page helpful?
0 / 5 - 0 ratings