You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.6 KiB
Rust
51 lines
1.6 KiB
Rust
use crate::tokens::Greek;
|
|
|
|
pub trait ToMathML {
|
|
fn to_mathml(&self) -> String;
|
|
}
|
|
|
|
impl ToMathML for Greek {
|
|
fn to_mathml(&self) -> String {
|
|
let inner = match self {
|
|
Greek::Alpha => "α",
|
|
Greek::Beta => "β",
|
|
Greek::Gamma => "γ",
|
|
Greek::BigGamma => "Γ",
|
|
Greek::Delta => "δ",
|
|
Greek::BigDelta => "Δ",
|
|
Greek::Epsilon => "ε",
|
|
Greek::VarEpsilon => "ε",
|
|
Greek::Zeta => "ζ",
|
|
Greek::Eta => "η",
|
|
Greek::Theta => "θ",
|
|
Greek::BigTheta => "Θ",
|
|
Greek::VarTheta => "θ",
|
|
Greek::Iota => "ι",
|
|
Greek::Kappa => "κ",
|
|
Greek::Lambda => "λ",
|
|
Greek::BigLambda => "Λ",
|
|
Greek::Mu => "μ",
|
|
Greek::Nu => "ν",
|
|
Greek::Xi => "ξ",
|
|
Greek::BigXi => "Ξ",
|
|
Greek::Pi => "π",
|
|
Greek::BigPi => "Π",
|
|
Greek::Rho => "ρ",
|
|
Greek::Sigma => "σ",
|
|
Greek::BigSigma => "Σ",
|
|
Greek::Tau => "τ",
|
|
Greek::Upsilon => "υ",
|
|
Greek::Phi => "φ",
|
|
Greek::BigPhi => "Φ",
|
|
Greek::VarPhi => "φ",
|
|
Greek::Chi => "χ",
|
|
Greek::Psi => "ψ",
|
|
Greek::BigPsi => "Ψ",
|
|
Greek::Omega => "ω",
|
|
Greek::BigOmega => "Ω",
|
|
};
|
|
|
|
format!("<mi>{}</mi>", inner)
|
|
}
|
|
}
|