Tag Info

New answers tagged

4

Tags (e.g. Power /:) are not necessary here. So MakeBoxes[myvec[x_], TraditionalForm] := TemplateBox[{OverscriptBox[ToBoxes[x], "→"]}, "Abs"]; MakeBoxes[Power[myvec[x_], n_], TraditionalForm] := SuperscriptBox[ TemplateBox[{OverscriptBox[ToBoxes[x], "→"]}, "Abs"], ToBoxes[n]] /; OddQ[n]; MakeBoxes[Power[myvec[x_], n_], TraditionalForm] := ...


1

Looking again at the image I realize you are using a strange construct: p[n, 0] = p[n_, 0] := 1 p[n, 0] = p[n_, 1] := -1 p[n, k] = p[n_, k_] := (* body *) I strongly suspect that this is not what you want. Instead I believe you are attempting to set up memoization, in which case I believe you need to change these to: p[n_, 0] = 1; p[n_, 1] = -1; p[n_, ...


2

Here is my try using MapIndexed, Mouseover, and Tooltip. The idea is to highlight parts of an expression as the mouse is over it and to display at the same time the exact level indices corresponding to it. Here is a simple example to understand the core idea : myExpr = {{1, 2, {11, 22}}, {3, 4, {111, {222}}}}; and level = 3; (* For example all parts at ...


10

I use something similar to @Sjoerd's suggestion with OpenerView. Here is the essence: ClearAll[Inspect] Inspect[x_] := inspect2[x] ClearAll[inspect2] SetAttributes[inspect2, HoldAll] inspect2[x:_[a__]] := OpenerView @ {inspectView[x] // Framed, Dynamic @ Column[List @@ inspect2 /@ Hold[a]]} inspect2[x_] := inspectView[x] SetAttributes[inspectView, ...


9

Try OpenerView[{Head[#], args @@ #} ] & //@ g [For this demonstration I opened a few of the OpenerView-s. There are many more to explore.]



Top 50 recent answers are included