This pkg is used to convert real numbers or strings to superscripts and subscripts. Note that some letters have no superscript or subscript in the Unicode format.
Basically, we provide two simple APIs : sub
and super
.
The two APIs support base
kwarg
sub(s::Int; base=10) :: String
super(s::Int; base=10) :: String
see the example below
julia> "X" * sub(321) * "Y" * super(123)
"X₃₂₁Y¹²³"
julia> "X" * sub(5, base=2) * super(1990, base=16)
"X₁₀₁⁷ᶜ⁶"
The two APIs do NOT support base
kwarg
sub(s::AbstracFloat) :: String
super(s::AbstracFloat) :: String
see the example below
julia> "X" * sub(3.21) * "Y" * super(12.3)
"X₃.₂₁Y¹².³"
The two APIs do NOT support base
kwarg either
sub(s::AbstracString) :: String
super(s::AbstracString) :: String
see the example below
julia> sub("abcdefghijklmnopqrstuvwxyz0123456789")
"ₐbcdₑfgₕᵢⱼₖₗₘₙₒₚqᵣₛₜᵤᵥwₓyz₀₁₂₃₄₅₆₇₈₉"
julia> super("abcdefghijklmnopqrstuvwxyz0123456789")
"ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖqʳˢᵗᵘᵛʷˣʸᶻ⁰¹²³⁴⁵⁶⁷⁸⁹"
julia> super("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
"ᴬᴮCᴰᴱFᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾQᴿSᵀᵁⱽᵂXYZ"