From d54913660e48fbd0d87459be7ab15bd32ddfb99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Mon, 2 Oct 2023 11:15:01 +0200 Subject: [PATCH] Actually enable Mathjax with enable_mathjax (#5904) --- holoviews/ipython/__init__.py | 2 +- holoviews/util/__init__.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/holoviews/ipython/__init__.py b/holoviews/ipython/__init__.py index 81fd6f0751..ece8d26099 100644 --- a/holoviews/ipython/__init__.py +++ b/holoviews/ipython/__init__.py @@ -186,7 +186,7 @@ def __call__(self, *args, **params): same_cell_execution = getattr(self, '_repeat_execution_in_cell', False) for r in [r for r in resources if r != 'holoviews']: Store.renderers[r].load_nb(inline=p.inline) - Renderer.load_nb(inline=p.inline, reloading=same_cell_execution, enable_mathjax=self.enable_mathjax) + Renderer.load_nb(inline=p.inline, reloading=same_cell_execution, enable_mathjax=p.enable_mathjax) if hasattr(ip, 'kernel') and not loaded: Renderer.comm_manager.get_client_comm(notebook_extension._process_comm_msg, diff --git a/holoviews/util/__init__.py b/holoviews/util/__init__.py index e63bf3f482..6386bd68a0 100644 --- a/holoviews/util/__init__.py +++ b/holoviews/util/__init__.py @@ -715,6 +715,9 @@ def __call__(self, *args, **params): import panel as pn + if params.get("enable_mathjax", False) and selected_backend == "bokeh": + pn.extension("mathjax") + if pn.config.comms == "default": if "google.colab" in sys.modules: pn.config.comms = "colab"