Re: Error using Notebook?
- To: mathgroup at smc.vnet.net
- Subject: [mg81437] Re: Error using Notebook?
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sun, 23 Sep 2007 04:35:21 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <fd2g89$s87$1@smc.vnet.net>
John wrote: > In Wellin, page 311, 3-rd edition, the instructions: > > > Notebook[{ > cell["Demo notebook","Section"], --------^^^^ Mathematica names are *always* written with a capital: so Cell rather than cell > cell["This is a text cell","Text"], > cell["1+2+3","Input"] > }] > ] --^ Extraneous square bracket > > printed the cell contents on Untitled-1, but nothing was printed, when > I tried it. > > I am using Mathematica 6. When written correctly, the expression works fine with version 6. Note that, as indicated in the book (paragraph just above the following code), the notebook expression must be save in a text file. Then, when one opens the file within Mathematica, the contents will be interpreted as a notebook and the cells will be displayed as expected. ---------- The code below should be saved in a text file, say mynote.nb Notebook[{ Cell["Demo notebook","Section"], Cell["This is a text cell","Text"], Cell["1+2+3","Input"] }] ---------- end of the file mynote.nb Also, you can copy and past the above expression within a already opened notebook. Mathematica will recognized that this expression is indeed a notebook and a dialog box will be displayed asking if the user wants to interpret it as a notebook. Regards, -- Jean-Marc