- if (name=="alpha" || name=="beta" || name=="gamma"
- || name=="delta" || name=="epsilon" || name=="varepsilon"
- || name=="zeta" || name=="eta" || name=="theta"
- || name=="vartheta" || name=="iota" || name=="kappa"
- || name=="lambda" || name=="mu" || name=="nu"
- || name=="xi" || name=="omicron" || name=="pi"
- || name=="varpi" || name=="rho" || name=="varrho"
- || name=="sigma" || name=="varsigma" || name=="tau"
- || name=="upsilon" || name=="phi" || name=="varphi"
- || name=="chi" || name=="psi" || name=="omega"
- || name=="Gamma" || name=="Delta" || name=="Theta"
- || name=="Lambda" || name=="Xi" || name=="Pi"
- || name=="Sigma" || name=="Upsilon" || name=="Phi"
- || name=="Psi" || name=="Omega")
- return "\\" + name;
+ static std::map<std::string, std::string> standard_names;
+ static bool names_initialized = false;
+ if (!names_initialized) {
+ standard_names["alpha"] = std::string("\\alpha");
+ standard_names["beta"] = std::string("\\beta");;
+ standard_names["gamma"] = std::string("\\gamma");;
+ standard_names["delta"] = std::string("\\delta");;
+ standard_names["epsilon"] = std::string("\\epsilon");
+ standard_names["varepsilon"] = std::string("\\varepsilon");
+ standard_names["zeta"] = std::string("\\zeta");
+ standard_names["eta" ] = std::string("\\eta" );
+ standard_names["theta"] = std::string("\\theta");
+ standard_names["vartheta"] = std::string("\\vartheta");
+ standard_names["iota"] = std::string("\\iota");
+ standard_names["kappa"] = std::string("\\kappa");
+ standard_names["lambda"] = std::string("\\lambda");
+ standard_names["mu"] = std::string("\\mu");
+ standard_names["nu"] = std::string("\\nu");
+ standard_names["xi"] = std::string("\\xi");
+ standard_names["omicron"] = std::string("\\omicron");
+ standard_names["pi"] = std::string("\\pi");
+ standard_names["varpi"] = std::string("\\varpi");
+ standard_names["rho"] = std::string("\\rho");
+ standard_names["varrho"] = std::string("\\varrho");
+ standard_names["sigma"] = std::string("\\sigma");
+ standard_names["varsigma"] = std::string("\\varsigma");
+ standard_names["tau"] = std::string("\\tau");
+ standard_names["upsilon"] = std::string("\\upsilon");
+ standard_names["phi"] = std::string("\\phi");
+ standard_names["varphi"] = std::string("\\varphi");
+ standard_names["chi"] = std::string("\\chi");
+ standard_names["psi"] = std::string("\\psi");
+ standard_names["omega"] = std::string("\\omega");
+ standard_names["Gamma"] = std::string("\\Gamma");
+ standard_names["Delta"] = std::string("\\Delta");
+ standard_names["Theta"] = std::string("\\Theta");
+ standard_names["Lambda"] = std::string("\\Lambda");
+ standard_names["Xi"] = std::string("\\Xi");
+ standard_names["Pi"] = std::string("\\Pi");
+ standard_names["Sigma"] = std::string("\\Sigma");
+ standard_names["Upsilon"] = std::string("\\Upsilon");
+ standard_names["Phi"] = std::string("\\Phi");
+ standard_names["Psi"] = std::string("\\Psi");
+ standard_names["Omega"] = std::string("\\Omega");
+ names_initialized = true;
+ }
+ std::map<std::string, std::string>::const_iterator it = standard_names.find(name);
+ if (it != standard_names.end())
+ return it->second;