In jupyter (lab) the Markdown panel cannot render LaTex syntax (mathjax imported)

import panel as pn
import param
pn.extension("mathjax") 
pn.pane.Markdown("$$ a $$")

Screenshot:
Screenshot 2024-03-01 171601

The installed packages are listed below

anyio                     4.3.0           High level compatibility layer fo...
argon2-cffi               23.1.0          Argon2 for Python
argon2-cffi-bindings      21.2.0          Low-level CFFI bindings for Argon2
arrow                     1.3.0           Better dates & times for Python
asttokens                 2.4.1           Annotate AST trees with source co...
async-lru                 2.0.4           Simple LRU cache for asyncio
attrs                     23.2.0          Classes Without Boilerplate
babel                     2.14.0          Internationalization utilities
beautifulsoup4            4.12.3          Screen-scraping library
bleach                    6.1.0           An easy safelist-based HTML-sanit...
bokeh                     3.3.4           Interactive plots and application...
certifi                   2024.2.2        Python package for providing Mozi...
cffi                      1.16.0          Foreign Function Interface for Py...
charset-normalizer        3.3.2           The Real First Universal Charset ...
colorama                  0.4.6           Cross-platform colored terminal t...
comm                      0.2.1           Jupyter Python Comm implementatio...
contourpy                 1.2.0           Python library for calculating co...
debugpy                   1.8.1           An implementation of the Debug Ad...
decorator                 5.1.1           Decorators for Humans
defusedxml                0.7.1           XML bomb protection for Python st...
executing                 2.0.1           Get the currently executing AST n...
fastjsonschema            2.19.1          Fastest Python implementation of ...
fqdn                      1.5.1           Validates fully-qualified domain ...
h11                       0.14.0          A pure-Python, bring-your-own-I/O...
httpcore                  1.0.4           A minimal low-level HTTP client.
httpx                     0.27.0          The next generation HTTP client.
idna                      3.6             Internationalized Domain Names in...
ipykernel                 6.29.3          IPython Kernel for Jupyter
ipython                   8.22.1          IPython: Productive Interactive C...
isoduration               20.11.0         Operations with ISO 8601 durations
jedi                      0.19.1          An autocompletion tool for Python...
jinja2                    3.1.3           A very fast and expressive templa...
json5                     0.9.17          A Python implementation of the JS...
jsonpointer               2.4             Identify specific nodes in a JSON...
jsonschema                4.21.1          An implementation of JSON Schema ...
jsonschema-specifications 2023.12.1       The JSON Schema meta-schemas and ...
jupyter-client            8.6.0           Jupyter protocol implementation a...
jupyter-core              5.7.1           Jupyter core package. A base pack...
jupyter-events            0.9.0           Jupyter Event System library
jupyter-lsp               2.2.3           Multi-Language Server WebSocket p...
jupyter-server            2.12.5          The backend—i.e. core services, A...
jupyter-server-terminals  0.5.2           A Jupyter Server Extension Provid...
jupyterlab                4.1.2           JupyterLab computational environment
jupyterlab-mathjax2       4.0.0           A MathJax Typesetting provider fo...
jupyterlab-pygments       0.3.0           Pygments theme using JupyterLab C...
jupyterlab-server         2.25.3          A set of server components for Ju...
linkify-it-py             2.0.3           Links recognition library with FU...
markdown                  3.5.2           Python implementation of John Gru...
markdown-it-py            3.0.0           Python port of markdown-it. Markd...
markupsafe                2.1.5           Safely add untrusted strings to H...
matplotlib-inline         0.1.6           Inline Matplotlib backend for Jup...
mdit-py-plugins           0.4.0           Collection of plugins for markdow...
mdurl                     0.1.2           Markdown URL utilities
mistune                   3.0.2           A sane and fast Markdown parser w...
nbclient                  0.9.0           A client library for executing no...
nbconvert                 7.16.1          Converting Jupyter Notebooks (.ip...
nbformat                  5.9.2           The Jupyter Notebook format
nest-asyncio              1.6.0           Patch asyncio to allow nested eve...
notebook-shim             0.2.4           A shim layer for notebook traits ...
numpy                     1.26.4          Fundamental package for array com...
overrides                 7.7.0           A decorator to automatically dete...
packaging                 23.2            Core utilities for Python packages
pandas                    2.2.1           Powerful data structures for data...
pandocfilters             1.5.1           Utilities for writing pandoc filt...
panel                     1.3.8           The powerful data exploration & w...
param                     2.0.2           Make your Python code clearer and...
parso                     0.8.3           A Python Parser
pillow                    10.2.0          Python Imaging Library (Fork)
platformdirs              4.2.0           A small Python package for determ...
prometheus-client         0.20.0          Python client for the Prometheus ...
prompt-toolkit            3.0.43          Library for building powerful int...
psutil                    5.9.8           Cross-platform lib for process an...
pure-eval                 0.2.2           Safely evaluate AST nodes without...
pycparser                 2.21            C parser in Python
pygments                  2.17.2          Pygments is a syntax highlighting...
python-dateutil           2.9.0           Extensions to the standard Python...
python-json-logger        2.0.7           A python library adding a json lo...
pytz                      2024.1          World timezone definitions, moder...
pyviz-comms               3.0.1           A JupyterLab extension for render...
pywin32                   306             Python for Window Extensions
pywinpty                  2.0.13          Pseudo terminal support for Windo...
pyyaml                    6.0.1           YAML parser and emitter for Python
pyzmq                     25.1.2          Python bindings for 0MQ
referencing               0.33.0          JSON Referencing + Python
requests                  2.31.0          Python HTTP for Humans.
rfc3339-validator         0.1.4           A pure python RFC3339 validator
rfc3986-validator         0.1.1           Pure python rfc3986 validator
rpds-py                   0.18.0          Python bindings to Rust's persist...
send2trash                1.8.2           Send file to trash natively under...
six                       1.16.0          Python 2 and 3 compatibility util...
sniffio                   1.3.1           Sniff out which async library you...
soupsieve                 2.5             A modern CSS selector implementat...
stack-data                0.6.3           Extract data from python stack fr...
terminado                 0.18.0          Tornado websocket backend for the...
tinycss2                  1.2.1           A tiny CSS parser
tornado                   6.4             Tornado is a Python web framework...
tqdm                      4.66.2          Fast, Extensible Progress Meter
traitlets                 5.14.1          Traitlets Python configuration sy...
types-python-dateutil     2.8.19.20240106 Typing stubs for python-dateutil
typing-extensions         4.10.0          Backported and Experimental Type ...
tzdata                    2024.1          Provider of IANA time zone data
uc-micro-py               1.0.3           Micro subset of unicode data file...
uri-template              1.3.0           RFC 6570 URI Template Processor
urllib3                   2.2.1           HTTP library with thread-safe con...
wcwidth                   0.2.13          Measures the displayed width of u...
webcolors                 1.13            A library for working with the co...
webencodings              0.5.1           Character encoding aliases for le...
websocket-client          1.7.0           WebSocket client for Python with ...
xyzservices               2023.10.1       Source of XYZ tiles providers

I have tried pn.serve and the latex was rendered correctly. How can I make LaTeX work for jupyter notebook as well?

I also tried the same code in google colab and the result is reproducible.

Can you report a bug on the Panel repo?

This is also happening on the doc pages for Markdown, last example on the page, Markdown — Panel v1.3.9a1.

Yeah I think it’s using code hilite under the hood

This is already reported in Looks like Latex not working on panel documentation page. I’m having the same issue localy. · Issue #5833 · holoviz/panel (github.com)