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
5 votes
3 answers
93 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
127 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
50 views

CellObject[Number] to its content

As in the following sreenshots, roughly speaking, Out[43] is CellObject[97601]. I want to set ...
user avatar
  • 2,877
4 votes
1 answer
106 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
1 vote
2 answers
108 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
  • 2,877
2 votes
1 answer
70 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
  • 2,877
3 votes
0 answers
34 views

Consistent cell background color when using CellFrameLabels

Let's say I have the simple notebook ...
user avatar
  • 199
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.3k
14 votes
2 answers
225 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,246
2 votes
2 answers
79 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
127 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
39 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
105 views

First character of inline cell is partially cut off

Bug introduced in 12.3 or earlier and persisting through 13.0.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
64 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
39 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
116 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
  • 15.7k
3 votes
1 answer
60 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,688
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
16 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
80 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,837
5 votes
0 answers
94 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,681
14 votes
1 answer
205 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
324 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,837
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
119 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,246
6 votes
1 answer
304 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
85 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
47 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
44 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,681
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.5k
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
44 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
31 views

How to change default cell style of WSL files?

In *.wsl files when I create a new input cell as usual it creates a Code cell as can be seen by inspecting the underlying code: This is how ...
user avatar
  • 618
0 votes
0 answers
32 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
0 votes
1 answer
62 views

Setting automatic dividers when merging groups

Imagine I have my code split into multiple sections, like so Suppose I now select all cells and merge them, getting Is it possible to automatic set a divider between the different code sections? I'm ...
user avatar
  • 4,246
1 vote
1 answer
57 views

Deleting all outputs on Notebook close

Is is possible to set up a Mathematica notebook so that all outputs are automatically deleted when the notebook is closed? I was trying to look for some function like ...
user avatar
  • 4,246
3 votes
1 answer
94 views

Write commands in a texteditor as a low-level notebook expression

I want to write a notebook file by myself. I use a text editor (such as Vim) to do that, for the purpose of having full control of my code I am writing, and to really understand what is in my .nb file ...
user avatar
  • 309
5 votes
1 answer
77 views

Show group opener on Notebook startup

When I re-open a previously saved notebook in which a group of cells is expanded, the group opener sign does not appear. See, for example However when I collapse using the right-side group tracks and ...
user avatar
  • 4,246
3 votes
0 answers
42 views

How to create a "DisplayFormulaNumbered" cell inside a "Text" cell

Is it possible to put a "DisplayFormulaNumbered" cell (containing just an equation) inside a larger outside cell (a "Text" cell with a thin frame)? See pic below for my desired ...
user avatar
  • 4,681
1 vote
1 answer
45 views

Stylesheet that assigns CellIDs as CellTags

For a given notebook, I can turn on CellIDs by opening the notebook's stylesheet and adding the following code: ...
user avatar
  • 4,681
6 votes
1 answer
168 views

How insert into Text cell chevron symbols used for Inline GroupOpener icons?

If in OptionInspector I select option "Inline" for Cell Options > Display Options > ShowGroupOpener for section-like cells, then when such a group is closed it shows an icon that is a ...
user avatar
  • 11.3k
4 votes
1 answer
98 views

Set a background color for several adjacent cells and "page"

I'm using a book style sheet but this question applies to the standard notebook interface as well. I'm writing a sequence of cells in different styles (text, equation, figure, figure caption, ...) in ...
user avatar
0 votes
1 answer
42 views

How to change style/content of cell that is programmatically generated, using a checkbox?

I am programmatically generating some cells that have a checkbox along with some text. The following code creates a button which when clicked, creates such cells. ...
user avatar
  • 483
1 vote
1 answer
59 views

Check if two cells are identifcal

Is it possible to check whether two cells in a Mathematica notebook have exactly the same code? I'm comparing two bits of code that might be the same, but rather than eye-checking, I wonder if there ...
user avatar
  • 4,246
3 votes
0 answers
80 views

Create "Python Code" cells using custom executable

In https://mathematica.stackexchange.com/a/155815/45020 it is explained how to run cells using a custom virtual environment. How can I quickly create a cell that is evaluated using this environment. ...
user avatar
  • 3,603
2 votes
1 answer
42 views

How to generate Code cell including newlines

I want to programmatically create a "Code" style cell with commands separated by ; and a new line (from some list). ...
user avatar
  • 3,603

1
2 3 4 5
8