Questions tagged [cells]

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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
38 views

Cannot find DockedCells with Cells or NotebookFind

Request 1: A workaround for Cells or NotebookFind needs to be found for locating and returning the ...
user avatar
  • 1,881
10 votes
1 answer
120 views

How to decorate cells with widgets like jupyter and collab?

I would like to add a couple UI features from cells in python notebooks that I find helpful. Specifically, these two features from google's collaboratory and vs-code's jupyter mode: To the left of ...
user avatar
  • 30.7k
2 votes
2 answers
44 views

Automatically close the parent cell in a grouped set

There are several questions in Mma.SE related to programmatically opening and closing cells, but I could not find quite what I'm seeking. Here's a minimal example: ...
user avatar
2 votes
2 answers
83 views

How to prevent overwriting the latest output

Suppose I have a long notebook with three parts: ...
user avatar
  • 322
2 votes
1 answer
106 views

How to use same cell for printing in a loop?

I want to manually tag images. For example, we prepare a list of images like imgList = Table[Rasterize[i, ImageSize -> 50], {i, {a, b, c}}] it gives Now I made ...
user avatar
  • 16.2k
6 votes
1 answer
125 views

How to stop opening of cell groups after evaluation of the whole Notebook?

Bug introduced in 12.3 or earlier and persisting through 13.1.0 I have a long notebook with Section, Subsection, ...
user avatar
  • 1,446
4 votes
1 answer
47 views

How to select the outermost CellGroup that contains given cell?

Suppose we have a Notebook with a deeply nested structure (this is a simplified example, the Notebook can be huge): ...
user avatar
4 votes
1 answer
110 views

How to convert any string of code to an input cell?

This is a generalization of this question, which already has very nice answers. Suppose str is a string of valid code, so that ...
user avatar
  • 783
2 votes
2 answers
247 views

How to generate input cells whose code is determined dynamically?

Following this post, I want to use code to generate an input cell with new code. However, unlike the linked post, I want my code to dynamically determine the new code to be printed in the input cell. ...
user avatar
  • 783
0 votes
0 answers
19 views

Can I generated an initialization cell using CellPrint?

I want to do exactly what is done in this post, except I would like the generated cell to be an initialization cell. That is, I'd like to have my code automatically generate an input cell with new ...
user avatar
  • 783
7 votes
4 answers
161 views

How to determine the current width of the output cell area?

When answering this question, I suddenly realized that it is surprisingly difficult to determine the current width of the output cell contents. I tried to employ the ...
user avatar
7 votes
3 answers
125 views

How to insert AutomaticNumbering programmatically?

Preamble: I often work with the JournalArticle Stylesheet and use in it the styles "Figure" for graphics and "FigurCaption" for the corresponding caption. The figures should be ...
user avatar
2 votes
1 answer
133 views

Stop Mathematica’s automatic indentation on existing notebooks

This question relates to Mathematica 12.3 (and possibly many other versions). Mathematica's automatic indentation does not conform to my workflow. From the very old days of Mathematica 1.2, i.e. ...
user avatar
2 votes
1 answer
54 views

CellObject[Number] to its content

As in the following sreenshots, roughly speaking, Out[43] is CellObject[97601]. I want to set ...
user avatar
  • 3,085
4 votes
1 answer
110 views

Deploy and Deployed

I was trying to understand what happens when I insert Deployed -> True/False in an ExpressionCell but couldn't see a ...
user avatar
  • 41
0 votes
1 answer
41 views

Indefinitely Drag and Drop an Attached Cell

I created a drag and drop attached cell which can be moved and anchored anywhere in a notebook window. To try it out, execute the following code and click the Start button. Then move the panel ...
user avatar
  • 4,701
1 vote
2 answers
111 views

Change style of the above cell

How can I change the style of a given cell, by writing some code on the cell directly below the cell and executing it? ...
user avatar
  • 3,085
2 votes
1 answer
76 views

Text cell numbering

