We’re rewarding the question askers & reputations are being recalculated! Read more.

# Tag Info

18

To prevent this from happening, you may be able to make use of the new-in-8 keyboard shortcut EscketEsc, and similarly for the other symbols, EscbraEsc, EscbraketEsc. These shortcuts bring up a template which is already delimited appropriately. After entering this, you have to press Tab to get "teleported" into the placeholder where the contents of the ket ...

17

You could do it using the following (this is the first version of the answer; don't use it if you want the more complete solution below): SetOptions[EvaluationNotebook[],InputAliases->{"bn"-> FormBox[TemplateBox[{"\[SelectionPlaceholder]", "\[Placeholder]"},"Binomial"],InputForm]}] Then enter escbnesc to get a placeholder that you can tab through: ...

14

I don't know if it qualifies as an answer to your question if I suggest to change the structure of the labeling in the first place. As you write it, the m is -- from the rendering point of view -- treated as a symbol, if you inclose it with quotation marks it will be treated as a string and no auto-italic is performed at all. E.g.: PlotLabel -> "Test ...

13

Here is the formatting command that does this: pvB /: MakeBoxes[pvB[n1_, n2_, x_, s_, m0_, m1_], TraditionalForm] := RowBox[{SubscriptBox["B", RowBox[{Sequence @@ Riffle[Table["0", {n1}], "\[ThinSpace]"], "\[ThinSpace]", Sequence @@ Riffle[Table["1", {n2 - n1}], "\[ThinSpace]"]}]], "(", Sequence @@ Riffle[Map[ToBoxes, {x, s, m0, m1}...

13

Your are in computational mode, when Mathematica cares that you do not have any corresponding bra. It seems to me that you do not really care for computation and a reasonable thing would be to got to a typesetting realm. Then what about entering things as strings? I used palettes to type it, but the code for this is: TraditionalForm["\!$$\*... 11 As Daniel Lichtblau wrote in the comment you can use TraditionalForm Expand[(x^2 - 1) ((-3 + x)^2 - 4)] // TraditionalForm x^4-6 x^3+4 x^2+6 x-5 However, it works perfectly only with univariate polynomials Expand[(x + y + 1)^5] // TraditionalForm x^5+5 x^4 y+5 x^4+10 x^3 y^2+20 x^3 y+10 x^3+10 x^2 y^3+30 x^2 y^2+30 x^2 y+10 x^2+5 x y^4+20 x y^3+... 10 It's in the style sheet. Use a custom style sheet to override the default. Format > Edit Stylesheet... then enter style name: TraditionalForm Open Format > Option Inspector... and set SingleLetterItalics to False 10 This is a nice exercise on boxing: MakeBoxes[u[v_[r_[b_]]], TraditionalForm] := Module[{b1, b2, b3, t}, t = ToBoxes[#, TraditionalForm] &; {bl1, bl2, bl3} = StyleBox[#1, #2] & @@@ { {"{", {20, Orange}}, {"[", {15, Purple}}, {"(", {12, Blue}}}; {br1, br2, br3} = {bl1, bl2, bl3} /. {"[" -> "]", "{" -> "}", "(" -> ")"}; ... 8 The problem is that you gave "\[Equal]" as the centering character, but you should have given "\[LongEqual]". Column[TraditionalForm /@ {HoldForm[y] == x, HoldForm[R^2] == 0.998}, Alignment -> "\[LongEqual]"] To see that TraditionalForm replaces == with "[LongEqual]", you can open up the output cell your code produces by clicking on Show Expression ... 6 Answer inspired by this : Style[Grid[{{TraditionalForm[ Defer[1/Pi = 2*Sum[((-1)^k*(6*k)!*(13591409 + 545140134*k))/((3*k)!* k!^3*640320^(3*k + 3/2)), {k, 0, 44}]]]}}], UnderoverscriptBoxOptions -> {LimitsPositioning -> False}] gives : EDIT Rojo's solution (see comments) is better because it doesn't reduce the sigma : ... 6 The best solution is to open Preferences > Evaluation and set the Format type of new Output (and Input) cells to TraditionalForm. This is the setting that I use (certainly for Output). See Tricks of the Trade 9(1) for more information, including on the very useful Notation package. 6 This should be as simple as wrapping any one of the answers to your previous question within Tooltip. In this case, I prefer to start from Mr. Wizard's answer, because it allows me to stay away from explicitly building up the necessary Box expression. MakeBoxes[pvB[n_Integer, P_Integer, _, x__], fmt : TraditionalForm] := MakeBoxes[#, fmt] &@ Tooltip[ ... 6 Interesting question. Building on comments by glS It appears that HoldForm is treated specially by (conversion to) TraditionalForm, whereas a normal hold attribute does not prevent reordering. This is not exactly surprising considering that formatting rules do not directly respect hold attributes. (See Returning an unevaluated expression with values ... 6 If you want to copy an image directly using the mouse, you can try Rasterize which generates an image which you can copy/paste directly. Example 1: eq1 = HoldForm[Integrate[Sqrt[x], {x, 0, 1}]]; Rasterize[eq1 // TraditionalForm, ImageSize -> 300] Output 1: Example 2: eq2 = TraditionalForm[ "\!\(\*SqrtBox[\(1 + \*FractionBox[\(x$$, $$2$$]\)]\)"]; ...

5

Manipulate[ToExpression[func, TraditionalForm] /. x -> val, {{val, Pi, "x"}, InputField}, {{func, "", "f(x)"}, InputField[##, String] &}]

5

I might be oversimplifying something but I believe you can use: MakeBoxes[pvB[n_, P_, _, x__], fmt : TraditionalForm] := MakeBoxes[#, fmt] & @ Subscript[Defer @ B, Row[1 ~Table~ {n} ~PadLeft~ P]][x] pvB[2, 4, x, s, m0, m1] // TraditionalForm

5

The correct attribute to set would be HoldAll, but modifying built-in functions like this (setting attributes that affect evaluation) is very likely to break things. Instead, use HoldForm: TraditionalForm@HoldForm[(17.517*CuS^2 - 12.081*CuS + 54.875)/(1.121)]

5

As an alternative/followup to my comment, you could use the $PrePrint variable to ensure that your outputs are always in TraditionalForm. Once you assign a value to$PrePrint, it will be applied to all inputs before printing them. Just make sure that in your notebook you Clear[$PrePrint] before evaluating any cells which you do not want in TraditionalForm. 5 My approach is to use the Option Inspector (menu command Format > OptionInspector) to set the option for the relevant cells UnderscriptBoxOptions -> {LimitsPositioning -> False} If I'm doing this a lot, I might create a new style that inherits from "Text", or change "Text" itself (e.g., via a private stylesheet). Or one can create a template of ... 5 A simple solution would be to define the function \[CapitalPhi][m_, k_] := Cyclotomic[m, k] Then write your comparision as myPi[n_] := Sum[KroneckerDelta[\[CapitalPhi][m, 1], m], {m, 1, n}] myPi[1001] == PrimePi[1001] (* Out[505]= True *) Copying the first line as Latex gives the string \text{myPi}(\text{n$\_$})\text{:=}\sum _{m=1}^n \delta _{\Phi (m,... 5 Conversion to$\TeX$internally uses TraditionalForm boxes.$C$is already used there: Cyclotomic[m, 1] // TraditionalForm$ C_m(1) $In definition of Cyclotomic: ?? Cyclotomic (* ... Cyclotomic/:MakeBoxes[Cyclotomic[BoxForma$_,BoxFormb$_],TraditionalForm]/;BoxFormsufficientVersionQ[6.1]:= TemplateBox[{MakeBoxes[BoxForma$,TraditionalForm],...

5

For question 1, PlotLegends uses TraditionalForm, but it wraps the functions in HoldForm. For question 2, look at the FullForm of Exp[x]: FullForm[Exp[x]] Power[E,x] The Exp[x] in the Format statement evaluates, which is why you get a SetDelayed::write message: Unprotect[Exp] Format[Exp[x_], TraditionalForm] := E^x Protect[Exp] {Exp} -...

5

From GeneralUtilitiesPrintDefinitions @ Inactive one can gather that it is NumericFunction attribute which enables () in TraditionalForm, as opposed to []. So if you don't mind we can set them. And one thing that is left is to change Lg to lowercase during typesetting: ClearAll[Lg]; Lg[n_] := Log[2, n]; SetAttributes[Lg, NumericFunction]; Lg /: ...

5

In general I would definitely prefer @Kuba's solution, but in case you can't add the NumericFunction attribute for some reason and you still want (…) instead of […], or if you want more control in general, you can do something like the following: Unprotect@Inactive Inactive /: MakeBoxes[Inactive[Lg][n_], TraditionalForm] := RowBox@{"ln", "(", MakeBoxes[n, ...

5

I would do this by giving FracPart a TemplateBox formatting rule: MakeBoxes[FracPart[x_], TraditionalForm]:=TemplateBox[{MakeBoxes[x,TraditionalForm]}, "FracPart", DisplayFunction->(RowBox[{"{",#, "}"}]&), Tooltip->"Fractional part" ] Then: FracPart[x^2-1] //TraditionalForm Using a TemplateBox ensures that copy/paste produces a ...

5

Why are you inputting a FractionBox? There should not be any need to do so. However, if you must do this, you should generate the boxes using MakeBoxes instead: MakeBoxes[π/2] FractionBox["π", "2"] Update For the follow on question presented as an answer, i would use Divide instead of FractionBox: Sum[ (-1)^n Divide[StieltjesGamma[n],n!] Subscript[...

4

The key option here is LimitsPositioning. This is an option of UnderoverscriptBox and related boxes which determines how under and overscripts of "∑", "∏", "⋂", "⋃", "⊎", "⋀", "⋁", "lim", "max", "min", "⊕", "⊖", "⊗", "⊙" behave when displayed in a display formula or an inlined equation. You can set them in Mathematica typesetting (box) language, but it can ...

4

Let us inspect the built-in behavior ToBoxes@TraditionalForm[f[a, b]] (* TagBox[FormBox[RowBox[{"f", "(", RowBox[{"a", ",", "b"}], ")"}], TraditionalForm], TraditionalForm, Editable -> True] *) So myfuncF /: MakeBoxes[myfuncF[a_, b_], TraditionalForm] := RowBox[{"f", "(", RowBox@Riffle[Map[ToBoxes, {a, b}], ","], ")"}] x myfuncF[a, b] // ...

4

You can try using Format along with Inactive First, need to Unprotect NonCommutativeMultiply: Unprotect[NonCommutativeMultiply]; Format[NonCommutativeMultiply[x__], TraditionalForm] := Inactive[Times][x] This will look like: NonCommutativeMultiply[a, c + d, c] // TraditionalForm $a*(c+d)*c$ which is not quite right yet. For the finishing touches we ...

4

I doubt this is the best way, but one way is to wrap the integrand with Style[_, ScriptLevel -> 1] wrap the whole expression with Style[HoldForm[_], ScriptLevel -> 0] use ⌘+↩ (or equivalently Evaluation > Evaluate in Place)

Only top voted, non community-wiki answers of a minimum length are eligible