QuantEcon / sphinxcontrib-jupyter

A Sphinx Extension for Generating Jupyter Notebooks
BSD 3-Clause "New" or "Revised" License
77 stars 23 forks source link

[Bug] Fragile math during `notebook` to `html` conversion #307

Open mmcky opened 4 years ago

mmcky commented 4 years ago

If math blocks contain + or - then the $$ environment is not being respected during the conversion from ipynb to html and gets interpreted incorrectly.

Example:

.. math::
    :label: firm_dynam_ee

    s_{t+1} = e_{t+1} \mathbb{1}\{s_t < \bar s\} 
       +  (a_{t+1} s_t + b_{t+1}) \mathbb{1}\{s_t \geq \bar s\}

This is a known issue of nbconvert

https://github.com/jupyter/nbconvert/issues/404

mmcky commented 4 years ago

one option would be to remove all newlines from the source text of the math node when writing to a notebook (when targeting html)