Questions on Notebooks (*.nb, *.ma in earlier versions), structured interactive documents produced by Mathematica that can contain text, graphics, sound, calculations, typeset expressions, and user interface elements.

learn more… | top users | synonyms (1)

6
votes
1answer
694 views

How to open/close all collapsed/open cells?

Is there a way to open/close all collapsed/open cells? The reason is for a long notebook, it is convenient to see all the section and subsection headings at once.
6
votes
1answer
92 views

Custom default ImageSize while allowing inheriting

When displaying graphics in the Mathematica front end, and leaving ImageSize at the default, the result will always keep its previous size. For example, ...
6
votes
2answers
179 views

Saving notebook, excluding output cells, without losing “working notebook” output cells

In order to discuss this, I think it's easiest to start with two definitions. (If there's a standard terminology, please comment.) Working notebook: a notebook that is open and in memory. Disk ...
6
votes
3answers
73 views

How to create a window which will close in a certain amount of time?

I'm currently making an interface in Mathematica and I'll need to bump a window out and then let it close itself in a certain amount of time. Here's an short example to illustrate the effect: ...
6
votes
2answers
172 views

How to group cell type A under cell type B?

My notebook's groupings for "Subsection" and "SubitemNumbered" are broken: And by broken, I mean I wanted it to automatically group like this which I did manually (with lots of control+shift+g) ...
6
votes
1answer
200 views

How to prevent notebook from moving/reshuffling code around while one is typing?

Is there a way to configure Mathematica so that the code does not move around while one is typing? It is driving me crazy and I can't see what I am typing as the code is being reformatted while typing....
6
votes
1answer
152 views

Keyboard shortcut for moving to last edit location/cell

When you have long notebook with hundreds of cells, you sometimes need to scroll/jump manually to your last edited cell. I dind't find any shortcut for doing that. Any ideas?
6
votes
1answer
80 views

Testing Framework applications in the FrontEnd area

I understand that user interaction with GUI can't be tested automatically but some things can be tested using low-level notebook programming functions. Are there any guidelines or limitations of using ...
6
votes
1answer
76 views

Why does NotebookDelete fail on cells with Copyable set to False? Bug?

Bug introduced in 9.0 or earlier and fixed in 10.3 Consider this: ...
6
votes
1answer
98 views

Details of automatic cell-grouping w.r.t. cell-style

What determines how a specific cell-style influences grouping of cells? For example "Text" following "Subtitle" is grouped but ...
6
votes
1answer
211 views

Extracting text from cells, preserving non-ASCII characters

Consider the following setup, based on this answer by WReach: ...
6
votes
1answer
2k views

Automatic recovery after crash

I want Mathematica to periodically autosave my notebooks to the temp folder. And in case of front-end crash i want to see the dialog after restart with the following choices: recover from autosaved ...
6
votes
1answer
302 views

Context “Unique to This Notebook” makes variables black even if they're not defined?

I'm trying to use this technique to keep variables separated between different notebooks. It seems to be working fine, except that variables turn black as soon as they are evaluated — any ideas why ...
6
votes
1answer
122 views

Make all new cells have a specific style as a function of the Mathematica installation

