Skip to content

LaTeX (KaTeX)

The <LaTeX> primitive renders a LaTeX math expression at a given position using KaTeX. It embeds the rendered HTML inside an SVG <foreignObject>, so it works alongside all other Elucim primitives.

0.00s / 2.97s · F0
PropTypeDefaultDescription
expressionstringLaTeX expression to render (e.g. "\\frac{1}{2}")
xnumber0X position in pixels
ynumber0Y position in pixels
fontSizenumber20Font size in pixels
colorstring'currentColor'Text color
widthnumber300Width of the foreignObject container
heightnumber100Height of the foreignObject container
fadeInbooleanfalseAnimate in on mount
alignstring'center'Text alignment ('left', 'center', 'right')
import { Player, FadeIn, LaTeX } from '@elucim/core';
<Player width={500} height={300} fps={30} durationInFrames={60}>
<FadeIn duration={20}>
<LaTeX expression="E = mc^2" x={250} y={100} fontSize={36} color="#6c5ce7" />
</FadeIn>
<FadeIn duration={20}>
<LaTeX expression="\\int_0^\\infty e^{-x^2} dx = \\frac{\\sqrt{\\pi}}{2}"
x={250} y={200} fontSize={28} color="#ff6b6b" />
</FadeIn>
</Player>