Tag Info

New answers tagged

0

A rough approximation using a string toExpr[str_String] := str // StringReplace[#, "\n" :> ""] & // ToExpression; " x //f1 //f2 //f3 //f4 //f5 " // toExpr f5[f4[f3[f2[f1[x]]]]] Although, this is just a Composition Composition[f5, f4, f3, f2, f1]@x f5[f4[f3[f2[f1[x]]]]] f5@*f4@*f3@*f2@*f1@x f5[f4[f3[f2[f1[x]]]]] ...


1

I have no reputation to post this only as a comment, but running your code in Debian with Mathematica 10.0.2 creates the notebook with its top left corner exactly at the mouse position (tested with multiple monitors), not shited as in your image.


5

You can find the Mathematica-Files here, respectively Updated Mathematica 5 supplementary note, Updated Mathematica 6 supplementary note. On Pages from http://link.springer.com, search for Additional links or Downloads, this usually leads to additional materials.


3

One possibility would be to create a notebook cell containing the imported data in Compressed form: testData = RandomReal[{0, 1}, {100, 100}]; Export["file.csv", testData]; f = Compress[Import["file.csv"]]; NotebookWrite[EvaluationNotebook[], Cell[BoxData[RowBox[{"mydata", "=", ToBoxes[f], ";"}]], "Input"]] Here, I created a test file and imported it. ...


2

Here's a quick&dirty&buggy solution for your two wishes, although I strongly suggest you to do you works the way as the notebook interface designed to. Cls := (SelectionMove[InputNotebook[], All, Notebook]; FrontEndExecute[FrontEndToken["Clear"]]); $Post = (If[Head@$outputNB == Symbol, $outputNB = CreateNotebook[]]; If[# === Null, 1;, ...


0

Thanks to Silvia`s suggestion I found even faster way: << AuthorTools` NotebookFileOutline[EvaluationNotebook[]] ~ Do ~ {100} // AbsoluteTiming {0.564001, Null} (*big notebook, done 100 times!*)


2

I don't know if any of them can be callled documented but I know three ways to do this: mentioned above: FrontEndToken way: ( SelectionMove[#, All, Cell]; FrontEndTokenExecute[EvaluationNotebook[], "Style", "Title"] ) & /@ Cells[CellStyle -> "Section"] or SelectionSetStyle way: ( SelectionMove[#, All, Cell]; ...


4

Something more documented: NotebookRead[ PreviousCell[] ][[2]] "Section" It seems there is something exactly what you need, quite not ready probably since in Experimental` context: Experimental`CellStyleNames[ PreviousCell[] ] "Output" and Experimental`CellStyleNames[] gives you styles of all cells in notebook!, quite useful sometimes. Keep ...


4

Last /@ FilterRules[Developer`CellInformation[nb], "Style"] (* {"Title", "Subtitle", "Text"} *) Or SelectionMove[nb, All, Notebook]; "Style" /. Developer`CellInformation[nb] (* {"Title", "Subtitle", "Text"} *) Working with CellObjects: RawBoxes[ToBoxes[#][[1, -1]]] & /@ Cells[nb] (* {"Title", "Subtitle", "Text"} *)


3

As suggested i post my commend as an answer: I made a bugreport on this (March 27) and got an answer from WRI 3 days later that says: In this case, Mathematica is behaving as designed. In particular, the StyleNames item does not apply to the cells you are looking at. Further, StyleNames is an undocumented symbol, meaning that it's usage can change without ...


2

Using NotebookWrite in this manner is really no different from manually modifying the content of an Output cell. The FrontEnd converts the cell to Input, since it anticipates the user would be interested in evaluating it afterwards. What style is used is determined by DefaultDuplicateCellStyle.


1

I have a possible work around here: Button["date", NotebookWrite[EvaluationCell[], Cell[#, "Output"] &@BoxData@ToBoxes@DateString[]]; SelectionMove[EvaluationNotebook[], Previous, Cell]; CurrentValue[Cells[NotebookSelection[EvaluationNotebook[]]][[1]], StyleNames] = "Subsection"] unforunately i could not test EvaluationBox[] because i have only ...


3

You can try SelectionMovelike this: SelectionMove[nb, Next, CellGroup] or SelectionMove[nb, All, CellGroup] one of these should work in your case EDIT: Full Solution for an arbitrary notebook: nb = CreateWindow[ DocumentNotebook[{CellGroup[{TextCell["Text Group", "Section"], TextCell["Mary had a little lamb.", "Text"], TextCell["Its fleece ...


1

SelectionMove works on CellObjects just like on NotebookObjects: SelectionMove[Cells[nb][[1]], All, Cell]


3

a = 108 b::usage = "test usage msg" b[x_] := 4 x + 8 c = Interpolation[{15, 16, 23, 42}] As pointed by OP, the direct usage of FullDefinition produces boxes that are not realy useful. I don't know how to convert them easily without this tiny undocumented function [1], [2]: Save["test.m", {a, b, c}] CreateDocument @ Cell[#, "Input"] &@ First @ ...


3

It seems there is something you need. Undocumented so who knows. MathLink`CallFrontEnd[ FrontEnd`NotebookImage[ EvaluationNotebook[] ] ]



Top 50 recent answers are included