string TransparseRichTag(string head, string param) { if (param.Length > 1) { param = param.Substring(1); // Avoid the '=' } switch (head) { case "b": return("\\" + TexUtility.GetFontName(tex.fontIndex) + "[b]"); case "i": return("\\" + TexUtility.GetFontName(tex.fontIndex) + "[i]"); case "font": return("\\" + param); case "size": float sz = 1; if (float.TryParse(param, out sz)) { sz /= tex.size; } return("\\size[" + sz.ToString() + "]"); case "color": return("\\color[" + param + "]"); default: return(head); } }