Example 02
Enhancing a MMA Notebook on the NeXT

Copyright ã 1993 by Bill Titus, Carleton College, 
Department of Physics and Astronomy, Northfield, MN  55057-4025
September 6, 1993

Topics and Skills

1.  The ruler:  cells types and alignment.
2.  Cell styles. 
3.  The Style Inspector and its attributes.
4.  Editing and closing cells.
5.  Printing a notebook or notebook selection.

Exercise

Step 1 -  Create a new MMA notebook by going to the MMA menu and selecting  Notebook \ New.  Move windows around until both Ex02.ma and your new notebook can be seen simultaneously.

Step 2 - Add a ruler to the top of your new notebook by selecting
 Format \ Show Ruler.  Describe what you see.

Comment 1

1.  The popup menu contains different types of cells.  The important ones are Input,  Output,  Graphics, and various documentation cells.  The default cell is Input.  Why?
2.  Different documentation cells have different styles (font, alignment, ...).  Select  Format \ Styles  and look through the various possibilities.  Then close the Style cell that just came up.
3.  What do you think the three rectangles do in the ruler?
4.  Note the margin symbols and the paper marker triangles.

Step 3 - Add the title "Mathematica Workshop" to your new notebook.  To do so, produce a new cell and type in  "Mathematica Workshop".  Then highlight the cell bracket, go to the popup menu on the ruler, and select  Title.  What happens?  Play with the alignment rectangles.

Comment 3

1.  Note that when you type "Mathematica" it automatically becomes italicized;  if it's not bold, you can make it bold by selecting  Format \ Font \ Font Panel.

Step 4 -  Add the  Subtitle  "Notebook Enhancement - Example 2" to your notebook.

Step 5 - Add a  Subsubtitle  to your notebook which consists of your name and the date.

Step 6 -  Add a  Section  to your notebook with the title  "Arithmetic Examples".

Step 7 - In the next two cells in your new notebook, type in "Addition"  and  "Multiplication", respectively.  Select both cell simultaneously by  clicking and dragging on the cell brackets.  Then convert the cells to  Subsection.

Comment 7

1.  You can also select a consecutive range of cells by clicking on the first cell bracket and shift clicking on the last one. 
2.  For selecting nonconsecutive cells, use  <Command>-click.

Step 8 - Add some descriptive text to a new cell just below the "Addition"  subsection; for example, "Here's an example that illustrates addition.".   Transform the cell into a Text cell.  Now adjust the left margin of the cell so that it's at  1.25  inches.

Step 9 - Add in addition and multiplication examples below the respective subsections.  Send the results to the MMA kernel.

Step 10 - Use the Style Inspector to gain greater control of cell appearance and type.  To do so, select  Format \ Style Inspector.  Describe what you see.

Comment 10

1.  Examine the organization of the Style Inspector:  Cell Style, Text Attributes, Space,  Cell Attributes,  Graphics Attributes,  Page Break Attributes, Display Attributes, and  Kernel Connections.
2.  Note the  Help  button.

Step 11 - Play with the Style Inspector.  Make your title cell have red text and a light blue background.   To do so, first highlight the title cell.  Then for the text color, go to the Style Inspector, and click on the border of the text color well.  What happens?  Move around on the color wheel until you get a satisfying "red".  Repeat the procedure to get the desire background color for the cell itself.

Comment 11

1.  Remember, there are a variety of ways to select colors.  
2.  You can also bring up the Color panel by selecting  Format \ Colors.

Step 12 -  Go to one of your output cells,  center the output, put a box around it, add a light yellow background to the cell, and put a page break below it.  To see the page break, select  Format \ Show Page Breaks.  Change the font size for this cell output to 24 points.

Comment 12

1.  Pagebreaks:  soft versus hard.  There's a dash at the very top.
2.  Note that you can't select the text in an output cell; you can only select the cell itself.  Why?

Step 13 -  Convert one of your output cells to an input cell.  What do you observe happening when you do this conversion?

Comment 13

1.  Why might such a conversion process be useful?

Step 14 -  Remove the cell you just converted by selecting the cell and using   <Command>-x.  This process actually saves the cell to the pasteboard and you can press  <Command>-v  to bring it back.  Do so, but then remove the cell again.  Finally, reactivate the original input cell so you end up two input and two output cells in your notebook.

Step 15 -  Double-click on the cell bracket surrounding  "Addition"  and its associated input and output cells.  What do you find?  To the same with the "Multiplication" section.  Now double-click on the cells again.  What happens?

Comment 15

1.  Why might grouping cells be useful?

Step 16 - Close all cell groupings in your notebook except for the title.  To reopen all the cells in a single move,  go to  Edit  and choose  Select All Cells.  Then select  Cell \ Open All Subgroups.  What happens?

Comment 16

1.  You can also use this process to close all the cells at once.

Step 17 - Now you're going to print your notebook.  To do so, first select  Format \ Page Layout.  After the Page Layout panel comes up, use the popup Layout menu to select two MMA pages on a single sheet of paper.  Press  OK.  Now select  Print \ Print.

Comment 17

1.  What do you think  Print \ Print Selection  does?  Try it out.
2.  When working in notebooks, you should save frequently.  Why?

Save Your Notebook

Use  Save  to save the notebook you just created under the name  myEx02_NoteBook.