/latex-to-utf8

Write UTF-8 math with Latex syntax

Primary LanguageJavaScript

LaTeX to UTF-8 is a bodge to write simple UTF-8 math using LaTeX. Use the snippet tab for small math expressions and the text tab for text containing math in $...$ or $$...$$.

Mangled Latex UTF-8 approximation
\nabla\f(\x) = 2\x βˆ‡π‘“(π‘₯) = 2π‘₯
\v = \partial\x/\partial\t 𝑣 = πœ•π‘₯/πœ•π‘‘
\mathbb{E}[(\x-\mu)^2] = \sigma^2 𝔼[(π‘₯βˆ’πœ‡)Β²] = 𝜎²
lim {x \rightarrow \infty} 1/x = 0 lim {x β†’ ∞} 1/x = 0
\Delta_t \leq (1 - \kappa)^t\Delta_0 π›₯β‚œ ≀ (1 βˆ’ πœ…)α΅—π›₯β‚€
\Phi = \int \mathbf{E} \cdot d\mathbf{A} 𝛷 = ∫ 𝐄 β‹… d𝐀
\partial^2\u/\partial\x^2 + \partial^2\u/\partial\y^2 = 0 πœ•Β²π‘’/πœ•π‘₯Β² + πœ•Β²π‘’/πœ•π‘¦Β² = 0
\mathcal{N}(\x; \mu, \sigma^2) = exp(-(\x - \mu)^2/\sigma^2)/\sqrt\overline2\overline\pi\sigma 𝒩(π‘₯; πœ‡, 𝜎²) = exp(βˆ’(π‘₯ βˆ’ πœ‡)Β²/𝜎²)/βˆšΜ…2Μ…πœ‹πœŽ

This is a quick and dirty replacement of known commands to matching UTF-8 symbols. Commands that "do something" rather than produce a symbol, like \frac{}{} or \begin{matrix}...\end{matrix}, do not work.

Props to Günter Milde for the Unicode ⟷ LaTeX mapping.