diff --git a/holoviews/ipython/__init__.py b/holoviews/ipython/__init__.py index f338348c85..19249a5288 100644 --- a/holoviews/ipython/__init__.py +++ b/holoviews/ipython/__init__.py @@ -108,6 +108,9 @@ class notebook_extension(extension): Whether to monkey patch IPython to use the correct tab-completion behavior. """) + enable_mathjax = param.Boolean(default=False, doc=""" + Whether to load bokeh-mathjax bundle in the notebook.""") + _loaded = False def __call__(self, *args, **params): @@ -183,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) + Renderer.load_nb(inline=p.inline, reloading=same_cell_execution, enable_mathjax=self.enable_mathjax) if hasattr(ip, 'kernel') and not loaded: Renderer.comm_manager.get_client_comm(notebook_extension._process_comm_msg, diff --git a/holoviews/plotting/renderer.py b/holoviews/plotting/renderer.py index a4c2f77bae..f1349d546d 100644 --- a/holoviews/plotting/renderer.py +++ b/holoviews/plotting/renderer.py @@ -642,12 +642,14 @@ def validate(cls, options): return options @classmethod - def load_nb(cls, inline=True, reloading=False): + def load_nb(cls, inline=False, reloading=False, enable_mathjax=False): """ Loads any resources required for display of plots in the Jupyter notebook """ - if panel_version > Version('1.0.0rc1'): + if panel_version >= Version('1.0.2'): + load_notebook(inline, reloading=reloading, enable_mathjax=enable_mathjax) + elif panel_version >= Version('1.0.0'): load_notebook(inline, reloading=reloading) elif reloading: return