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)

25
votes
4answers
6k 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 ...
14
votes
2answers
504 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
422 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
438 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, ...
13
votes
1answer
130 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 ...
12
votes
1answer
1k 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: ...
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
168 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
134 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
221 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
187 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
153 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
94 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
0answers
68 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
2answers
275 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 ...
7
votes
2answers
267 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
109 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
258 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
136 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
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
125 views

Hidden parent stylesheet?

Please follow those steps: ...
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:
6
votes
3answers
241 views

Creating centered inline cell in text cell

The cell corresponds to the textual form ...
6
votes
2answers
223 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
171 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
605 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
144 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
117 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
303 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
60 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
100 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
64 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
85 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, ...
5
votes
1answer
62 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
162 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
67 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
51 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
101 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
125 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
1answer
199 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 ...
4
votes
2answers
123 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: ...
4
votes
2answers
148 views

Headings, subheadings, text cells etc and Alt+n

This is a minor point but annoying. I have just upgraded to version 10.0.2.0 and discovered that you must select a bracket before doing Alt+1, or Alt +7 to make a cell a heading or text cell. This was ...
4
votes
1answer
183 views

How can I remove I a horizontal line I inserted into my notebook?

Inserted a horizontal line with Right click > Insert > Thin Horizontal Line. Cannot see a way to remove such a line. Help!
4
votes
1answer
106 views

Split/unmerge merged cells in notebook file

I have merged cells in a Notebook file. Is there a way to split such a merged cell group back to single cells, in each of them being one command?
4
votes
2answers
251 views

Modified Cell Different Display

Is there a way to show maybe a slightly different color, or change the cell bracketing color of a Mathematica cell when it has been modified? Ideally it would be nice to follow the standard of ...
4
votes
1answer
93 views

How can I import html fragments as formatted cells?

I see that there is limited support for "HTMLFragment" in Export, but I figured with all the work that went into porting Mathematica into the Wolfram Cloud there should be a way to Import ...
4
votes
1answer
171 views

How to hide inline Cells

By giving a cell the simple option CellOpen -> False, it can be hidden from view. But for inline cells (cell within a cell) this does not work. An option ...
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
0answers
77 views

“ClosingActions” option for FrontEnd`AttachCell [duplicate]

I'm looking to find the possible values for the ClosingActions options FrontEndAttachCell. I have found ...
4
votes
0answers
121 views

Rearrange cells without cut-paste

When working in a Mathematica notebook, I often want to reorder cells. Most of the time, I am adding cells at the bottom of the notebook, until I realize it may be better to insert this calculation at ...