Questions tagged [notebooks]

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.

Filter by
Sorted by
Tagged with
24
votes
6answers
4k views

Annoying display truncation of numerical results

I have a lot of data to inspect. An example of a number in my program is 123.189094 This gets displayed as 123.189 ...
77
votes
2answers
8k views

Is there a way to separate variables between multiple notebooks?

I often correct homework by checking the calculations in Mathematica. Sometimes you would like to have two solutions open at once. However often defined symbols such as ...
63
votes
7answers
17k views

Saving data inside a notebook so that I don't have to run it again?

Piggybacking on this, I am somehow not fully convinced that I can't save data generated by a calculation in a mathematica file so that when I re-launch said file, I wouldn't have to run my ...
39
votes
4answers
10k views

How to Keep Input Cells Hidden After Evaluating Notebook

I've created a notebook for use in an in-class presentation. There is a fair amount of MMA code, and my students know nothing about MMA nor do they need to. I don't want to distract them with the code....
22
votes
2answers
4k views

How do I automatically evaluate a cell when a notebook is opened?

I'm trying to put together a GUI in Mathematica and need to evaluate one cell to kick that off. Is there a way to automatically evaluate that cell when the notebook is opened? Here is an example of ...
18
votes
7answers
6k views

Is there a notebook autosave frequency configuration?

I've had Mathematica crash on me a number of times, and have had to recreate notebook contents from the last save point. I was looking for something in the preferences like an autosave frequency ...
34
votes
3answers
3k views

How to place an image inside a notebook, with the minimum memory footprint?

When creating a notebook with images, like photos, the file tends to quickly get big, which makes it difficult to use the notebook format for training material containing a lot of images. Are there ...
11
votes
1answer
324 views

Programming scripts to create and modify stylesheets: problems with contexts

I am trying to emulate the shift and shift+tab feature in the Outline.nb stylesheet that comes with Mathematica. I added the following code to a private ...
37
votes
3answers
8k views

How to set default magnification for all windows

This is certainly a newbie question but I could not find the answer by searching. I am using Mathematica 8 under Windows 7. I want to use default magnification of 150% for all notebooks and help ...
17
votes
3answers
4k views

How do I create a package from an existing notebook?

I have a notebook containing some functions, for example: f[x_] := 2*x g[x_] := x^2 Now I would like to convert this notebook to a package, ...
41
votes
6answers
16k views

Is there a way to hide or toggle the visibility of code?

Many of my notebooks have a similar repeating structure, which is very convenient and reliable for my workflow: a chunk of code defining a Manipulate for exploring ...
60
votes
4answers
4k views

How to disable the small pop-up windows when mouse is over a Mathematica command in V10?

In version 10, when the mouse is over a Mathematica command, a small pop-up window comes up that one can click on for help on the command. Is there an option to disable this feature? Screen shot: I ...
54
votes
5answers
4k views

Are there suitable versioning systems for Mathematica notebooks?

I am considering a project using Mathematica and openCL. I know that the openCL C source code can be tracked. Has anyone used a versioning site or software so multiple developers can modify a common ...
17
votes
3answers
851 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 ...
11
votes
4answers
794 views

Set the style of a cell

I know it's possible to programmatically change options on the selection in a notebook. I'd like to create a button that lets me change the style of a cell. It's a style that doesn't have a keyboard ...
31
votes
1answer
2k views

How to write documentation in Wolfram Style?

Rather than craft my own stylesheets for documentation, I'd like to emulate (copy? ape? borrow?) the Wolfram style. Here is a very small example (type this in the help-box, which you get by pressing <...
42
votes
1answer
3k views

How to export a Mathematica notebook into Markdown?

Is there a way to export a Mathematica notebook into Markdown? I'm sure it's possible to implement rules for converting each Mathematica cell subexpression into Markdown, but I'm also sure that I ...
36
votes
2answers
2k views

How can I set an image to be the Notebook's background?

Is it possible to set a notebook's background to a nonscrolling image?
17
votes
3answers
3k views

Programmatically generate packages from notebook files?

Currently, there are two ways I know of to generate a package (.m) file from a notebook file; one is to set the AutoGeneratedPackage option in the Option Inspector, ...
13
votes
3answers
2k views

Quickly editing the stylesheet and saving it

I have a private stylesheet I'm using. I edit it by going to the menu Edit->Edit Stylesheet and then clicking on the private stylesheet cell. I can modify whatever I want but it never gets saved. The ...
13
votes
2answers
621 views

Create new notebook at fixed size

Using Ctrl+n we are effectively doing FrontEndTokenExecute["New"] and, at least on Windows, a new window has a WindowSize equal ...
55
votes
5answers
4k views

Can the banner in the Home Edition be removed?

The Mathematica Home Edition shows a banner at the top of every notebook: Is there a way to (permanently) get rid of it, without violating the EULA? Edit Yesterday, I sent this message to WRI ...
28
votes
2answers
1k views

