13.07.2015 Views

Mathematica Tutorial: Notebooks And Documents - Wolfram Research

Mathematica Tutorial: Notebooks And Documents - Wolfram Research

Mathematica Tutorial: Notebooks And Documents - Wolfram Research

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Notebooks</strong> and <strong>Documents</strong> 125As you can see, Row does not leave space between elements by default. But if you give a secondargument, that expression is inserted between elements. Here we use a comma, but anyexpression can be used.Row@Range@15D!, ","D1, 2, 6, 24, 120, 720, 5040, 40 320, 362 880, 3 628 800, 39 916 800,479 001 600, 6 227 020 800, 87 178 291 200, 1 307 674 368 000If you resize the notebook window, you will see that Grid with ItemSize -> Automatic continuesto behave differently than Row, and each is useful in different circumstances.Using Output as InputThis is a good time to point out that Style, Grid, and all other box generators are persistent inoutput. If you were to take a piece of output that had some formatting created by Style orGrid and reuse that as input, the literal Style or Grid expressions would appear in the inputexpression. Those of you familiar with the old uses of StyleBox and even functions likeMatrixForm will find this a change.Consider taking the output of this Grid command, which has lots of embedded styles, andusing it in some input expression.In[17]:= Grid@Partition@Take@ptable, 16D, 4D,Alignment Ø Right, Frame Ø True, Background Ø LightBlueDOut[17]=1 2 3 45 6 7 89 10 11 1213 14 15 16In[18]:=1 2 3 45 6 7 89 10 11 1213 14 15 16+ 53êê ExpandOut[18]= 125 + 751 2 3 45 6 7 89 10 11 1213 14 15 16+ 1521 2 3 45 6 7 8+9 10 11 1213 14 15 161 2 3345 6 7 89 10 11 1213 14 15 16Notice that the grid is still a grid, it is still blue, and the elements are still bold or gray asbefore. Also notice that having literal Grid and Style in the expression interferes with whatwould have otherwise been adding a scalar to a matrix, and raising the result to a power. This

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!