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)

23
votes
4answers
5k 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
380 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
436 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
2answers
446 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), ...
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
206 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
157 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 ...
8
votes
1answer
166 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 ...
8
votes
2answers
144 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 ...
7
votes
2answers
216 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
252 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
96 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
111 views

Hidden parent stylesheet?

Please follow those steps: ...
7
votes
1answer
84 views

How to sort cells?

Is there a way to programmatically reorder the section cells in a notebook alphabetically? For example:
6
votes
3answers
200 views

Creating centered inline cell in text cell

The cell corresponds to the textual form ...
6
votes
1answer
156 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
528 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
1answer
254 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?
5
votes
2answers
172 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 ...
5
votes
1answer
53 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
128 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
116 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 ...
4
votes
2answers
103 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
247 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 ...
4
votes
2answers
138 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
57 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
71 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
242 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
81 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
2answers
83 views
+50

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) ...
4
votes
0answers
106 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 ...
3
votes
4answers
154 views

Frontend: Adding cell-type choices to the “Choose how to enter input” drop-down [duplicate]

In most of the notebooks I work in, I find myself using 2 or three cell-types almost exclusively (typically regular input, and some subset of section/subsection/chapter). A minor annoyance I run into ...
3
votes
4answers
118 views

How to combine selected out cells into a list? [closed]

I have a loop that was printing out results, and now I'm left with many cells in different sections and I need to combine them (the values in them) into a list I can work with. For example, applied to ...
3
votes
1answer
85 views

How can I programmatically remove tagged cells without scrolling to them?

I've learned a rather succinct way to delete tagged cells using NotebookLocate, but I would prefer the notebook did not scroll to the selection just for a delete ...
3
votes
1answer
81 views

Want actual cell data from CellEvaluationFunction

Let's say I print a cell like so. CellPrint@Cell[ BoxData[" "], "Input", Evaluatable -> True, CellEvaluationFunction -> Function[Print[#];] ] Now I ...
3
votes
1answer
67 views

Column and CellLabel

Is it possible to add a CellLabel over multiple lines? When trying the code SetOptions[ NotebookSelect[mb], CellLabel-> Column@{"line 1", "line 2"} ] with a ...
3
votes
1answer
53 views

Why TeXForm[] do not display to notebook if followed by OutputForm[] in same cell?

Can someone please explain to me the logic of this: In one cell, when writing ...
3
votes
1answer
234 views

Welcome screen (V9): selecting notebook from Open Recent … results in initialization cells not evaluating

The following represents an abbreviated example of more complicated code, but it replicates a problem the more complicated code encounters. ...
3
votes
1answer
94 views

Evaluate specific cells in Mathematica

I have a very simple problem with Mathematica that I couldn't find an easy answer to. I have long notebook with a lot of cells and want to evaluate a specific cells inline from another cell. So far I ...
3
votes
0answers
46 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 ...
3
votes
0answers
56 views

How can I set up a cell style that is ascending dates?

Outline style notebooks have cell counters that are simply ascending numbers, but what if I want to apply a function to them and have descending dates like this: So that they auto format and the ...
3
votes
0answers
52 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: ...
3
votes
0answers
211 views

How copy a large cell into clipboard using `input text`?

This is a strange problem and everything I tried did not work. I have a very large single Manipulate cell (it is a demonstration stylesheet notebook, hence this cell have to be one), and I simply ...
2
votes
2answers
62 views

Get the unevaluated expression from a numbered cell

If a cell exists as below: In[1] := (xyPoints = {{1,2},{2,5},{3,10}}; ListLinePlot[xyPoints]) Is it possible to get at the expression rather than the plot shown ...
2
votes
1answer
118 views

How to mimic Org-Mode with cell dingbats?

I love using org-mode to organize my to-do lists, the functionality is amazing, but it suffers from being stuck inside the emacs terminal... I'm hoping to replicate some basic features into a ...
2
votes
1answer
62 views

How to get the content size (in pixels) of the output in an output cell?

How to get the content size (in pixels, width and height) of the output in an output cell?
2
votes
1answer
128 views

WholeCellGroupOpener and Hyperlinks

My problem is: I would like to activate WholeCellGroupOpener on a cell containing hyperlinks. But when I do that, the hyperlinks are no longer active. Is there a way to change the order of the two, so ...
2
votes
1answer
84 views

How can I make new outline cells be created above the current cell on return?

When you hit enter inside an item styled cell (e.g. Cell["", "Outline1"]), a new cell of the same type is created underneath the cell you are currently editing. ...
2
votes
1answer
40 views

Inserting a closed section

Is there a way to insert a closed section? I know in .m files if you do (* ::Section::Closed:: *) and open the .m file using system editor, a closed section will be ...
2
votes
2answers
68 views

What is the fastest way to get notebook CellGroups / Cells structure?

So the question is how to get this kind of information: from This is one of my ideas: ...