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
49 views

Enums in ONE text cell of a notebook?

Is it possible to have an enumeration as an integral part of a text cell, so that they all together form one cell? Reason for this question: I would like to have a text cell (e.g. for a theorem) and ...
  • 247
0 votes
0 answers
30 views

How might one create a Button that wraps everything hilghlighted with mouse with double quotes similar to Comment/Uncomment?

I find typing doublequotes around characters to create strings a bit annoying because it always slows me down. The doublequotation marks lie right at my achilles heel on keyboards. It's too close to ...
  • 2,217
4 votes
1 answer
175 views

Collapse (hide) code inside a function

I often use structures similar to the "func" below, however I would like to be able to "hide" the function definitions (similar to cell grouping using a group opener). I think an ...
  • 141
0 votes
0 answers
193 views

The new Default Toolbar in 13.1 may have a bug in which a label appears over it. Can label be removed?

This post does not ask how to stop new toolbar from appearing but how to remove the described label above it. I finally installed 13.1 and to my surprise Wolfram added a new ...
  • 2,217
1 vote
1 answer
85 views

hidden newline in long cell entries

I need to store long strings from mathematica to a text file. Unfortunately, mathematica provides long cell entries (input/output) after approx the 70th position with a hidden backslash and a new line ...
  • 13
1 vote
0 answers
27 views

How to make my own external language cell evaluator

We can type > and select python to insert python external language cell into notebook. Then we can write python code inside it and evaluate it by pressing ...
  • 5,215
1 vote
0 answers
23 views

Sequential vs Nested Module for closing tagged cell

I have the following simple line of code in my notebook Plot[x^2, {x, 0, 2}] I add a CellTag with the string "Plot" to that cell. Sequential Module I ...
  • 14.3k
8 votes
2 answers
238 views

Creating Picture-in-Picture functionality by Attaching a Notebook to a Notebook using AttachCell[]

I use Mathematica for math lectures at my school. I would like to find a way to attach a secondary notebook to a primary notebook using AttachCell[]. The idea is to have picture-in-picture (PIP) ...
  • 4,887
0 votes
0 answers
30 views

Convenient way to make a text cell togglable

I like being able to hide text cells in a notebook. Currently I am doing this by writing another text cell above the current text cell, writing "open" and then grouping the cells. That way ...
  • 3,417
3 votes
2 answers
86 views

Left, center, and right justification within a single cell

I can write a cell with the text alignment on the right: ...
0 votes
1 answer
50 views

Is there a simple method to export an input cell? [duplicate]

This is a code of an input cell: a = 1 + 5*8; b = {6, 99}; Entity["MathWorld", "FunctionGraph"] Plot[x, {x, First[b], Last[b]}] I hope to get a ...
  • 24.3k
2 votes
1 answer
51 views

What properties make a valid CellID?

The documentation for CellID only mentions that it will be a number. But what kind of number? Can it be a real number with a decimal? How about a negative number?
  • 2,217
1 vote
2 answers
64 views

How restore Default stylesheet's new type of group openers?

With the Default stylesheet (in Mathematica 13.1 and several versions earlier), the new kind of group opener for sections, subsections, etc., appears as in this screenshot: When I apply a certain ...
  • 11.6k
1 vote
1 answer
126 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 ...
  • 2,217
12 votes
1 answer
154 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 ...
  • 30.9k
2 votes
2 answers
49 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: ...
2 votes
2 answers
93 views

How to prevent overwriting the latest output

Suppose I have a long notebook with three parts: ...
  • 972
2 votes
1 answer
125 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 ...
  • 16.4k
6 votes
1 answer
138 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, ...
  • 1,468
4 votes
1 answer
51 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): ...
4 votes
1 answer
122 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 ...
  • 793
2 votes
2 answers
255 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. ...
  • 793
0 votes
0 answers
21 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 ...
  • 793
8 votes
4 answers
195 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 ...
7 votes
3 answers
131 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 ...
2 votes
1 answer
149 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. ...
2 votes
1 answer
63 views

CellObject[Number] to its content

As in the following sreenshots, roughly speaking, Out[43] is CellObject[97601]. I want to set ...
  • 3,367
4 votes
1 answer
115 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 ...
  • 41
0 votes
1 answer
50 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 ...
  • 4,887
1 vote
2 answers
121 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? ...
  • 3,367
2 votes
1 answer
82 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...
  • 3,367
3 votes
0 answers
37 views

Consistent cell background color when using CellFrameLabels

Let's say I have the simple notebook ...
  • 199
8 votes
2 answers
274 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 ...
  • 4,887
3 votes
0 answers
47 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: ...
  • 19.5k
14 votes
2 answers
239 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 ...
  • 4,250
2 votes
2 answers
98 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 ...
  • 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: ...
  • 1,857
1 vote
1 answer
43 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: ...
2 votes
2 answers
117 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. ...
  • 199
2 votes
1 answer
77 views

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

I make a progress indicator like this: ...
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 ...
  • 5,362
1 vote
0 answers
74 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 ...
  • 323
3 votes
1 answer
147 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, ...
  • 16.4k
3 votes
1 answer
66 views

Have Button fire with both Kernel and FrontEnd

Here's some code which, when evaluated, types an expression in the cell below it: ...
  • 3,099
0 votes
2 answers
83 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 ...
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?
  • 5,362
0 votes
0 answers
19 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 ...
  • 747
3 votes
1 answer
88 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" ...
1 vote
0 answers
24 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 ...
  • 2,217
5 votes
0 answers
104 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 ...
  • 4,887

1
2 3 4 5
9