# Tag Info

0

I use Simplify mostly to make expressions look neat. The purpose of functions like Simplify is not to make expressions neater, but to transform them into a form which minimal with respect to a certain measure, usually something containing the LeafCount. This measure of how complex an expression is can be set with the ComplexityFunction option of ...

1

Set your File->Printing Settings->Page Setup as you want it. Set Format->Screen Environment to PrintOut. Most people (assumptions are risky) aren't printing out every notebook so the normal environment is much less cramped than PrintOut.

1

Try a (b + c) d + 3 // TraditionalForm a d (b+c)+3 that works for me.

2

Hi Denver and welcome to Mathematica.SE.I see that this is your first question here. Your description of the working of % and %n and their limitations is correct and unavoidable. I understand you are a novice MMA user so let me tell you how and when an experienced user uses % and %n. NEVER! ...Well almost never :-) In pre-Mathematica days people used to ...

2

There is no way you can avoid the In / Out number increase. Keep in mind that, even if Mathematica is not showing all the output is still keeping everything in memory. So if instead of using just % you use %n you programs will not break. EDIT: As an example: In[140]:= m = {{1,2},{3,4}} Out[140]= {{1,2},{3,4}} In[141]:= v= {x,y} Out[141]= {x,y} ...

1

I am posting this update as a separate answer to avoid copy/paste issues wrt to similar codes. Once again this exploits ybeltukov's Equations code (see other answer). func[a_, b_] := Module[{cl, pol, ans}, pol[a, b] := 2 (x + a) (x + b); cl = CoefficientRules[pol[a, b], x]; If[a == 0, ans = {y == x + b, x y == 0}, If[b == 0, ans = {y ...

2

The answer by ybeltukov here may be very helpful. Exploiting this (but not general): eqn = {y == 2 x - 2, x y == 4} Equations /: MakeBoxes[Equations[eqs_, Alignment -> True], TraditionalForm] := RowBox[{"\[Piecewise]", MakeBoxes[#, TraditionalForm] &@ Grid[{#1, "=", #2} & @@@ {##} & @@ eqs, Alignment -> {{Right, Center, ...

1

Let's say you can deal with creating eq1 eq2 by yourself, here's what to do later: a = 2; b = -1; eq1 = y == a x + a b eq2 = x y == a^2 With[{subs = (eq2 /. Rule @@ eq1), sol = ({x, y} /. Solve[{eq1, eq2}, {x, y}])}, Column[{ Grid[{ {"2", "(1)", eq1}, {"", "(2)", eq2}, {"", "", Expand[#1 - #2] == 0 & @@ subs}, {"", ...

2

The following method is not fast, but very flexible if you have complicated nested Grid : mytable // ReplacePart[#, x : {_, _, _, 2} :> Column[ Extract[#, x], Dividers -> None]] & // ReplacePart[#, x : {_, 2} :> Grid[ Extract[#, x], Dividers -> None]] & // Grid [#, Dividers -> None, ItemSize -> {{0, 7}, 7}] &

1

This is not the shortest one but I like to use it when I'm making complicated grid layouts. Basically it is about creating empty grid and fill it with the content you want step by step. m = ConstantArray["", {12, 4}]; m[[2 ;; ;; 3, 1]] = params; m[[;; , 2]] = Join @@ ConstantArray[axes, 4]; m[[;; , 3]] = Column /@ Transpose[{mean, stdev}]; m[[;; , 4]] = ...

3

EDIT As rasher observes my answer does not answer your direct question. Tooltip wrapper does not appear to work for ListPicker items. I posted this answer in the event it achieves your aim or motivates your own answer. I am not certain what your ultimate aim is. I have modified your code (esp. avoid uppercase variable names to avoid conflicts with ...

2

This problem is solved by TabView. In[1]:= 5+4 Out[1]=9 In[2]:= AbsoluteTiming[Pause[3]; Plot[Sin[x],{x,-1,1}] Out[2]= {3.013000, <plot of sin[x]>} In[3]:= AbsoluteTiming[TabView[{%1,%2[[2]]}]] Out[3]={0.,Tabbed pane with 9 and <plot of sin[x]>} The timing bits are there to indicate that % calls the output without re-computing the ...

4

Supposing you want to print from inside the loop (not waiting for the loop to finish) you can use Grid on each line with specified field widths: Do[ Print@Grid[{{ RandomChoice[DictionaryLookup["*"]], "=", RandomReal[{1, 10}]^RandomInteger[12]}}, ItemSize -> {{10, Full, 8}}, Alignment -> {{Right, Center, ...

3

Grid is really quite useful for things like that if you can provide a finished list with results. In this case I was to lazy to replace your procedural code (e.g. with Table) and just extracted the data you would have printed with Sow and Reap: data = Reap[For[n = 2, n <= 10, n++, factorization = FactorInteger[n]; length = Length[factorization]; ...

0

I came upon this question when trying to add a number in scientific notation to a string in the label of a plot, which requires (or at least looks better) if the number is written with the exponents properly typeset (i.e. like $1.453\times 10^4$). This is not really what's in the question but it's not covered exaclty in any of the answers so far and this is ...

2

How about this. Generate a table of length nmax nmax = 10; x = Table[{i, RandomInteger[]}, {i, 1, nmax}]; and use InputField to update the second column of the table Column[{ TableForm@ Table[With[{i = i}, {x[[i, 1]], InputField[Dynamic[x[[i, 2]]], FieldSize -> Tiny]}], {i, 1, nmax}], replacement = Dynamic@x; }] ( The column ...

0

nMax = 10; Block[{tab, boxes}, tab = Table[ {i, InputField[i]} , {i, nMax} ]; boxes = ToBoxes@TableForm[tab]; boxes[[2]] = Function[e, Print["replacement is updated"]; replacement = #[[1]] -> #[[2, 1]] & /@ e]; Cell[BoxData@boxes , "Input" ] // CellPrint ] Prints an input cell that looks like which evaluates to ...

Top 50 recent answers are included