Search code examples
jupyter-notebookmathjax

how to render a roman number symbol in jupyter notebook?


this tex code

\documentclass{article}
\usepackage{amsfonts}
\begin{document}
\[ p(h|\mathcal{D})=
\frac{p(h|\mathcal{D})p(h)}{\sum_{h'\in\mathcal{H}} p(h'|\mathcal{D})}=
\frac{p(h)\mathbb{I}(\mathcal{D}\in h)/|h|^N}{%
\sum_{h'\in\mathcal{H}} p(h')\mathbb{I}(\mathcal{D}\in h')/|h'|^N}
\]
\end{document} 

generates this roman numbers symbol

enter image description here

running the same code in jupyter notebook gets this

enter image description here

how to render a roman number symbol in jupyter notebook?


Solution

  • The \mathbb{I} is not a roman numeral II, it is a blackboard bold capital I. Use \mathrm{II} for upright roman numeral II (or if you really don't want any space between them \mathrm{I\!I}.

    You should get the same symbol in Jupyter, but it may be that there is a problem with the font.