Use the Option Inspector, Shift+Ctrl+O.
Show option values for your notebook.
Select Notebook Options, File Options.
Set AutoGeneratedPackage to Automatic.
Then the first time you save your notebook a .m file will be created from
your initiation cells. After that every time you update your notebook the .m
file will also be updated.
Check out:
?AutoGeneratedPackage.
If your notebook is primarily a package notebook you could work directly
with the .m file and skip the .nb file. You can use Section headings and
Text cells in the .m file just as in the .nb file. The principal difference,
from the .nb file, is that the package code is in Code cells, which are
Initialization cells, and not in Input cells. You can switch the Style of a
Cell to Input if it is more convenient to edit in that form. (This is
especially the case with Usage messages.) You could use Input Cells to save
old inactive versions of code.
You can create a new .m file from the Mathematica menu, File, New, Package,
give it whatever name you wish, and copy or write code into it.
It is sometimes convenient to do development and testing in a regular
notebook and then copy the code to the .m file. This is the usual way to
work within Workbench but you can also do it without Workbench.
David Park
djm...@comcast.net
http://home.comcast.net/~djmpark/index.html