//..................................................................... /// <summary> /// 公式中名称是正文样式,没有斜体 /// </summary> /// <param name="mathlin"></param> /// <returns></returns> public static M.Run MakeMathRun(string mathlin, bool plainstyle = false) { //M.Style fontstyle = new M.Style( ) { Val = M.StyleValues.Plain }; //RunFonts fonts = new RunFonts( ) { Ascii = "Cambria Math", HighAnsi = "Cambria Math" }; RunProperties properties = new RunProperties( ); properties.Append(OpenDocxMathExprs.MakeMathFont( )); if (plainstyle) { properties.Append(OpenDocxMathExprs.MakeMathFonStyle( )); } //--------------------------------------------- M.Text mathtext = new M.Text( ); mathtext.Text = mathlin; //--------------------------------------------- M.Run mathrun = new M.Run( ); mathrun.Append(properties); mathrun.Append(mathtext); return(mathrun); }