{"id":9857,"library":"jupyter-server-mathjax","title":"Jupyter Server MathJax Extension","description":"MathJax resources as a Jupyter Server Extension. This library provides the necessary MathJax assets and configuration for Jupyter applications (like Jupyter Notebook and JupyterLab) to render mathematical expressions. Currently at version 0.2.6, it follows an infrequent release cadence, primarily for bug fixes or dependency updates.","status":"active","version":"0.2.6","language":"en","source_language":"en","source_url":"https://github.com/jupyter-server/jupyter-server-mathjax","tags":["jupyter","mathjax","extension","server","latex","mathematics"],"install":[{"cmd":"pip install jupyter-server-mathjax","lang":"bash","label":"Install package"},{"cmd":"jupyter server extension enable jupyter_server_mathjax","lang":"bash","label":"Enable for Jupyter Server"}],"dependencies":[],"imports":[{"note":"This function is primarily an internal entry point for `jupyter_server` to discover and load the extension. End-users typically interact with this library by installing and enabling it via `jupyter server extension enable` or `jupyter labextension install` (for older JupyterLab versions), not by direct Python import in their notebooks or scripts. Direct programmatic use by end-users is uncommon.","symbol":"load_jupyter_server_extension","correct":"from jupyter_server_mathjax import load_jupyter_server_extension"}],"quickstart":{"code":"# Install the package\n# pip install jupyter-server-mathjax\n\n# Enable the server extension (usually done once per environment)\n# import subprocess\n# subprocess.run([\"jupyter\", \"server\", \"extension\", \"enable\", \"jupyter_server_mathjax\", \"--sys-prefix\"])\n\n# This library provides server-side MathJax resources. Its effect is observed\n# in Jupyter notebooks/Lab where MathJax is used for rendering LaTeX.\n# Example of Math in a Jupyter Notebook cell (Markdown):\n# $$\\sum_{n=1}^{\\infty} \\frac{1}{n^2} = \\frac{\\pi^2}{6}$$\n# Or inline: The famous equation $E=mc^2$.\n# No direct Python code interaction is typically needed to \"use\" MathJax itself after installation.\nprint(\"Jupyter Server MathJax is installed and enabled via the command line.\")\nprint(\"To verify, start Jupyter (e.g., 'jupyter lab') and render a LaTeX equation in a Markdown cell.\")","lang":"python","description":"Install the extension and enable it for your Jupyter server. Once enabled, MathJax will automatically be available for rendering mathematical expressions in notebooks, typically through Markdown LaTeX syntax. No direct Python code is required to use the MathJax functionality after the server extension is active."},"warnings":[{"fix":"Run `jupyter server extension enable jupyter_server_mathjax` after `pip install jupyter-server-mathjax`.","message":"The extension requires explicit enabling after installation using `jupyter server extension enable jupyter_server_mathjax`. Simply installing the package via pip is not enough for it to become active.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For JupyterLab 3.0+, use `jupyter server extension enable jupyter_server_mathjax`. For JupyterLab 2.x, `jupyter labextension install @jupyter-server/mathjax` might have been used for similar functionality, but this package specifically targets `jupyter_server`.","message":"For JupyterLab users, the method of enabling extensions changed significantly with JupyterLab 3.0+. Older versions used `jupyter labextension install`, but modern JupyterLab (3.0+) relies on `jupyter server extension enable` for this type of server extension.","severity":"breaking","affected_versions":"JupyterLab < 3.0 vs >= 3.0"},{"fix":"Check your browser's developer console for JavaScript errors. Temporarily disable other frontend extensions to isolate the issue. Consult JupyterLab/Notebook documentation for advanced MathJax configuration.","message":"If MathJax rendering issues occur, ensure no other frontend extensions or custom configurations are conflicting with `jupyter-server-mathjax`'s provision of MathJax resources.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always use `jupyter server extension enable jupyter_server_mathjax`.","message":"Using `jupyter nbextension enable` for this package is incorrect. `jupyter-server-mathjax` is a `jupyter_server` extension, not an `nbextension` (which is an older type of extension primarily for classic Jupyter Notebook).","severity":"deprecated","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Ensure the extension is enabled by running `jupyter server extension enable jupyter_server_mathjax`. Then restart your Jupyter server.","cause":"The `jupyter-server-mathjax` extension is installed but not enabled, or it's being overridden by another configuration.","error":"Math equations are displayed as raw LaTeX code instead of rendered mathematical symbols in my Jupyter notebook."},{"fix":"Use the correct command for server extensions: `jupyter server extension enable jupyter_server_mathjax`. This command works for both Jupyter Notebook and JupyterLab environments (JupyterLab 3.0+).","cause":"You are likely trying to enable a `jupyter_server` extension using the older `jupyter labextension` command, or you are in an environment without JupyterLab installed.","error":"jupyter: 'labextension' is not a Jupyter command."},{"fix":"Try disabling the extension with `jupyter server extension disable jupyter_server_mathjax` and restarting the server to see if the issue resolves. Then, reinstall `jupyter-server-mathjax` and re-enable it. Verify your Jupyter Server version is compatible (>=0.1.0).","cause":"A Jupyter server extension might be misconfigured, corrupted, or incompatible with your Jupyter server version, preventing it from loading correctly.","error":"500 Internal Server Error when starting Jupyter or opening a notebook, with messages related to an extension."}]}