Mar*_*gus 3 wolfram-mathematica typesetting mathematical-typesetting
如何定义不应计算公式,而是以传统格式显示?这里有两个例子,第一个显示就像我想要的那样,但第二个是简化的.
Print["5. ", Limit[f[x]/g[x], x -> a], "=", Limit[f[x], x -> a]/Limit[g[x], x -> a], ", where ", Limit[g[x], x -> a] != 0];
Print["7. ", Limit[c, x -> a], "=", c]
Run Code Online (Sandbox Code Playgroud)
使用HoldForm打印表达式而不进行评估.
Print["7. ", HoldForm[Limit[c, x -> a]], "=", c]
(* /* ^^^^^^^^ */ *)
Run Code Online (Sandbox Code Playgroud)
这取决于你想要做什么,但如果你只是写文字,不要使用Print.而是直接输入文本,确保使用的是Text单元格,而不是Input单元格.在菜单中,选择:
Format -> Style -> Text
Run Code Online (Sandbox Code Playgroud)
然后输入你想要的内容,例如:
5. Limit[f[x]/g[x], x -> a] == Limit[f[x], x->a]/Limit[g[x], x -> a] where ...
Run Code Online (Sandbox Code Playgroud)
选择要转换为的表达式TraditionalForm,然后再次在菜单中选择:
Cell -> ConvertTo -> TraditionalForm
Run Code Online (Sandbox Code Playgroud)
......你应该得到这样的东西:

您可能还会发现有关排版的截屏视频:http: //www.wolfram.com/broadcast/screencasts/howtoentermathematicaltypesetting/
如果您实际上尝试以编程方式(例如,使用Print)生成TraditionalForm输出,则可以考虑使用Row和TraditionalForm使用HoldForm:
Print[Row[{
"5. ",
TraditionalForm[HoldForm[
Limit[f[x]/g[x], x -> a] == Limit[f[x], x -> a]/Limit[g[x], x -> a]]],
" where ..."
}]]
Run Code Online (Sandbox Code Playgroud)