docs/api/markdown.md
Write markdown with mo.md; make your markdown interactive, dynamic,
and visually rich by interpolating arbitrary Python values and marimo
elements.
::: marimo.md
You can load LaTeX macros using mo.latex(filename=...).
::: marimo.latex
!!! warning "Side effects"
The mo.latex() function has side effects (registering the LaTeX macros) and should be used in the same cell as import marimo. Otherwise, the LaTeX macros may not be loaded before the cells that use them.
We support rendering icons from Iconify.
When is inside markdown, you can render an icon with the syntax ::iconset:icon-name:: for example ::lucide:rocket:: or ::mdi:home::. This is useful for quickly adding an icon, however, it does not support advanced configuration such as size, color, and rotation.
For other advanced features, use mo.icon() such as mo.icon("lucide:rocket", size=20) or mo.icon("mdi:home", color="blue").
::: marimo.icon
You can render a tooltip by adding the data-tooltip attribute to an element.
mo.md(
'''
<div data-tooltip="This is a tooltip">Hover over me</div>
'''
)
mo.ui.button(
label='<div data-tooltip="This is a tooltip">Hover over me</div>'
)
You can render images from a local public/ folder:
mo.md(
'''
'''
)
See Static files for information about serving images and other static assets.