I would like all new Input and Output cells, in fact all new cells including section headers and such, to have a specific stylistic property (...
6
votes
0answers
273 views

Bug report: Attempting to Save Selection As… in a magnified Notebook fails with errors [duplicate]

Bug introduced in 9.0.1 or earlier and persisting through 10.0.2 or later I have found that attempting to Save Selection As... in a magnified Notebook fails with errors. On my system it can be ...
6
votes
0answers
226 views

What is the difference between NotebookEvaluate and FrontEndToken

I am wondering what exactly are the differences in using NotebookEvaluate[filename] vs ...
5
votes
3answers
1k views

Is it possible to typeset left and right angle brackets?

I would like to typeset the following in a Mathematica notebook: $$\langle P \rangle$$ Is it possible to typeset left and right angle brackets? In $\LaTeX$, they are given by ...
5
votes
3answers
203 views

How to center a graphic in its output cell

Say I have produced a single graphic ouput, perhaps a plot. Instead of displaying left-aligned in the notebook, I would like it to display in the center of the output cell. I would like it to stay ...
5
votes
4answers
142 views

How to set the output be generated in a cell different from “Output”

I would have some functions, for instance Plot, to generate their output using a different Cell's style rather than "Output". The reason is that I'm producing some documents with many images and, for ...
5
votes
2answers
361 views

Adjusting size and positioning of math notation in a Mathematica notebook? [duplicate]

Writing mathematics in a notebook is OK, but consider the following image: In LaTeX, I can write: $$y^2=\frac{1+2\sin^{-1}x}{2}$$ which displays as: $$y^2=\...
5
votes
3answers
321 views

How to highlight the whole selected cell

Is there any way to highlight the whole selected cell? some times if I want to delete a certain cell and if the code is long and cells are without output, it is hard to know which cell that you are ...
5
votes
2answers
225 views

Find a notebook I had open recently

I worked on a notebook a few weeks ago and now I can't find after looking through the most likely directories. The recent list only has 6 items in it, none of them the notebook in question. Is there a ...
5
votes
2answers
357 views

What kind of Mathematica license do i need to create cdf documents for my students and put them on my (academic) page at the university?

I'm an enthusiastic university teacher willing to exploit Mathematica for teaching purposes. I would like to know what kind of Mathematica license would let me: create notebooks and cdf documents to ...
5
votes
2answers
349 views

How to make a notebook that will be window maximized when open?

I use CreateDocument[cells, opts] to create a notebook. When the notebook is open, it has a small default windows size and I need to manually maximize it every ...
5
votes
1answer
105 views

undocumented backslash-lessThan operator in strings?

I'm aware of the backslash operators in strings, as in this SE answer, but I ran across a new one. I opened a new Styled Notebook ... in the front-end GUI, chose <...
5
votes
2answers
318 views

Evaluate notebook from other notebook

I have a notebook ("notebook 1") which in the beginning sets some parameters, does something depending on their value and saves the result to a file, say: ...
5
votes
2answers
3k views

Run entire notebook

I have created a notebook, with functions. The only thing that I want to change in the notebook later is the input file. I therefor want to have a button that runs every input step-by-step so that I ...
5
votes
2answers
135 views

How can I get the style of a CellObject?

I want to work on a notebook programmatically with CellObjects. lets create a notebook for example: ...
5
votes
2answers
179 views

Capturing an F1

I teach an Intro to Mathematica course, and one of the things I try to reinforce early on is just how helpful Mathematica's help is. In the very first lab for the course, I even give the students a ...
5
votes
2answers
159 views

How can I determine the hyperlink of a currently opened documentation page programmatically?

Every pages in the documentation has a hyperlink. Here are some examples: ...
5
votes
1answer
454 views

Setting a Counter in Mathematica Notebook

I would like to write a book using Mathematica, but I will write one chapter on several files. How to tell Mathematica that the BookChapterNumber pointer has the ...
5
votes
1answer
133 views

Remove CellMargins option from many cells

I have a very old notebook in which many cells had the CellMargins option set manually. What's the easiest way to remove all those manual option settings?
5
votes
1answer
189 views

How can I get osx split screen to work

OSX on Mac now allows two apps to split the screen. https://support.apple.com/en-us/HT204948 Doesn't seem to work in Mathematica, even though the full-screen button displays an icon suggesting that it ...
5
votes
3answers
348 views

More structure in Source Code/Notebooks

Mathematica is great for small and quick projects and has a great syntax. However as soon as a project grows I run into trouble. How do you scale and maintain projects in Mathematica? What is beyond ...
5
votes
1answer
154 views

How do I force columns in a Grid to be equally spaced?

Suppose that I have this table tab, which I display using Grid. Is it possible to force the columns to be equally spaced? All ...
5
votes
1answer
39 views

How to print cell exactly at the bottom of a notebook?

I have a notebook used as "to do list" at whose top I want place a button to add automatically, at the end of the notebook, a cell containing the current date and time, and one for the "to do" note. ...
5
votes
2answers
2k views

Taking class notes with a Mathematica Notebook

Dose anyone take notes in a technical class using a Mathematica notebook? If anyone does, how does it compare to paper and are there useful commands? I have a hard time remembering ctrl/alt/esc ...
5
votes
1answer
78 views

How can I make an invisible Cell?

Notebooks have a Visible option, but Cell // Options doesn't mention any equivalent for <...
5
votes
1answer
100 views

Close or Open, not OpenClose CellGroups for specific CellStyle

I am aware of the question Close programmatically all cell groups in Mathematica but I am trying to find out how to close only one kind of Cells in a notebook, e....
5
votes
1answer
146 views

How to stop V10 asking to continue with updated styling each time I open a new notebook

Each time I open a new notebook, using File->New->Notebook, I get this message Then I check on the "Do this for all notebooks". But when I repeat this and want to create a new notebook, it asks ...
5
votes
1answer
1k views

Automatically dealing with “disable dynamic updating”

I'm programmatically creating notebooks containing dynamic content. When a new notebook is being created, a window pops up: I then manually click on "Continue" and it will create the notebook. The ...
5
votes
2answers
929 views

Deleting Print results

While playing around with $Pre and $Post I created this very annoying piece of code: ...
5
votes
1answer
95 views

How to get “one Cell - one line” code format inside of NB files?

The PageWidth option controls the way the Cell's content is displayed, not the manner it's written in a ...
5
votes
1answer
121 views

How to set different background, input and output colors

I want to create a notebook where the background is one color, the input cells are another color, and the output cells are white. I have tried messing around with Option Inspector and creating a ...
5
votes
1answer
198 views

How to move a cell up or down with a keystroke?

It is very useful during refactoring to move lines around. All popular IDEs or text editors have this feature (PyCharm, Vim, Sublime, etc..) for example in Xcode you press: ⌥⌘[ or ⌥⌘] to move lines up ...
5
votes
1answer
338 views

Reading Early Version Notebooks

I have some very old Mathematica notebooks file (.m) files from Version 2. When I try to open them using Mathematica 8.0 (on a Linux system) Mathematica instantly shuts down (no error message - just ...
5
votes
1answer
319 views

How to replace a string within a selected region in a notebook?

I want to replace a string in a selected region/cell in mathematica notebook/package. I searched but didn' t get any result. I think it' s a quite common feature for editors/programming environments. ...
5
votes
2answers
139 views

Split screen view in notebook interface?

Is there a way to get a split screen in the notebook interface? I want a movable horizontal bar in a window with two views into the same notebook, each of which is independently scrollable. An ...
5
votes
2answers
54 views

How to disable user-interaction with Notebook during manipulating it from the Kernel?

When manipulating a Notebook from the Kernel using such functions as NotebookLocate, SelectionMove, ...
5
votes
1answer
133 views

How to close all tagged input cells without closing their output cells?

I have tagged certain Input cells I want to be closed during a presentation. I close them as follows: ...