UnicodeFun.jl

Functions to transform text into unicode symbols, e.g. latex --> unicode
Author SimonDanisch
Popularity
33 Stars
Updated Last
1 Year Ago
Started In
September 2016

UnicodeFun

Build Status Build status

Coverage Status codecov

unicode transformation library offering e.g. latex --> unicode:

latexstring = "\\alpha^2 \\cdot \\alpha^{2+3} \\equiv \\alpha^7"
to_latex(latexstring) == "α² ⋅ α²⁺³ ≡ α⁷"
latexstring = "\\itA \\in \\bbR^{nxn}, \\bfv \\in \\bbR^n, \\lambda_i \\in \\bbR: \\itA\\bfv = \\lambda_i\\bfv"
==> "𝐴 ∈ ℝⁿˣⁿ, 𝐯 ∈ ℝⁿ, λᵢ ∈ ℝ: 𝐴𝐯 = λᵢ𝐯"
latexstring = "\\bf{boldface} \\it{italic} \\bb{blackboard} \\cal{calligraphic} \\frak{fraktur} \\mono{monospace}"
==> "𝐛𝐨𝐥𝐝𝐟𝐚𝐜𝐞 𝑖𝑡𝑎𝑙𝑖𝑐 𝕓𝕝𝕒𝕔𝕜𝕓𝕠𝕒𝕣𝕕 𝓬𝓪𝓵𝓵𝓲𝓰𝓻𝓪𝓹𝓱𝓲𝓬 𝔣𝔯𝔞𝔨𝔱𝔲𝔯 𝚖𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎"
to_fraction_nl("α² ⋅ α²⁺³ ≡ α⁷", "ℝ: 𝐴𝐯 = λᵢ𝐯")
==>"
α̲²̲ ̲⋅̲ ̲α̲²̲⁺̲³̲ ̲≡̲ ̲α̲⁷̲
ℝ: 𝐴𝐯 = λᵢ𝐯"

Currently offered functions:

to_superscript
to_subscript
to_fraction
to_fraction_nl
to_blackboardbold
to_boldface
to_italic
to_caligraphic
to_frakture
to_latex

Lookup tables taken from: https://github.com/ypsu/latex-to-unicode/tree/master/data