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)

7
votes
4answers
194 views

How to select only NotebookObjects that are referring to ordinary notebooks? (not palettes etc.)

There is of course function Notebooks[] But, unfortunatelly it hasn't got useful options in this context. My question is how to pick ...
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 ...
5
votes
1answer
143 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 ...
13
votes
1answer
488 views

Saving a notebook as a $\LaTeX$ file, with syntax highlighting preserved

How can I save a notebook as a $\LaTeX$ file, while preserving the syntax highlighting (such as input/output boxes)?
12
votes
1answer
415 views

“Choose how to enter input” - leave me alone

How do I get rid of this: I can't find the appropriate entry in Option Inspector or in WolframPredictiveInterface.
10
votes
2answers
200 views

What are the purposes of functions in FrontEnd` context which are duplicates of those in System`?

I noticed that for notebook-related heads, there are usually a pair of same functions, one in System context, another in ...
8
votes
1answer
328 views

Determine page count programmatically [duplicate]

Possible Duplicate: Generating a table of contents By selecting File > Printing Settings > Headers and Footers from the menu, I am able to enter << Total Pages >> to print the total ...
7
votes
1answer
96 views

How to sort cells?

Is there a way to programmatically reorder the section cells in a notebook alphabetically? For example:
7
votes
1answer
1k views

How to add more levels to Outline notebooks

The Outline stylesheet only seems to cover 6 levels of depth. Is there any way to increase that? Here's an example. Hitting tab on the last level just indents its content, but doesn't add another ...
5
votes
2answers
155 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: ...
3
votes
2answers
278 views

How can Magnify be forced to ignore the notebook's window width?

In a new notebook, I can illustrate how the action of Magnify is cut off by the window width: ...
17
votes
0answers
147 views

How to keep the ctrl+shift+k help menu remain in display while typing? [closed]

In Mathematica 9, one can type ctrl+shift+k to display menu which has all the possible signatures/definitions for the function or command in question. One can ...
11
votes
3answers
219 views

How to collect expressions from cells created by Print?

I have a notebook where evaluation of a certain cell produced hundreds of adjacent output cells using Print. I need to create a list containing all expressions from ...
11
votes
1answer
460 views

How to convert a notebook cell to a string retaining all formatting, colorization of identifiers etc?

