By Lilian Besson, Sept.2017.
With inline math $\sin(x)^2 + \cos(x)^2 = 1$ and equations: $$\sin(x)^2 + \cos(x)^2 = \left(\frac{\mathrm{e}^{ix} - \mathrm{e}^{-ix}}{2i}\right)^2 + \left(\frac{\mathrm{e}^{ix} + \mathrm{e}^{-ix}}{2}\right)^2 = \frac{-\mathrm{e}^{2ix}-\mathrm{e}^{-2ix}+2 \; ++\mathrm{e}^{2ix}+\mathrm{e}^{-2ix}+2}{4} = 1.$$
In Markdown:
Sys.command "ocaml -version";;
And in a executable cell (with OCaml 4.04.2 kernel) :
Sys.command "ocaml -version";;
And
1.
, 2.
etc1.
, 1.
, ...With a HTML <img/>
tag or the ![alt](url)
Markdown code:
Avec l'ancienne API de ocaml-jupyter (pré 2020) :
#thread ;;
#require "jupyter.notebook" ;;
(* https://akabe.github.io/ocaml-jupyter/notebook/JupyterNotebook.html *)
let youtube_video url = JupyterNotebook.display "text/html"
(Printf.sprintf "<iframe width=560 height=315 src='%s'></iframe>" url)
;;
Avec la nouvelle API de ocaml-jupyter (après 2020) :
#thread ;;
#require "jupyter" ;;
#require "jupyter.notebook" ;;
(* https://akabe.github.io/ocaml-jupyter/api/jupyter/Jupyter_notebook/ *)
let youtube_video url = Jupyter_notebook.display "text/html"
(Printf.sprintf "<iframe width=560 height=315 src='%s'></iframe>" url)
;;
Iframes are disabled by default, but by using the IPython internals we can include let say a YouTube video:
youtube_video "https://www.youtube.com/embed/FNg5_2UUCNU";;
Et depuis Markdown :