New answers tagged

4

You can utilize the command PreviousCell[] along with NotebookRead[], I made an example illustrating how it could compare two cells. PreviousCell grabs the Notebook Input that Wolfram Desktop stores and the first index of the NotebookRead of the cell is the typed input. in[22]:= f[x] := x + 2 In[23]:= val = NotebookRead[PreviousCell[]][[1]] Out[23]= BoxData[...


4

Use SetOptions[EvaluationNotebook[], StyleDefinitions -> "Default.nb"] or select StyleSheet >> Default from the Format menu.


3

How about this?: format[l_List] := ToBoxes@# /. {"set", "[", RowBox[{a_, ",", b_}], "]"} :> {a, "=", b, ";", "\n"} & /@ l // RowBox // BoxData // Cell[#, "Code"] & // CellPrint; format@{set[a, 1], set[b, 2], set[c, 2]}


Top 50 recent answers are included