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)

0
votes
1answer
40 views

Global variables

I have a workbook I am writing, there are 2 cells in it and then each cell is divided into sub cells. At the top of the first cell i made a bunch of variable assignments such as length=10, x=6, d=4, ...
7
votes
1answer
82 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 ...
4
votes
1answer
67 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: ...
1
vote
1answer
40 views

How to programatically remove an option for all cells?

I'm trying to remove the CellGroupingRules options in every cell in a notebook. Eventually I opened the Notebook in a text ...
6
votes
2answers
122 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) ...
0
votes
1answer
34 views

How to implement specific cell grouping behavior?

Here's the situation in my Mathematica notebook: I'd like the bottom cell to be grouped with the cells above it. Here are those same cells toggled into code: ...
4
votes
1answer
58 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!
0
votes
0answers
14 views

Distribute Definitions to different Evaluator

I would like to pass on a definition from one Kernel to the other. With that I mean manually configured Kernels. In this case, I do not want to use the inbuilt Parallelization options, in order to ...
7
votes
1answer
98 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 ...
8
votes
1answer
167 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 ...
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 ...
7
votes
1answer
111 views

Hidden parent stylesheet?

Please follow those steps: ...
4
votes
1answer
73 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?
7
votes
2answers
218 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 ...
2
votes
1answer
56 views

Tab in Input cell

Why is it impossible to use tab to indent e.g. an inline comment i.e. (* ... *) in an Input cell? However, I have seen that it is possible, if I use Cell>ConvertTo>TextDisplay. The cell remains ...
7
votes
1answer
85 views

How to sort cells?

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

About making grouping cells

I would like to present the outputs of my code in a notebook with grouped cells as with a hierarchical structure like this: Section 1 Sub-section 1 Result 1 Sub-section 2 Result 2 ...
1
vote
1answer
27 views

Removing vertical/horizontal edges from some cell frames

I recently asked a question regarding adjusting adjacent cells' margins to make their background color appear continuous. With these settings in place, I'd like to put a single frame around the ...
1
vote
1answer
57 views

Table of sections with CellPrint

I am trying to produce a table of sections with each section containing a DynamicModule. My two questions are: (1) How do I produce grouped sections that are folded ...
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?
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 ...
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 ...
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: ...
1
vote
1answer
71 views

Writing cells from other notebooks into current notebook?

I have a large number of Mathematica notebooks which contain study notes for different topics (as opposed to actual Mathematica Code). I'm trying to develop some code to randomly pull parts of a ...
1
vote
1answer
61 views

How would I set the equation number for an EquationNumbered cell?

Regardless of how many EquationNumbered cells are above or below, every new EquationNumbered cell that I add in my notebook shows (1) as the equation number. Is there a way to correct the equation ...
0
votes
1answer
34 views

How can i specify a NotebookSelection by a given CellObject?

My Questing is very simple. If I have a CellObject e.g. CellObject[Text], I can move the selection to this ...
2
votes
0answers
80 views

How to convert a notebook to an association and back?

I have a notebook that serves as a nice readable document but is it a database of sorts, I'd like to transform this into an association so I can manipulate and export it as a dataset. Here is a sample ...
1
vote
1answer
97 views

How can I copy & paste cell styles?

In Mac's mail app the key shortcut "command + option + c" gives a copy selected text style and "cmd + opt + v" pastes the style. Is there a way to achieve this with cell styles? The keyboard part is ...
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: ...
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
53 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: ...
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 ...
2
votes
1answer
72 views

Programmatically selecting non adjacent Cells

One can of course Ctrl + MouseClick to select 1st and 3rd cell. But how to select non adjacent Cells programmatically? I was looking for neat examples here or in ...
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
119 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 ...
0
votes
1answer
45 views

How make first automatic numbering cell for a style number 1 not 0?

I have a cell style "Figure" for a notebook, defined as: Cell[StyleData["Figure", StyleDefinitions -> StyleData["Text"]], MenuSortingValue->10000] In ...
3
votes
1answer
96 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 ...
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 ...
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?
0
votes
1answer
122 views

Front-end: How can one programmatically extract window titles?

I would like to programmatically get the titles that appear at the top of notebook windows, particularly for notebooks that have not yet been saved (if they have been saved, I can get the information ...
1
vote
1answer
64 views

Converting a testing notebook to a notebook

I build a testing notebook and it got too slow and unreliable with many test cases. I want to have a new (classical) notebook with all the the inputs I have in the testing one. Is there an automatic ...
2
votes
1answer
111 views

Deleting empty cells and selecting cells matching a pattern

Is there any way for me to automatically select all cells that are completely empty? You know, those cells that you create but end up cutting what's in them and paste it somewhere else, so after a ...
3
votes
4answers
155 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 ...
2
votes
0answers
51 views

Unique CellID in-between notebooks

Documentation says that CellID is guaranteed to be unique for a given notebook. I've noticed that CellID are fairly high numbers and although probabilistically speaking the odds of coincidence are ...
1
vote
1answer
70 views

Save a notebook with “input” and “output” on the left of all cells

How to make Mathematica save a notebook with "input 1" and "output 1" on the left of cells? If I open a saved notebook, those tags are gone.
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 ...
1
vote
2answers
98 views

Overwrite contents of a cell

I am trying to figure out a way to change the contents of a cell that has previously been evaluated in my notebook. To do this, I'd like to overwrite the cell. I've seen questions like How to pipe ...
2
votes
1answer
118 views

Open parent cell groups of selected cell

I wrote a small script for a palette, which allows me to highlight a specific cell in a notebook by using SelectionMove[mycell, All, Cell]. The cell is selected as ...
1
vote
2answers
101 views

Cell with no form using NotebookWrite

Is there a way to create a cell with no form? Usually a cell is either an input cell or an output cell, for example if you do NotebookWrite[InputNotebook, "test"] ...
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 ...