4

I have homework in VScode Jupyter Notebook but I get a lot of ParseError in it when displaying the LateX. The error is

ParseError: kaTeX parse error:Undefined control sequence.

for example one of the Markdown cells is

$\newcommand{\vect}[1]{{\mathbf{\boldsymbol{{#1}}}}}$
This is the vector $\vect{x}$.

and the jupyter cannot render it I guess? (I am not very familar with LateX) and will get the following error parse error

  • Checkout my [answer](https://stackoverflow.com/questions/71254191/make-new-command-in-ipynb-markdown-in-vscode/71272643#71272643) to the same question. – David Scholz Feb 28 '22 at 09:41
  • Hi David, thanks for your advice. I have downloaded the Markdown + Math extension and now I can use the macro in the .md file but it is still not working for the jupyter notebook, are you sure macros can work in your jupyter notebook file? – Elizabeth Seyfried Mar 01 '22 at 07:47
  • It works for me! Have you executed the cell with your macro? – David Scholz Mar 01 '22 at 10:09
  • I get this error occur if I have a line of mathematics followed by text outside the line, e.g. $$ x = y $$, where the comma is outside the line. This will parse but if I later try and add inline maths e.g. $x$, it no longer works. So maybe check you're not doing that cause it's not easy to spot – scs-erin Mar 12 '23 at 00:12

0 Answers0