Questions about cells and functionality related to cell structures, or the notebook cell hierachy which serves to organize the information in a Mathematica notebooks. This includes questions related to properties and options for cells that determine the overall look and behavior of the notebook.

learn more… | top users | synonyms (1)

27
votes
4answers
7k 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....
15
votes
2answers
388 views

Shell Emulation inside Mathematica

I am trying to create a Mathematica/shell syntax hybrid. I would like the following command wget -qO- "http://google.com/space line break\"" $var to be ...
15
votes
2answers
2k views

Any way to make my equations look better, more Latex like?

I find that the equations I write in Mathematica are not always publication quality. Here is a typical example: If I copy as Latex, then I get the following code: ...
15
votes
0answers
130 views

Any manual on cell grouping management?

Recently I come back to the problem of cell grouping and performed extensive search on this site and on MathGroup archive for information on how to use the possible values of the ...
14
votes
2answers
590 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), ...
14
votes
2answers
464 views

refer to result of cell above current cell?

% allows to refer to the result of the preceding calculation (preceding in time) but this seems not necessarily to be the cell just above a given cell. How can ...
14
votes
1answer
177 views

How to make a dynamic nested menu?

There is no dynamic controller that can represent a hierarchical menu structure: ActionMenu can only handle flat action lists. Thanks to Kuba, we know a lot about <...
14
votes
1answer
442 views

What is the real default CellEvaluationFunction?

The default CellEvaluationFunction is Identity but one can quickly see that this is handled specially as an equivalent function, ...
11
votes
3answers
222 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
182 views

Functions returns Command Completion Output

Is there a function that returns the output as if you invoked Command Completion. To help clarify I am looking for a function that returns the Cell Data as if you invoked ...
11
votes
1answer
159 views

How can I make a stylesheet that counts subcells?

The example cells in the documentation each have count of the cells inside their section: ...
10
votes
1answer
310 views

How to change the font color of a variable in whole input cell

I want to track the occurrence of a particular variable in a code. So the idea is to change its color. Usually I do it in a crude way - convert the code into text and then use ...
9
votes
1answer
207 views

What is FrontEnd`AttachedCell?

Perhaps it's not accessible from the front end, but what is this so-called attached cell? ...
8
votes
2answers
337 views

How to copy and paste $n$ lines from a text editor to $n$ cells?

If I copy from an external editor to Mathematica notebook a block of lines (with a code) line 1 line 2 ... line n then whole text is copied to a single cell. I ...
8
votes
2answers
160 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
2answers
112 views

Seeking for method to speedup and get more flexable control Notebook History

When doing calculations in notebook, I modify the code a lot, and there are several versions of similar codes in the same notebook. But I found myself easily forgot which version is the newest, and I ...
8
votes
1answer
100 views

How to sort cells?

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

How to construct a tree from a notebook?

Given the notebook itself we can think of it as a tree graph: the root vertex is the empty notebook itself, the headers of cell groups are vertices, and all other cells as leaf vertices. I'd like to ...
8
votes
0answers
83 views

What is a full list of cell styling options and sub-options?

I'm trying to customize a style sheet and have hit a few speed bumps and walls. Firstly, I can't see how to do a few specific things, like to set the color of the cell's left side label: Or how to ...
7
votes
4answers
206 views

Cell sizing and labeling for $\textit{MaTeX}$ equations

I am writing a book in the Wolfram CDF format and would like to improve upon the default equation typesetting of Mathematica. To this end I've loaded @Szabolcs' valuable MaTeX, which imports $\LaTeX$ ...
7
votes
2answers
281 views

Image analysis for extracting lines between cells

I have a 2D image as shown here and need to extract the spatial information about the curves in between each cell division. I have been able to analyze the image ...
7
votes
1answer
124 views

How to add a caption below a cell?

How can I change my stylesheet definition for a cell to optionally add a caption below? For example, I would like to add a caption to my "Program" cells shown here: like this (but with the option ...
7
votes
2answers
269 views

Add semicolon at the end of code line programmatically

Suppose we have several lines of code in a cell: a b; Module[{}, c d] e How can we wrap them in a CompoundExpression i.e. ...
7
votes
1answer
171 views

How to programmatically mark and then select a subset of input cells?

I'm developing a package that needs to exert significant control over a notebook while a user interacts with it. One specific thing that it needs to do, programmatically, is to select a specific ...
7
votes
1answer
74 views

Run several input cells in parallel

I have a notebook with several input cells that produce data which is then plotted into separate graphs. Since I do not want to save the results, because it makes the file huge, I keep the ...
7
votes
1answer
373 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
106 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 ...
7
votes
1answer
139 views

Hidden parent stylesheet?

Please follow those steps: ...
6
votes
3answers
276 views

Creating centered inline cell in text cell

The cell corresponds to the textual form ...
6
votes
2answers
275 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 ...
6
votes
1answer
190 views

Replace content of selected cells, each getting different new content

Let's say I select 2 different cells and then attempt to replace their content using NotebookWrite inside a button. How might I replace each cell's content ...
6
votes
2answers
663 views

Export notebook to pdf in landscape orientation

Assuming the following is a notebook with a linebreak: How might I export a landscape pdf (preferred although other formats could work) such that each cell content each group of cells above and ...
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
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 (...
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
373 views

How to fold output cells by default?

In Mathematica the default behavior of output cells is to pop up after the kernel has processed the input cells and got a result. I know I could add ; in the end of ...
5
votes
1answer
89 views

Toggle close all input cells in a notebook, keeping output cells open

For presentations, can all input cells in a notebook be toggled open/closed, while keeping output cells open? Either through menu or palette. Probably would not work well programmatically. Related ...
5
votes
2answers
110 views

Retrieving normal looking Mathematica input from a cell expression

After a bad saving, I had problems with my Mathematica notebook. I have expressions in this form: ...
5
votes
1answer
73 views

hotkey to mark the current cell and make it a text cell

In order to write to a Text cell, you usually just start typing. Then you find out that you are writing in an Input cell. Then you want to convert the current cell to a Text cell. In order to to this ...
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
65 views

How to set different default cell per section?

In various sections in my notebook I'd like the default cell type to be different, if possible, how can I specify this?
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
501 views

Is there a method to send different Cell evaluation to different core?

I am running Mathematica on a computer with multi CPU and every CPU has multicore. I am wondering if there exist a method to send different cell evaluation to different core? So if I already have a ...
5
votes
1answer
79 views

What are “\<” and “\>” delimiters in box expressions?

If I enter a string (say, "abc") in a cell, and then switch to box representation (Shift+Ctrl+E or menu item ...
5
votes
1answer
62 views

Exclude cells for cdf deployment

I have a demonstration notebook with a code development chapter and a demonstration chapter with a manipulate environment, like this depicted minimal example I know how to export a cdf but is there ...
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: ...
5
votes
1answer
129 views

Maintaining stylesheet information in Cell[]

I am working on formatting a cell for a slideshow presentation format such that a graphics object occupies the left half of the cell and bullets or other items occupy the right. The ancient ...
5
votes
0answers
36 views

Collapse cell groups when you close parent group?

I have a particularly long notebook. Here's what I'd like to do: to say in my stylesheet that upon closing certain types of cell-groups that all the cell-groups inside should close as well. That way ...
5
votes
0answers
80 views

“ClosingActions” option for FrontEnd`AttachCell [duplicate]

I'm looking to find the possible values for the ClosingActions options FrontEndAttachCell. I have found ...