How to create a notebook with a properly formatted expression

后端 未结 4 1859
别那么骄傲
别那么骄傲 2021-01-14 16:16

I have a Mathematica expression generated by another program, which I would like to open in a notebook, properly formatted. For instance, the other program generates this:<

4条回答
  •  一个人的身影
    2021-01-14 16:45

    You can use the following wrapping:

    nb = CreateWindow[
         DocumentNotebook[{
           Plot[{Exp[x], 
           Interpolation[Table[{k/5, Exp[(k - 1/2)/5]}, {k, 0, 5}], 
           InterpolationOrder -> 0][x]}, {x, 0, 1}, 
           Filling -> {1 -> {{2}, {Yellow, Orange}}}, 
           PlotLabel -> 
           Style["Formatting", Blue, FontFamily -> "Courier"]]
         }]]
    

    then commands NotebookSave and NotebookClose can be used to save and close the thing ;)

提交回复
热议问题