I use the definitions from this post to typeset formulas in lecture slides. This is my function definition:
Attributes[equation] = {HoldAll, HoldAllComplete};
equation[eq___] := Panel[TraditionalForm[Style[HoldForm@Defer[eq], 21]]]
I also had to set:
SetOptions[$FrontEndSession, UnderoverscriptBoxOptions -> {LimitsPositioning -> False}]
It works nicely in many cases. For instance:
equation[\[ScriptCapitalP][k, "N", \[Rho]] == \[ScriptCapitalP][X <= k] == \!\(\*UnderoverscriptBox[\(\[Sum]\), \(n = 0\), \(k\)]\(Binomial["\<N\>",
m] \*SuperscriptBox[\(\[Rho]\), \(n\)] \*SuperscriptBox[\((1 - \[Rho])\), \("\<N\>" - n\)]\)\)]
Now, there are some things, the frontend just refuses to typeset, for instance parentheses it considers superfluous. For example, I want to reproduce:
$$ \overline{\left(\frac{X}{y}\right)}_\mathrm{geom}=\frac{\overline{X}_\mathrm{geom}}{\overline{Y}_\mathrm{geom}} $$
The best I could get was:
equation[Subscript[(\!\(\*OverscriptBox[\((\*FractionBox[\(X\), \(Y\)])\), \(_\)]\)), geom] == Subscript[\!\(\*OverscriptBox[\(X\), \(_\)]\), geom]/Subscript[\!\(\*OverscriptBox[\(Y\), \(_\)]\), geom]]
Any ideas on how to improve?