MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Exporting the Notebook expression corresponding to a DocumentNotebook

Hello Men and Women...

Here is something that is perhaps a useful thing to include in a
future version of Mathematica.  Does anyone know how to do this with
the current functionality of Mathematica 6?

I'd like a function called ToNotebookExpression that takes the results
of a DocumentNotebook, for example

docnb=DocumentNotebook[{x + y, 1/x + 1/y}];

and returns the Notebook expression corresponding to it.

The following does do this, but it has to display the notebook in the
front end first:


   nb=CreateDocument[ docnb]]

One reason for wanting this, is that I'd like to create a
DocumentNotebook inside of a program and then use Export to write the
Notebook out to a .nb file.  (Of course I can create the
NotebookExpressoin using lower-level constructs, but I want to take at
more Mathematica 6-ish path to this.) If one does Export["file.nb",
docnb,"NB"] then the resulting saved notebook has the embedded
DocumentNotebook expression, rather than what is generated when acting
with CreateDocument[docnb].

Any thoughts, or is this what I need to do for now?

Either way, I pass this on to WRI as a suggestion for a
ToNotebookExpression-like function.

A WorkLife FrameWork
E x t e n d i n g MATHEMATICA's Reach...

  • Prev by Date: Re: animated GIF
  • Next by Date: Re: create a list with x,y,z coordinates
  • Next by thread: Re: Exporting the Notebook expression corresponding to a DocumentNotebook