6

I installed VS Code today and created a very simple jupyter notebook which runs without any errors, but does not render the LaTex in VS Code even after installing the LaTex Workshop extension.

When I run the same notebook directly in jupyter, it renders fine.

This is the code from the markdown cell in question:

### This is another markdown cell with Latex

This equation defines eigenvalues and eigenvectors: $Mx = \lambda x$

another equation:
$\begin{align*}
(a+b)^2 = a^2+2ab+b^2
\end{align*}$

In jupyter, the cell looks like this:

enter image description here

In VS Code, the cell looks like this:

enter image description here

5
  • 1
    I have the exact same behavior and I have spent hours searching for a solution, as far as i know mathjax is what jupyter notebooks use to render this latex code. In my case this only happens when i'm offline (which is unfortunately most of the time), but as soon as vscode has internet access I rerun the cell and it renders it perfectly. Even after disconnect from internet it still renders it perfect (even new latex code in other cells). I hope some has an offline solution for this. Commented Oct 2, 2020 at 14:46
  • That makes sense because I'm in a very locked down environment. Probably getting blocked from something it needs for rendering properly. Commented Oct 2, 2020 at 16:13
  • I check again and it stop working again when offline. I leave in an answer below the reason of this. Commented Oct 2, 2020 at 19:30
  • As a general Latex render engine use Mathover. Commented Jan 28, 2021 at 10:07
  • Hi, I'm happy to say that this problem is fixed now. See edit on answer. Commented Jun 16, 2021 at 23:15

1 Answer 1

5

I found why that happens. The answer is that the Python extension of vscode (which is the one who allows to open jupyter notebooks inside of it) currently does not support this feature offline. They even open an issue because of this.

EDIT [Jun 16th, 2021]

This problem was fixed in the last version of vscode and the jupyter extension.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.