如何在 Mathematica 中打印方程
如何定义不应计算公式,而应以传统格式显示公式?这里有两个例子,第一个例子按照我想要的方式显示,但第二个例子被简化了。
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]
How do I define that a formula should not be computed, but rather displayed in Traditional format? Here are 2 examples, where the first one is displayed like I want it, but the second one is simplified.
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]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 HoldForm 打印表达式而不对其求值。
Use HoldForm to print an expression without evaluating it.
这在一定程度上取决于您想要做什么,但如果您只是编写文本,请不要使用
Print
。相反,请直接输入文本,确保您使用的是Text
单元格而不是Input
单元格。在菜单中,选择:然后输入您想要的内容,例如:
选择要转换为
TraditionalForm
的表达式,然后再次在菜单中选择:...,您应该得到类似这样的内容:
您可能还会发现有关排版的截屏视频很有用:
http://www.wolfram.com/broadcast/screencasts/ howtoentermathematicaltypesetting/
如果您实际上尝试以编程方式生成TraditionalForm 输出(例如,使用
Print
),您可能会考虑使用Row
和TraditionalForm
与HoldForm
:It depends a little bit on exactly what you want to do, but if you're just writing text, don't use
Print
. Instead, enter the text directly, making sure you are using aText
cell and not anInput
cell. In the menu, select:Then type out what you want, like:
Select the expression you want to convert to
TraditionalForm
and then in the menu again, select:... and you should get something like this:
You might also find the screencast on typesetting useful:
http://www.wolfram.com/broadcast/screencasts/howtoentermathematicaltypesetting/
If you're actually trying to produce TraditionalForm output programmatically (e.g., with
Print
) you might consider usingRow
andTraditionalForm
withHoldForm
:如果我理解正确的话——你不需要 Limit[c, x -> a] 待评估。
停止评估的标准方法是使用“Hold”。
但结果并不好:
HoldForm 命令起到了作用——它保留了求值但不显示:
If I undestand you correctly -- you don't want Limit[c, x -> a] to be evaluated.
Standart way to stop something from evaluation is to use "Hold".
But the result is not good:
The HoldForm command does the trick -- it holds evaluation but doesn't show up: