Tag Info

New answers tagged

0

"Evaluate in Place" evaluates the selected code and replaces it with the result. It can be used when there is some text (code) selected. I do not understand why you mean by "suppress multiple outputs when a cell is evaluated". Use ; after an input to suppress output.


5

No, this is not possible. A cell can only be evaluated if it contains a complete and syntactically correct expression. You might want to try Code style cells (Alt-8 or Command-8) which contain plain text and allow arbitrary formatting with spaces, tabs and newlines.


2

According to John Fultz's comment, this was a bug: It was a bug, newly introduced to 9.0.0, and subsequently fixed in 9.0.1. The same problem led to the oft-reported corruption of certain cells when you tried to merge them.


1

For example: f@x_ := Sin@x; t = "myBut"; a = Automatic; Dynamic@Panel[Plot[f@x, {x, 0, 1}, PlotLabel -> Button[t, (t=""; a=None; f[x_]:=Cos@x), Appearance -> a]], ImageSize -> 300]


7

You could do it using the following: SetOptions[EvaluationNotebook[],InputAliases->{"bn"-> FormBox[TemplateBox[{"\[SelectionPlaceholder]", "\[Placeholder]"},"Binomial"],InputForm]}] Then enter escbnesc to get a placeholder that you can tab through: Then enter the numbers and press shift-enter to evaluate. Edit To make the output appear ...


4

I think the most straight forward would be to use Mathematica packages and importing the definitions in that notebook using the function Get as Szabolcs mentioned in the comments. I suggest that you have a closer look at the documentation on how to set up packages in Mathematica. Th principle is quite simple to understand. Here is a small example of how ...


1

In the first notebook: Add[x0_, y0_] := Module[{x = x0, y = y0}, x + y] Save["myFunction", Add] Or put your first notebook in to C:\Documents In the second notebook: Get["myFunction"] Add[1, 2]


4

I think the information given by AbsoluteOptions will be enough to distinguish one type of Notebook from another. To investigate the differences among the option values of different Notebooks, we first prepare all six types of Notebooks: nblist = Complement[Notebooks[], {EvaluationNotebook[]}] Then we extract all of their AbsoluteOptions, and delete ...


4

I don't think there is any shortcut for that. But we can always construct one by scanning the CellChangeTimes of all the cells and picking out the latest one. Here is a quick solution: Button[ "Find me\nthe last edit!", {#, CurrentValue[#, CellChangeTimes]} & /@ Cells[SelectedNotebook[], CellStyle -> {"Input"}] // ...


2

Hyperlink will work too, so for the record: SetDirectory@NotebookDirectory[] Composition[ Column, Hyperlink[#, FileNameJoin[{Directory[], #}]] & /@ # & ]@FileNames["*.nb"] Of course you can play with FileNames and/or SetDirectory to adjust search to your needs.


3

Palettes have a specific window frame, so: DeleteCases[Notebooks[], x_ /; MemberQ[Options[x], WindowFrame -> "Palette"]] The Help seems to have a specific docked cell, so: DeleteCases[Notebooks[], x_ /; MemberQ[Options[x], DockedCells -> FEPrivate`FrontEndResource["FEExpressions", "HelpViewerToolbar"]]] So you can combine these two: ...


4

I don't know any neat answer but here's one that works for me at the moment. How we can detect Help, Text, Package type notebooks: "DocumentType" /. NotebookInformation /@ Notebooks[] {"Notebook", "Notebook", "Notebook", "Help", "Package", "Text", "Notebook", "Notebook", "Notebook", "Notebook"} Message is the only one with no external ...


2

Maybe something involving CellEpilog: SetOptions[ EvaluationNotebook[], CellLabelAutoDelete -> False, CellEpilog :> SetOptions[EvaluationCell[], CellLabel -> StringJoin["Kuba was here ", DateString[]]]] You can edit Stylesheet if you want to. I'm not sure if out could be modyfied this way too, but at the end ...



Top 50 recent answers are included