Saving my code before cell evaluations: Insurance against front end hanging

I guess my programming working style is not unique. I develop programs one cell at a time, and when I have some confidence about what I did, I put all my mess together refining the code, building up ...
16
votes
1answer
2k views

How to copy code out of notebook to an external text editor without extra line feeds being added?

I am simply trying to copy code from a cell (input cell) in a notebook, to paste the code into a plain text editor, and not have some lines wrap in the middle. I need to copy the code, as is, to a ...
29
votes
4answers
8k views

Relative paths for portable notebooks in Mathematica

I cannot find how to use relative paths in Mathematica. My directory structure is simple. ...
10
votes
4answers
1k views

Searching a phrase in all *.nb files

I have so many *.nb files in a folder. In one of them I have written a phrase, unfortunately I cannot remember that file. I am searching about it and the file in ...
10
votes
1answer
2k views

Triangle that collapse cells

I'm not very good in English , so is hard to explain but how put the triangle in the left that deploy or collapse a group of cells ?
30
votes
2answers
20k views

Delete the current notebook cell using the keyboard

Is there another way than pressing Ctrl+. until the whole cell is selected and then pressing Del? If this is not built in, can I create some sort of a global macro to do this and bind it to a ...
26
votes
2answers
2k views

Attaching a file to a notebook

Is there a way to attach a file into a notebook and open it later with, for instance, a double click (or another action button)? In Mathematica windows version, the insert menu has the "object..." ...
20
votes
1answer
578 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 (...
22
votes
1answer
2k views

How to restore corrupted files?

I have a file that I can't reopen because MMa was "Not Responding" and I had to shut it down. I found links online to this: http://support.wolfram.com/kb/12423 I executed those two instructions in a ...
15
votes
3answers
442 views

How to create a notebook element that can replace itself?

I would like to create a notebook element that can replace itself. Here's an example to illustrate: ...
29
votes
4answers
8k views

Keyboard shortcut to evaluate notebook

(If this is entirely trivial, although I couldn't find an answer as much as I searched the archives, I will delete the question.) How could I add a keyboard shortcut to evaluate the entire notebook ...
18
votes
3answers
3k views

Converting a notebook to plain text programmatically

It is possible to export a notebook to plain text format (practically just extracting all the text from it and discarding formatting) using the File -> Save As......
16
votes
3answers
1k views

Is it possible to insert an animated image into Mathematica notebook?

I find it very convenient to use Mathematica notebooks to organize the codes + results. I was wondering if it is possible to insert an animated image (say an animated gif) in the middle of a notebook....
11
votes
2answers
449 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 ...
7
votes
3answers
401 views

Friendly way to make previous large calculation results reusable in a new session

Very often, I need to do same calculations under different parameters for comparing the results. Every calculation may generate a large data set; for example, the calculation result of ...
6
votes
1answer
531 views

How can I make an invisible Cell?

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

Notebook's WindowSize interference with contents' Dynamic ImageSizes

Bug introduced in 8 or earlier and persists through 11.3 Consider the following MWE: ...
7
votes
1answer
731 views

Can I enter the traditional form for Binomial as input in an expression?

Is there a way to enter the traditional form of a binomial coefficient, i.e. ${n \choose k}$ instead of Binomial[n,k], like I would enter a radical sign $\sqrt{x}$ ...
91
votes
5answers
8k 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 ...
20
votes
2answers
2k views

How to make a parallel auto-generated .m package from Initialization cells?

according to the documentation at ref/InitializationCell, When you first save a notebook that contains initialization cells, you have the option to make a ...
8
votes
2answers
2k views

How to change the default Notebook stylesheet

For everyday work I use a custom notebook template. Its name DefaultModified.nb However, in order to open it I need to first open a built-in default notebook, go to the Menu/Format/StyleSheet and ...
18
votes
3answers
5k views

Keeping Text Size the Same Throughout Entire Notebook File

Is there a way in which when you choose to format the size of the font within your notebook, for a particular cell, when you go into another cell, the default size font (12pt) will not be re-activated....
14
votes
2answers
762 views

How to pipe a stream to another notebook?

Can I pipe an OutputStream object created by OpenWrite (or similar) to a notebook instead of a file? I am aware that I can use <...
12
votes
2answers
964 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 <...
10
votes
1answer
399 views

How to convert arbitrary raw boxes directly into String?

This question is motivated by the recent question about searching inside of the NB files. According to the Documentation, ToString expects a high-level WL ...
9
votes
4answers
683 views

How to Detect Special Key Presses in a Notebook?

We can use: SetOptions[EvaluationNotebook[], NotebookEventActions -> {{"KeyDown","s"} :> Print["triggered"]}] to make the current notebook respond to s ...
8
votes
4answers
466 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 ...
5
votes
1answer
198 views

Evaluation leak from Dynamic exported to NB format

This is closely related to the recent: Creating self destructing notebook. However the answer doesn't work in my case. A small example is: ...

1
2 3 4 5
7