# Tag Info

## New answers tagged notebooks

4

If I understand your requirements the simplest approach is to set the "background" Notebook to run in a different Kernel. To do that first configure your kernels: Menu Evaluation > Kernel Configuration Options... Add a new Kernel, e.g. "Background" Then in your (background) Notebook use menu Evaluation > Notebook's Kernel to select it: Evaluations in ...

2

The "Basic Math Assistant" palette built into the last few versions does most of what you need, except that it starts from a 2 by 2 matrix and builds rows and columns from there.

3

I had your problem more than once. As @belisarius said, backup, backup backup. Very often that saved my day. However, in some occasions there was no backup. A possible but time consuming way is to repair your notebook by hand. I hope it is not to big. Using the solution given in the link provided by @Yves-Klett might reduce the file size. Make sure though ...

1

The way I do it in my work is as follows:

11

There are a few ways to do this. The easiest is probably the switch off the script level changes that are taking place by selecting the cell bracket and setting AllowScriptLevelChange->False in the options inspector: For more subtle tweeking you need to leave AllowScriptLevelChange->True and adjust ScriptSizeMultipliers. For example with ...

1

SetOptions[$FrontEnd, Magnification -> 1.5] 2 Much more complicated solution, but it doesn't contain anything "illegal" like adding non-string to$Path. It supports multiple notebooks in session chosen with customizable criteria. Add following to your "global" init.m, or e.g. save it in $UserBaseDirectory/Autoload/PathAutoUpdate/init.m file: Begin["PathAutoUpdate"] (* Variable containing list of ... 1 NotebookSave saves a Mathematica notebook as is, without converting it to other formats. To convert to other formats, such as PDF, use Export. Example: nb = Notebooks[][[1]] Export["~/Desktop/nb.pdf", nb] 1 You comment: I've also tried simply to copy the graphics that is displayed when I import a sound. But then I don't know how to get a sound out of it automatically. You can work with sound files by dragging and dropping, then extracting the desired parts from the sound objects. For example, you can type snd = and then drag and drop the .wav file into ... 1 One thing you could try is to include a function in your$Path that always evaluates to a valid file-name. If you are in a saved notebook, it evaluates to its folder, if not that it maybe evaluates to your user documents directory. A simple solution for this could be nbPath[] := Quiet[With[{p = NotebookDirectory[]}, If[p =!= $Failed, p, ... 6 The front-end-related operations are actually performed by Front End itself. According to the tutorial Executing Notebook Commands Directly in the Front End: When you execute a command like NotebookWrite[obj,data] the actual operation of inserting data into your notebook is performed in the front end. Normally, however, the kernel is needed in order to ... 9 One thing that might help you when investigating in such issues is the LinkSnooper. This is a java program that can be used to set up an additional kernel configuration. When you use this kernel, you can watch all traffic between front-end and kernel. With this, you could look what happens if you evaluate a simple 1+1 FE ---> K: ... 4 I agree with @Ymareth that the simplest thing would be to have the calling notebook take explicit measures to communicate the context to the target notebook. However, if for some reason it is undesirable to alter the calling notebook, then here is another way. When one notebook open in the front-end invokes another notebook, InputNotebook[] will normally ... 7 Why not just set a symbol to have a value within the calling notebook? Something like...$callingNotebook = EvaluationNotebook[]; Then in the called notebook see if $callingNotebook has a value. 2 Below is a function that I use to open a cleaned out version of a notebook. The function deletes all output cells, almost all cell options, and all notebook options. I usually use this on working notebooks to clean out accumulated code shrapnel and have not attempted to use it to open a corrupted file, but you are welcome to try it and see if it helps your ... 3 Your data {a, b, c, d} = RandomInteger[9, 4]; data = a b c d; Exporting with nice file-names featuring date and variable values using StringTemplate Export[ StringTemplate[ "Date1_Values_a2_b3_c4.txt" ][DateString[{"Year", "Month", "Day"}], a, b, c] , data] "Date20141201_Values_a7_b5_c3.txt" Or using ToString and StringJoin as ... 4 You can use several Mathematica kernels for this purpose. Go to Evalution -> Kernel Configuration Options. In this menu you can add new kernels. After in notebook, you can specify which kernel it must use by Evaluation -> Notebook's kernel. Usually, I use two local Mathematica kernels. When default one is doing some number crunching, in other notebook, ... 6 This is called the "Cell insertion menu". Its appearance is defined in MiscExpressions.tr via the front end resource "CellInsertionMenu". Notebooks (depending on the stylesheet, of course) have it defined as a "cell insertion point cell" by default: AbsoluteOptions[SelectedNotebook[], "CellInsertionPointCell"] (* -> {CellInsertionPointCell -> ... 2 My answer is based a on Martin John Hadley's. It uses Cells so one need at least V9 for that. But it is quite compact: cellSortByTag[nb_, tagOp_: ToExpression] := Composition[ (SelectionMove[#, Cell, All]; NotebookWrite[nb, #2]) & @@@ # &, Transpose, { #, NotebookRead /@ SortBy[#, tagOp @ CurrentValue[#, CellTags] &]} & ... 2 I was searching for a way to reorder Sections alphabetically and found this question, which I think I've got an answer for. It relies on evaluating the code in a separate notebook, targeting the notebook with your cell tags. In my target notebook (targetNb) I have the following cells: Cell["Typed Cell 1", "Item", CellTags -> {"1", "Zebra", "2"}], ... 3 For your second question this would define a global aContxt so that it can be used in other notebooks (to be evaluated in the notebook with the private context): GlobalaContext =$Context; Then you can define a new variable like this: SetDelayed @@ Join[Hold[varAnb], ToExpression[aContext <> "varA", InputForm, Hold]] the reason why this looks so ...

2

elaborating on the answer referenced in my comment, here is a self-evaluating notebook..

Top 50 recent answers are included