如何在 Mathematica 中以传统形式显示方程?

发布于 2024-12-21 20:17:01 字数 241 浏览 1 评论 0原文

我希望使用 Mathematica 在 TraditionalForm 中打印方程。

虽然我在一些简单的任务上取得了成功,但在下面的 2 个任务上却没有成功。
在此处输入图像描述

在此输入图像描述

I am looking to use Mathematica to print equations in TraditionalForm.

While I have been successful for some simple ones, I have not for the 2 below.
enter image description here

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

熊抱啵儿 2024-12-28 20:17:01

在 MMA 中集成某个区域的标准方法是:

Integrate[Boole[x^2 + y^2 < r^2] \[Phi][x,y], {x, -r, r}, {y, -r, r}]

MMA 没有用于此目的的 TraditionalForm,因此您必须自己制作一个:

1) 类型 Integrate[\[Phi][ x,y],x,y]
2) 更改为传统形式(使用ctrl shift-T)
3) 选择第二个积分。使用 ctrl-_ 和 x^2+y^2<=r^2 以 2D 形式创建下标

Ready

至于第二个,由于 NormalDistribution 没有 TraditionalForm 定义,您必须按照 Yoda 的食谱自己输入它或者自己定义:

Unprotect[NormalDistribution];
NormalDistribution /: 
   Format[NormalDistribution[m_, s_],TraditionalForm] := \[ScriptCapitalN] [m, s]
Protect[NormalDistribution];

在此处输入图像描述

或者,要使其双向,请使用 符号包

The standard way to integrate over a region in MMA is:

Integrate[Boole[x^2 + y^2 < r^2] \[Phi][x,y], {x, -r, r}, {y, -r, r}]

MMA doesn't have a TraditionalForm for that, so you have to make one yourself:

1) Type Integrate[\[Phi][x,y],x,y].
2) Change to Traditional Form (using ctrl shift-T)
3) Select the second integral. Make a subscript using ctrl-_ and x^2+y^2<=r^2 in 2D form

Ready

As to the second one, as NormalDistribution hasn't got a TraditionalForm definition you have to type it yourself either following Yoda's recipe or make a definition yourself:

Unprotect[NormalDistribution];
NormalDistribution /: 
   Format[NormalDistribution[m_, s_],TraditionalForm] := \[ScriptCapitalN] [m, s]
Protect[NormalDistribution];

enter image description here

or, to make it go both ways, use the Notation package.

夜无邪 2024-12-28 20:17:01

我认为您正在尝试在 mma 的文本/笔记/演示文稿中输入这些表达式。这是一个示例

"\!\(\*SubscriptBox[\(\[Integral]\), \(\\\ \)]\)\!\(\*SubscriptBox[\(\
\[Integral]\), \(\*SuperscriptBox[\(x\), \(2\)] + \
\*SuperscriptBox[\(y\), \(2\)] \[LessEqual] \*SuperscriptBox[\(r\), \
\(2\)]\)]\)\[CapitalPhi](x,y)\[DifferentialD]x\[DifferentialD]y" // \
TraditionalForm

在此处输入图像描述

"\!\(\*SubscriptBox[\(X\), \
\(1\)]\)~\[ScriptCapitalN](\!\(\*SubscriptBox[\(\[Mu]\), \
\(1\)]\),\!\(\*SuperscriptBox[SubscriptBox[\(\[Sigma]\), \(1\)], \
\(2\)]\))" // TraditionalForm

在此处输入图像描述

这一击键是:

XCtrl-1~EscscNEsc, (, EscmEsc, Ctrl- 1, ,
EscsEscCtrl-1Ctrl62, )

我把另一个留给你了。

I think you're trying to enter these expressions in your text/notes/presentations in mma. Here's an example

"\!\(\*SubscriptBox[\(\[Integral]\), \(\\\ \)]\)\!\(\*SubscriptBox[\(\
\[Integral]\), \(\*SuperscriptBox[\(x\), \(2\)] + \
\*SuperscriptBox[\(y\), \(2\)] \[LessEqual] \*SuperscriptBox[\(r\), \
\(2\)]\)]\)\[CapitalPhi](x,y)\[DifferentialD]x\[DifferentialD]y" // \
TraditionalForm

enter image description here

"\!\(\*SubscriptBox[\(X\), \
\(1\)]\)~\[ScriptCapitalN](\!\(\*SubscriptBox[\(\[Mu]\), \
\(1\)]\),\!\(\*SuperscriptBox[SubscriptBox[\(\[Sigma]\), \(1\)], \
\(2\)]\))" // TraditionalForm

enter image description here

The keystrokes for this one are:

X, Ctrl-1, , ~, EscscNEsc, (, EscmEsc, Ctrl-1, ,
EscsEsc, Ctrl-1, , Ctrl62, , )

I'll leave the other one to you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文