MathGroup Archive 1999

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

Search the Archive

Re: Preventing NotebookWrite From Wrapping

  • To: mathgroup at
  • Subject: [mg20513] Re: [mg20431] Preventing NotebookWrite From Wrapping
  • From: "David Park" <djmp at>
  • Date: Wed, 27 Oct 1999 02:05:07 -0400
  • Sender: owner-wri-mathgroup at

It would be nice if the Mathematica Book had more examples of writing out cells. One
help is to type a typical cell you wish to write and then use Show Expression to see
the underlying form.

This will more or less do what you want:

NotebookWrite[nb, Cell["Min Residual = " <> ToString[minresidual], "Output"]]

which writes:

Min Residual = 0.0522

If you want to write an expression, and not just a string, like this:
x == 0.0522

you can use

  Cell[BoxData[RowBox[{"x", "==", ToString[minresidual]}]], "Output"]]

You can obtain the form of the Cell expression by typing a sample cell and looking at
the underlying expression. Or you can do it directly using this form of statement:

NotebookWrite[nb, Cell[BoxData[ToBoxes[x == minresidual]], "Output"]]

and once we see that, we can write your original statement with:

  Cell[BoxData[ToBoxes[SequenceForm["Min Residual = ", minresidual]]],

I think that your basic problem was not using the Cell[BoxData[...]] form.

David Park
djmp at

>In Mathematica 3.0 how would I write text and the value of a parameter
>to a notebook such that both end up on the same line ?
>What I would like written to the notebook is for example
>Min Residual = .0522
>I tried
>NotebookWrite[nb,{"Min Residual=",minresidual}]
>where nb=NotebookCreate[] and minresidual is the desired value.
>The problem is that minresidual wraps to the next line, like so
>Min Residual=
>Is there a way to prevent this wrapping ?

  • Prev by Date: RE: entering stuff using escape
  • Next by Date: Re: drawing tilted ellipses?
  • Previous by thread: Re: Preventing NotebookWrite From Wrapping
  • Next by thread: Re: Preventing NotebookWrite From Wrapping