Re: problems with typesetting in packages

*To*: mathgroup at smc.vnet.net*Subject*: [mg62475] Re: [mg62441] problems with typesetting in packages*From*: "David Park" <djmp at earthlink.net>*Date*: Fri, 25 Nov 2005 02:25:31 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

Hannes, Somehow I think you are going in a wrong direction in making packages, or else I don't understand your question. You shouldn't ordinarily have to even look at the package.m file. Write a package as an ordinary Mathematica notebook, package.nb. Make all of the cells Initialization cells. Put each statement in a separate cell. Then when you first save the notebook, you will be asked if you want to create an AutoSave Package. Say yes. (If you already have such a notebook you can change it to an AutoSave package using the Option Inspector.) Then everytime you edit and save the package.nb notebook the package.m file will also be updated. The package.nb notebook is just like a regular notebook and has all the regular typeset structures such as x^2 where the 2 is actually a superscript. As I said, you should never have to look at, or edit, the package.m file. You do all the editing in the package.nb notebook. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Hannes Kessler [mailto:HannesKessler at hushmail.com] To: mathgroup at smc.vnet.net Dear Mathematica experts, the following problem: Mathematica's typesetting capabilities are nice in notebooks to improve the readability of equations (powers in supscript-notation etc.). However, when one saves such a notebook as a Mathematica-package, all the typesetting information is saved also. In the package, which is essentially just an ASCII-file, the typesetting information is useless and sometimes creates errors. At best, it makes it very hard to read the package using a text editor. Here is an example, how x^3 entered in supscript notation into the initialization cell of a Mathematica notebook looks in the package: \!\(x\^3\) Upon creating larger packages, Mathematica apparently sometimes does not balance the parentheses correctly: Reading such a package back to a notebook, Mathematica complains on syntax errors. I had no choice than to rewrite all nicely typesetted formulas in the original notebook in plain Mathematica syntax without any typesetting and to save the package again. Now my question: Is it possible to use typesetting in the Mathematica notebook on one hand, and to save it to a package without any typesetting information on the other hand? Thanks for any advice. Hannes Kessler