I have an opened Mathematica notebook containing several cells. Suppose, I am interested in one of them -- it may contain a complete or incomplete expression (e.g. with syntax errors, highlighted ...
8
votes
1answer
224 views

After modifying expression, new result doesn't replace old one

After I modify and re-evaluate an expression, the new result doesn't replace the old one. Rather, what happens is that the old result gets pushed down and Mathematica displays the current result at ...
7
votes
5answers
346 views

Storing data in the Notebook in readable form

The common problem in my work is a need to import some experimental data to work with. This means that my notebook depends on some external files which makes it difficult to share it with others and ...
6
votes
1answer
235 views

How to create a “standard” CDF programmatically?

How can I programmatically create a CDF which is similar to the CDFs created by File -> CDF Export -> Standalone...? ...
5
votes
1answer
163 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 ...
4
votes
1answer
149 views

How to copy groups of cells with NotebookWrite?

I'm trying to use: NotebookWrite[nb, NotebookRead[EvaluationNotebook[]]; to copy cells from the EvaluationNotebook[] to a new ...
3
votes
2answers
155 views

Using MousePosition on the entire screen - Screencast with Linux

In order to record animations more easily while using Mathematica on Linux, I would need to know how to get the position of three clicks. The following picture (main part generated by ...
10
votes
2answers
216 views

Backslash commands in strings?

I discovered by playing around that Text[DisplayForm@SubscriptBox["\[Lambda]", "k"]] produces the same result as ...
9
votes
2answers
151 views

stop notebook evaluation when Assert fails

I would like a notebook evaluation to entirely stop when an Assert fails, without quitting the kernel. Is this possible (e.g., by setting ...
9
votes
0answers
125 views

Esc-esc for special characters and autocomplete in Mathematica 9 [duplicate]

I recently upgraded to Mathematica 9 and have noticed a slightly annoying behavior that I was looking to remedy. In the past I would type special characters, e.g. ...
8
votes
1answer
726 views

ClearAll just for current notebook

So in my search to fine tune Mathematica to what works for me, I found a nice setting that helps separate variable declaration between notebooks. Under Global Preferences, searching for CellContext ...
8
votes
2answers
311 views

Save notebook without including Front End version information

How can a notebook be saved without including the front end version? If you open a .nb file, you'll see something like ...
8
votes
3answers
230 views

Quickly display a color graphically

When manipulating colors, the output is shown as a textual expression like Hue[1/5], RGBColor[2/3, 1, 1/3], ...
7
votes
1answer
125 views

Hidden parent stylesheet?

Please follow those steps: ...
7
votes
2answers
196 views

Why can't I change the style of a cell repeatedly?

I ran into this when I was working with an example from the Help Pages of V9. Cells is a new function added in V9. The following appears to work the first time it ...
7
votes
2answers
400 views

How to see the 'source code' of DockedCells? ALT: How to 'show expression' of DockedCell?

Here is a CDF file with the dockedcells toolbar (at the top). I'm trying to see how he created and positioned the logo, the formatting buttons, table of contents, etc, through a source code of it, but ...
5
votes
1answer
91 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
2answers
355 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: ...
4
votes
0answers
57 views

String option names for Cells

They seem to be correctly interpreted. I'm asking because of some minor reasons and a major one: NotebookWrite a Cell with WholeCellGroupOpener option I don't know any official confirmation so let ...
4
votes
1answer
98 views

Getting the Box of a Button

I have a useful snippet of code that I use for anything in my Notebook that takes a while to execute and doesn't need to be executed for subsequent cells: ...
4
votes
1answer
83 views

Evaluate open cell segments in a notebook

The Evaluate > EvaluateNotebook evaluates the whole notebook. Is it possible to somehow evaluate ONLY the open sections of a notebook?
4
votes
2answers
1k views

How do you configure Mathematica 9 to automatically evaluate all notebooks?

I have a Mathematica 6 course that I am using in Mathematica 9; there is no updated version. Every time I open a notebook I have to go to the Evaluation menu and click on "Evaluate Notebook". Is there ...
4
votes
1answer
168 views

Searching Notebooks for String Patterns using Workbench v2

The Workbench webpage describing new features in version 2 lists the ability to "Search notebook documents with the Mathematica pattern search utility" under the heading Mathematica Front End ...
3
votes
0answers
46 views

Is it possible to enclose code into collapsible/expandable regions? [duplicate]

In some programming languages (e.g. C#, Visual Basic) there are language constructs that have no effect on the execution of code whatsoever, but exist solely to allow grouping fragments of code into ...
3
votes
2answers
118 views

How to specify a StyleSheet of a newly programmatically-created notebook?

I would like to make a button that opens a notebook upon pressing. The point is that I would like the notebook to be made according to a specified StyleSheet. To be more specific, here is a simple ...
2
votes
1answer
52 views

NotebookEvaluate with InsertResults -> True from the command line

Suppose I have a notebook template.nb like this: and I want to evaluate this notebook from the command line. So I wrote this Mathematica script: ...
2
votes
2answers
103 views

NotebookWrite Cell with Grid

I'd like to NotebookWrite a Cell in StandardForm with a ...
2
votes
2answers
265 views

Evaluation of Notebook chosen by FileNameSetter

Please consider the following: I have created a GUI where I can choose the path of a notebook (which I need for later calculation) via ...
1
vote
1answer
94 views

how to make cells independent with each other in notebook

If we open DocumentationCenter and then run code, we will find that the Cells are independent from each other. For example: ...
13
votes
1answer
159 views

What is “MemoryMonitor”?

Evaluating one of the following inputs ...
13
votes
1answer
284 views

How to make an unremovable modal window?

Is there any way to securely stick a notebook window (e.g. a dialog) on screen that it cannot be closed/removed/hidden by any of the standard OS shortcuts, like AltF4 or AltTab under Windows? The ...
8
votes
2answers
154 views

Alternative to NotebookLocate or NotebookFind

In Mathematica 8.0 and older, there are two ways to select cells based on cell tags. NotebookLocate["CellTag"]; NotebookGet[EvaluationNotebook[]] and ...
8
votes
4answers
1k views

Automatically counting the number of lines of code in a set of notebooks

How can I automatically count the number of lines of code "Input" existing inside all the notebook files contained in a specified folder? I know there is the issue of considering or not the automatic ...
8
votes
2answers
539 views

How do I view initialization (or other invisible) cells in a notebook?

I am looking at someone else's notebook, and when I go to evaluate it, it asks whether I want to evaluate the initialization cells. I would like to look at them first, but "I do not see them here nor ...
7
votes
1answer
310 views

How to evaluate an input cell automatically after evaluating the previous one

Is there any way to automatically evaluate an input cell after evaluating the previous one without the need to press ENTER?
7
votes
1answer
203 views

how to select all cells with specific property such as the ones that are closed

I have to close many cells each time before I export a notebook to HTML since I do not want to display many code cells and other cells. I select each cell one by one, and do ...
5
votes
1answer
103 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: ...