For input cells and output cells, there are automatic,natural numbering. In[1] 2+2 Out[1] 4 I mean In[1] and Out...
user avatar
  • 3,085
3 votes
0 answers
34 views

Consistent cell background color when using CellFrameLabels

Let's say I have the simple notebook ...
user avatar
  • 199
8 votes
2 answers
249 views

Drag and Drop an Attached Cell

I'm trying to create an attached cell that can be mouse dragged. I'm envisioning mouse-dragging the blue header bar to bring the entire header and the graphic to a new location at which point both ...
user avatar
  • 4,701
3 votes
0 answers
46 views

Are there any cell properties that you can use to terminate a cellgroup without starting a new one?

Suppose I have the following notebook: ...
user avatar
  • 18.8k
14 votes
2 answers
229 views

Stretching a mesh

Imagine I want to stretch a mesh with a 'rubberband-type' effect. That is, upon and elastic stretch from both side edges, the mesh centres simply scale as follows where the points are seeds for ...
user avatar
  • 4,368
2 votes
2 answers
86 views

How can the format of Initialization Cells be set to the format of normal input cells?

I don't like how initialization (or "Code") cells are formatted in notebooks, namely the grey background color and the spacing/wrapping settings. I want ...
user avatar
  • 483
3 votes
1 answer
129 views

How to find next graphic in notebook?

I have a notebook bloated by graphics and would like to delete many of them. To do this I would like an expression to find the next graphic. I tried: ...
user avatar
  • 1,857
1 vote
1 answer
41 views

How to attach output from Button function to bottom of Tabview output

My question is best explained with a simple example. Lets suppose we have: ...
user avatar
2 votes
2 answers
115 views

First character of inline cell is partially cut off

Bug introduced in 12.3 or earlier and persisting through 13.1.0 [CASE:4900891] Notice how the "f" is partially cutoff in the following inline cell. Here is the textual form. ...
user avatar
  • 199
2 votes
1 answer
66 views

How can i selectively delete a dynamic output cell (e.g. from a progress bar)?

I make a progress indicator like this: ...
user avatar
0 votes
0 answers
40 views

How can I Iconize the result of an evaluation so that it isn't overwritten when I repeat the evaluation?

I have a long calculation that produces a list of lists. I would like to be able to make changes in the calculation, and reevaluate it, and then be able to determine if the result is unchanged. I can ...
user avatar
  • 5,320
1 vote
0 answers
73 views

Buggy EvaluationUnmatchedStyle for backgrounds with opacity

The EvaluationUnmatchedStyle option of PrivateCellOptions was introduced in v10, wherein any time input is changed, the corresponding output dims to signify that ...
user avatar
  • 313
3 votes
1 answer
127 views

How to explicitly open or close cell group?

There is a "OpenCloseGroup" in FrontEndTokenExecute. It act like toggle. If the selected cell group is open, ...
user avatar
  • 16.2k
3 votes
1 answer
62 views

Have Button fire with both Kernel and FrontEnd

Here's some code which, when evaluated, types an expression in the cell below it: ...
user avatar
  • 2,762
0 votes
2 answers
80 views

How to put the evaluated result in a text cell?

If I use the function Print, the result is not in a text cell. So I wonder If there's a function that I can use to put behind the function ...
user avatar
1 vote
0 answers
25 views

Deleting Cells in a notebook that is not the evaluation notebook

I use nb = CreateNotebook[] to create notebooks for processing messages. How do I delete anything that had been written previously when I start a new processing run?
user avatar
  • 5,320
0 votes
0 answers
17 views

Sorting A Slideshow By Cell Tags

I have a slideshow that is tagged using CellTags. What I'm trying to do is reorder the presentation programmatically. Creating A Notebook I'm going to purposely generate a notebook where the slides ...
user avatar
  • 747
3 votes
1 answer
81 views

Is it possible to substitute one style with another via Stylesheet?

