Skip to content

HTMLMath widget in JupyterLab doesn't render LaTeX until MathJax has been loaded externally #2253

@jonmmease

Description

@jonmmease

In the process of adding MathJax / LaTeX support to the plotly.py ipywidget, I realized that JupyterLab doesn't seem to automatically initialize MathJax the way the classic notebook did. I was able to reproduce this same situation using the built-in HTMLMath widget.

Steps to reproduce

  1. Launch a fresh JupyterLab instance
  2. Create a new notebook
  3. Create and display an HTMLMath widget that contains LaTeX. It will display in raw form (not typeset)
  4. Create and evaluate a markdown cell that contains LaTeX
  5. Repeat step (3) and the output will be typeset as expected.

Here is a screenshot of the end-result of this process
screen shot 2018-10-24 at 6 15 35 pm

Is it possible for a widget (or a general JupyterLab extension for that matter) to request that JupyterLab perform its MathJax initialization?

This is also something I'd like to add to the plotly mime type renderer (https://github.com/jupyterlab/jupyter-renderers/tree/master/packages/plotly-extension) and chart editor (https://github.com/plotly/jupyterlab-chart-editor) extensions, so let me know if this is a discussion we should move somewhere else. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions