Hot answers tagged traditional-form
16
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 ...
11
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:
...
11
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 ...
9
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, ...
8
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
8
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} /. {"[" -> "]", "{" -> "}", "(" -> ")"};
...
4
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)]
3
Here's an alternate way to format it using Format:
Format[pvB[n_, P_, x_, s_, m0_, m1_], TraditionalForm] := DisplayForm@RowBox[{
SubscriptBox["B", StringJoin@SparseArray[{i_ :> "1" /; i > P - n}, P, "0"]],
RowBox[{ "(", Sequence @@ Riffle[ToBoxes /@ {s, m0, m1}, ","], ")" }]
}]
This definition will be saved in the FormatValues for pvB.
3
You need to use BoxData.
Because ToString creates something strange you also obviously have to change "\\" -> "".
I don't know if this is a bug or working as designed.
equat = (StringReplace[ToString[#1, TraditionalForm], "\\" -> ""] & )[
Expand[
Product[x - RandomInteger[{-10, 10}], {i, 3 + RandomInteger[]}]]];
CellPrint[
...
2
Jens's answer provides a good idea, but for some users (with v7 or older versions), "ket", "bra" and "braket" are not built-in Mathematica input aliases. To define these aliases in Mathematica, one may execute the following code:
SetOptions[$FrontEnd,
InputAliases ->
Join[{"ket" ->
TemplateBox[{"\[Placeholder]"}, "Ket",
...
2
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
1
All the comments notwithstanding, I think there may be an acceptable compromise between notational simplicity and formal accuracy. It involves defining functions really as Function, not by patterns.
Here is an example of how that looks in TraditionalForm. It's the replacement for the standard definition a[x_]:= Sin[x], now written in a notation that you'll ...
1
A problem with the given solutions exists at least in version 7.0.1 on Win7, (but not in version 8), in that a space is added to a string when Inset is used.
Starting with the default format this text appears in italics, with an extra space:
ab = Graphics[{{Yellow, Rectangle[{0, 0}, {1, 0.5}]},
Inset["A&B", {0.5, 0.25}]}, AspectRatio -> 0.5,
...
1
Having set the notebook style definition as described in Mr.Wizard's answer, the value can be obtained and applied to new notebooks programmatically.
I.e. In a manually style-edited notebook obtain the style definition:
newstyle = StyleDefinitions /. Options[SelectedNotebook[]]
Notebook[{Cell[StyleData[StyleDefinitions -> "Default.nb"]],
...
Only top voted, non community-wiki answers of a minimum length are eligible


