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
1answer
133 views

When are EvaluationNotebook[] and ButtonNotebook[] different?

I am looking for a concrete code example where EvaluationNotebook[] and ButtonNotebook[] will return different results. The ...
10
votes
2answers
262 views

how to make cursor jump automatically to next input cell after evaluating previous one?

When making separate cells in order to make separate computations to better see the result of each one before going to the next cell to do the next computation (which is a good way of doing things), ...
1
vote
1answer
218 views

Initialization Cells in CDF

I am wanting to run about 15 pages of initialization cells in a CDF, but can't seem to do so. I have set the InitializationCellEvaluation to True and InitializationCellWarning to False, but it doesn't ...
21
votes
3answers
997 views

How to find pieces of code responsible for syntax errors?

Especially: How to find the piece of code responsible for a missing parenthesis problem caused by a misplaced SuperScriptBox For last 30 minutes (and I was lucky ...
1
vote
1answer
107 views

NotebookWrite Multiple Selected Objects

Lets say I select shapes in a Graphics diagram in the following picture. Generated from the following set of code: ...
53
votes
4answers
3k views

Using the Mathematica front-end efficiently for editing notebooks

Background: I have used Vim for 15+ years. There is a certain "one"-ness with the editor one achieves. Emacs users also experience this. Notepad users do not. My current interaction with the ...
4
votes
1answer
77 views

Why selecting text in my notebook become abnormal?

Selecting text in one of my Notebooks becomes abnormal. Here is the unselected text: and here is the partly selected text: When the text being selected, it should be like this: What is wrong ...
2
votes
1answer
54 views

Prevent Cell Deletion

How might I be able to prevent a Cell form being deleted when you press the Delete key? Maybe there is a way to display some type of ...
2
votes
1answer
57 views

How do I force all Graphics Text to be StandardForm?

I've been playing around for while trying to determine how to get all graphic objects to use StandardForm fonts. That is, I want all axes labelling, titling, legends, inserted text, etc., for 2D/3D ...
11
votes
4answers
3k views

How to change default notebook background color?

How does one change the default notebook background color?
2
votes
1answer
217 views

How to calculate the whole run time in a specific notebook?

I have found a way to show the run time in a specific cell in a notebook (.nb). Now, I want to have the whole run time including all cells in a specific notebook. How is it possible to calculate it ...
0
votes
0answers
41 views

How to syntax highlight a code cell in another language? [duplicate]

I'm learning c/c++/objective-c and I wanted to write my notes in a mathematica notebook. But without the proper syntax color highlighting it looks terrible....
3
votes
0answers
78 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 (...
1
vote
1answer
87 views

How to pop out of a subsection in a notebook

Let's say I have a section in a notebook, which I begin with a cmd-4 keystroke. I type in some text and expressions, and now I want to introduce a subsection for ...
3
votes
2answers
155 views

How can I change the highlighting color of an InlineMathCell?

When using the InlineMathCell one types Ctrl+9 within the text cell, and gets a slot for starting typing the InlineMathCell part. When typing the content of the InlineMathCell is slightly highlighted ...
1
vote
0answers
87 views

Remote access to notebook is very slow

I am using Mathematica at work remotely from a computer in my building and I can edit notebooks by opening them from terminal via ssh without problem (a little slow if there is a figure with many ...
16
votes
1answer
299 views

How does the built-in debugger decide what to highlight?

How does the built-in debugger decide which definition to highlight in the notebook when Break on messages" is enabled? Here's an example to illustrate what I mean. First, enable the debugger ...
4
votes
2answers
222 views

Adapting “Find and Replace” functionality to work with Patterns

I was thinking if there is something like Find and Replace (Crtl+F) functionality adapted to work with patterns. Probably not, but it seems possible to create this with some effort and skills in ...
1
vote
1answer
103 views

Is it possible to create a styled cell with pre-defined content?

When you create a new styled notebook from the Stylesheets chooser dialag, you get a new notebook using the chosen style with some sample content provided. But if you apply styles from the same ...
13
votes
2answers
1k views

Relative paths for portable notebooks in Mathematica

I cannot find how to use relative paths in Mathematica. My directory structure is simple. ...
0
votes
1answer
83 views

Evaluation of notebook from chosen cell to end

There is option to evaluate the complete notebook but I wanted to know if its possible to evaluate notebook from some desired cell to end or some other desired cell following?
6
votes
1answer
106 views

ClearAll[“Global`*”] stops working with Context set to 'unique to this Notebook'

I just changed my default notebook context to 'unique to this Notebook' so that variables don't roll across numerous open notebooks. Doing this, however, made the command ClearAll["Global*"] stop ...
3
votes
2answers
1k 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 ...
2
votes
0answers
59 views

How to retroactively merge cell change history according to a merge interval

I recently noted that there is an option in the options inspector to set a merge interval for cell changes. This (I think) prevents a quick series of changes from spamming your notebook history with a ...
3
votes
1answer
126 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. ...
2
votes
1answer
77 views

Fastest way to select the longest cell

I'm trying to learn low-level notebook programming and I have a question. Is there faster way to select the longest cell in a notebook than this: ...
5
votes
0answers
141 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 ...
10
votes
1answer
158 views

Cell brackets on left side?

Is it possible to have the cell brackets on the left? I looked through the options and couldn't find anything, but maybe it's some kind of esoteric style setting or something. The reason I'm looking ...
16
votes
2answers
3k views

Pasting $\LaTeX$ into a Mathematica notebook

I have read that $\LaTeX$ source can be directly pasted into a Mathematica notebook. However, I have been unsuccessful in this regard. An example of the errors received are: ...
9
votes
1answer
256 views

How can I change the style of every newly opened notebook?

I'd like to make Mathematica open a new notebook using the Natural Color template (under the Creative category) by default. Is that possible? If so, how?
2
votes
1answer
70 views

Use Initialization Cells to open a CellGroup

I would like to use "Evaluate Initialization Cells" to open a CellGroup in a notebook. However, the following code doesn't work if placed in an initialization cell: ...
2
votes
1answer
83 views

How to make a notebook not savable?

How to make a particular notebook not savable? Optionally, how to do this by evaluating a command in the notebook?
4
votes
1answer
91 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 ...
3
votes
1answer
171 views

Use different kernels for different Notebooks

I know that the command LaunchKernels[] starts up four kernels on my machine: ...
3
votes
1answer
118 views

Use NotebookWrite with Graphics?

I am trying to use NotebookWrite to paste a plot into another notebook. The code looks something like: ...
7
votes
1answer
149 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 ...
1
vote
1answer
57 views

How to change Compiled->False to Method->{Compiled->False} in multiple notebooks?

I have a collection of about 40 notebooks where the options for ParametricPlot and ParametricPlot3D have: Compiled->False and I need to switch any/all ...
1
vote
2answers
105 views

How to set the background of a section to light gray?

How to set the background of a section to light gray and leave background of content below and above the section as default?
11
votes
2answers
243 views

Is it possible to create Evaluatable cell which will be automatically overwritten?

Am trying to generate an Evaluatable cell which itself is an output cell which will be overwritten when the original Input cell ...
5
votes
3answers
242 views

Storing data in the Notebook in readable form

The common problem in my theretical 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 ...
4
votes
2answers
678 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
2answers
169 views

Background color of Code cell lost when convert a notebook file to pdf

Well, I have a notebook with the built-in stylesheet Preprint, which I'd like to convert it to pdf. Everything works well except for the code cells(I use the shortcut key alt+8 to create cells of code ...
3
votes
3answers
126 views

How to create a button that colors a selected piece of text in a cell?

I use Mathematica 9.0.1 and I want change the color of a selection in a text cell using a button. But when I use this code it changes the color of the entire cell. ...
2
votes
2answers
140 views

How to find out if invisible notebooks are still open

If I create a notebook CreateDocument and I set options such that Visible -> False, is there any way to tell if it's still ...
2
votes
0answers
38 views

Does an equivalent of marks in vim exist for navigating notebooks quickly? [duplicate]

Is it possible in the Mathematica front-end to associate a keyboard shortcut with a cursor location in the notebook (kind of like marks in vim) so that one can return to them quickly later? (Just ...
1
vote
1answer
97 views

Controlling preferences of deployed notebooks

The following screenshot shows a toy example to illustrate what I want to accomplish: The above mimics the structure a type of notebook that I want to deploy for both Mathematica and PlayerPro ...
3
votes
1answer
199 views

How to build and operate a master Notebook?

Suppose you have some notebooks, they work for a family of related tasks, each one doing a certain task. Lets say Notebook 1 gets two inputs from its variables in11 ...
4
votes
0answers
81 views

Is there a way to check whether two notebooks share the same variables?

When I code in Mathematica, I often re-use code from old notebooks which fulfilled a specific purpose; for example, one testing for soft matches in strings, or one that identifies outliers on a graph ...
2
votes
2answers
394 views

Copy last/second last (etc.) input from history into current cell

I like to use terminals (e.g. gnome-terminal) where you can use the up key to copy the last command into the current input 'field'. For example, to repeat the last ...
1
vote
3answers
132 views

Entering Sum in traditional form

The documentation for Sum says that it is possible to replace Sum by EscsumEsc. The limits ($i_\max$ and $i_\min$) should be ...