When thinking on the question How to programmatically change CellStyle of all Cells from "Input" to "Code"? it crossed my mind that it may be possible to "intercept" ...
user avatar
1 vote
0 answers
21 views

Is it possible to insert a fixed-size Input Cell in a DockedCell toolbar that directs output if any to a specified Cell in same Notebook?

Ive been coding Mathematica for over a year but this language can do so much more than any other language hence beginners really do need a much longer gestation period. That is why this rarest of ...
user avatar
  • 1,881
5 votes
0 answers
96 views

"Ungroup Cells" broken in 12.3 (Confirmed by WR ... it's a bug)

** Edit: Just got off the phone with WR. Only one other person called in about this bug (although they did call in 3 times). Looks like it won't be fixed anytime soon unless they get more requests ...
user avatar
  • 4,701
14 votes
1 answer
206 views

How to create a general AttachedCell toolbar?

For example, when an image is displayed in the frontend, the image suggestion toolbar, which is an AttachedCell, pops up: It can can be found here, among other ...
user avatar
9 votes
3 answers
342 views

How to programmatically change CellStyle of all Cells from "Input" to "Code"?

I have a special notebook styled for only creating functions and their packages. I often lazily do Evaluate Notebook instead of finding and opening all cells I need ...
user avatar
  • 1,881
2 votes
0 answers
40 views

How to automatically name a Wolfram Notebook after the first title line of code if present?

I have a goal of somehow using Wolfram Mathematica's Notebook object functionality to program an initialization cell that will automatically save and name a new file after a title line of code ...
user avatar
5 votes
1 answer
121 views

Avoiding Concave Polygons

In a vertex model, vertices in a lattice are modelled by a set of ODEs. A T1 transition is the following: when a certain edge becomes small enough (given a threshold), two cells stop being connected, ...
user avatar
  • 4,368
6 votes
1 answer
307 views

A way to contract input in Mathematica

If I input a giant matrix in Mathematica, and it is contained in a cell, is there a way to contract it so that it uses up significantly less space in the notebook?
user avatar
3 votes
2 answers
92 views

Evaluation time for each evaluated cell (as a whole)

I have a Mathematica notebook that has a number of cells, and each cell has a number of code lines. Sometimes it takes long hours to finish evaluating each cell and I want to compare their evaluation ...
user avatar
4 votes
0 answers
48 views

Function for identifying wasteful cells (e.g. needless large graphics) - does this exist already?

I noticed that I have a bad habit of saving notebooks with huge graphics in them and it's starting to impact storage and load times a little much. I figured I could make a routine to point out the few ...
user avatar
  • 611
0 votes
0 answers
46 views

How to display CellObjects as Cells in PopupWindow

I am attempting to use a celltag ("temp") to display an entire cell in a PopupWindow. To see what I am attempting to do, open a new notebook and evaluate the following: ...
user avatar
  • 4,701
2 votes
0 answers
87 views

Realtime background blur

Is it possible to have partially transparent cells (attached or docked) with live background blur? Something like this: Here's what I've tried: ...
user avatar
  • 30.7k
0 votes
0 answers
61 views

Cell frame bugged?

I used to always have cell frames on as a general option, but then they became bugged for me a little while back, maybe with 12.0 or 12.1. When you have any expression that extends horizontally past ...
user avatar
  • 611
1 vote
0 answers
24 views

how to navigate to the cell where a user-custom function is defined?

For a large notebook involving many custom functions, I often feel helpless in locating their definitions: there seems to lack an easy to locate the definition of a function. On the contrary, for ...
user avatar
  • 4,177
2 votes
1 answer
47 views

CellPrint with grouping the original generating code

I'm creating a large number of cells within a document programmatically, for example: ...
user avatar
0 votes
0 answers
37 views

Automate `select cell` and `evaluate selected cell`

Manually I can select a set of cells (or one grouped cell) and click evaluate cell My questions Is it possible to start this job ...
user avatar

1
2 3 4 5
9