2

I want to usepackage{amsmath} so I can get access to various features in my markdown. When I put $$\usepackage{amsmath}$$ in a markdown cell and try to display it, it says:

ParseError: KaTeX parse error: Undefined control sequence: \usepackage at position 1

How can I get this and other packages? I'm using VSCode to edit, and publishing on Google Colab.

I suspect that I'm misunderstanding how packages are supposed to be installed for Jupyter Notebook markdown.

Ben G
  • 26,091
  • 34
  • 103
  • 170

1 Answers1

2

VSCode Jupyter seems to currently render math in Markdown through the KaTeX typesetting library, which does not permit external packages, as it is pre-bundled with specific functions (available in the doc).

As the accepted answer to "What's the difference between different LaTeX versions like LiveTex, KaTex MacTex etc?" says:

KaTeX is not LaTeX at all. It is a mathematical typesetting library designed for use on websites. It, like MathJax, uses a LaTeX-like syntax for its commands and produces output that looks very much like that of LaTeX, but neither KaTeX nor MathJax are actual LaTeX. Neither can make use of external packages.

rabyj
  • 40
  • 7