Skip to main content

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
0 answers
51 views

Mathematica 13.1 - New Cell Options

I have been using Mathematica for many years now and never encountered anything like that. My version is 13.1. In one of my notebooks, I must have clicked some shortcut by mistake, and now the new ...
Omer Amit's user avatar
1 vote
1 answer
44 views

Close all subgroups, programmatically

I know the key code for closing all subgroups (Ctrl+}), as well as doing it by hand from the menu. But how do I do this programmatically? adTHANXvance.
Aharon Naiman's user avatar
1 vote
1 answer
35 views

Setting WholeCellGroupOpener only for some cells

If I set the value of "WholeCellGroupOpener" to True, the cell with "Input" CellStyle can be folded with a ...
Rudy Yan's user avatar
2 votes
2 answers
44 views

Avoid opening closed cell group after button click

Button["Hello", Print["Hello"]] Opened cell group: Closed cell group (input cell is hidden by double-clicking output cell): But then if I ...
azerbajdzan's user avatar
  • 18.8k
7 votes
1 answer
284 views

How to condition all cells of a notebook to a specific SeedRandom?

Is there a way to fix SeedRandom[.] for an entire notebook? If I carry out many calculations using random numbers, I need to give a separate code ...
Tugrul Temel's user avatar
  • 6,223
3 votes
1 answer
124 views

Notebook key shortcut to move current cell group up/down/in/out?

How would one add (four custom keyboard-based not palette-based) shortcuts for moving the cellgroup containing the cursor up and down and in and out (akin to tab indent) relative to adjacent cells. ...
user5601's user avatar
  • 3,655
1 vote
1 answer
70 views

How to protect generated inline cells from editing?

I want to protect generated inline cell (which contains TeX source) from attempts to edit, since any attempt to regenerate box structure will fail. In particular, suppose in a text cell one creates ...
Acus's user avatar
  • 3,670
2 votes
1 answer
79 views

Export Notebook as Text (in 13.3 &14)

What is the best way to export a notebook as readable plaintext - while preserving as much structure as possible? The motivation here is the need to bulk-ingest notebooks and chunk them (for use in ...
user5601's user avatar
  • 3,655
0 votes
0 answers
60 views

Can Manipulate's execution result be represented by In&Out Cell?

I wrote the following code. ...
Milk's user avatar
  • 1,718
1 vote
0 answers
36 views

Help fixing dynamic graphics with multiple features

I'm trying to create a graph drawing widget, here are its basics that just allow you to create and drag vertices: ...
swish's user avatar
  • 7,921
1 vote
1 answer
50 views

How to force GeneratedCell -> True for non-editable cells?

If I generate an arbitrary non-editable cell: ExpressionCell[1, "Output", Editable -> False, GeneratedCell -> True] And then try to edit it, the ...
swish's user avatar
  • 7,921
1 vote
0 answers
28 views

Changing cell selection style

How to change this default selection style for a cell?
swish's user avatar
  • 7,921
0 votes
1 answer
69 views

Coloring text in Mathematica [closed]

Mathematica gives the possibility to write normal text as input in cells. One can use bold (ctrl+b) or italic (ctrl+i) for text, but can one color the text? For example writing some red words?
mattiav27's user avatar
  • 6,747
2 votes
1 answer
95 views

How to write code realizing this manual operation? [closed]

I want to use the output of N[E,15]. However the output is really 2.71828182845904523533978449066641588615`15. if you copy the ...
amon xu's user avatar
  • 41
1 vote
1 answer
43 views

How to clear all definitions/symbols declared in all sections with the given tag?

Consider a list of chapters/sections etc. that have the same tag, say, "evaluation". Could you please tell me how to clear all the functions/symbols/definitions etc. that have been defined ...
John Taylor's user avatar
  • 5,827
0 votes
0 answers
28 views

Problem with repeated cells evaluation using tags

Consider the following code: ...
John Taylor's user avatar
  • 5,827
0 votes
0 answers
30 views

Defining cell background colours by default [duplicate]

Is there a way to define the background colour of new cells by default, so that whenever I create a new cell in a Mathematica notebook, it is automatically shaded accordingly?
sam wolfe's user avatar
  • 4,863
3 votes
0 answers
110 views

CellLabel alignment issues in version 13.2

I found that when the global magnification is set to 75% and the number on the CellLabel is larger, there will be alignment issues. Below is a comparison to version 12.2 I tried to change some ...
expression's user avatar
  • 5,652
0 votes
0 answers
40 views

Dynamic of the content of a certain cell (using NotebookRead)

Initial state : ...
imida k's user avatar
  • 4,295
0 votes
1 answer
33 views

Print into different cell groups inside module

I have a function with the following (simplified) structure: ...
michelangelov's user avatar
6 votes
1 answer
188 views

Implementation of rainbow style for multiple cells in a notebook

We are aware that a user may utilize 'ColorFunction' gradients such as 'Rainbow' for plotting. How can we implement a gradient style as a rainbow spectrum to multiple cells in which there are multiple ...
monfneg's user avatar
  • 577
1 vote
1 answer
85 views

Overlay two cells without changing size

At present I am interested in overlaying cells without change of size. Cells may be graphic or not graphic. For example, it can be a complicated mathematical formula or grid. Also cells may be output ...
imida k's user avatar
  • 4,295
1 vote
0 answers
86 views

How to restore LightGray Background to initialization cells?

I am running Mathematica 13.2.1 on a new MacBook Pro M2 with Ventura 13.2.1. I have done something that causes any initialization cells that I create or view to no longer have a LightGray background. ...
Spencer Rugaber's user avatar
0 votes
1 answer
46 views

String in a Box representation makes a subtle error

...
imida k's user avatar
  • 4,295
0 votes
0 answers
44 views

How to forbid Mathematica to expand the section if launching it by tags?

Consider some section in a notebook tagged as "Evaluation". We want to launch it in e.g. the following way: ...
John Taylor's user avatar
  • 5,827
3 votes
1 answer
57 views

Insert a cell to "push" an output cell down so that my next output will not overwrite the last output [duplicate]

Normally when you evaluate a function, its result overwrites previous results. I would like to insert a cell between my function so and the last output (push down the last result} so that the new ...
George Wolfe's user avatar
  • 5,462
4 votes
1 answer
79 views

How can I wrap groups of cells with HTML tags on export?

Exporting a notebook to HTML in a way that worked with my site's styles was far easier than I anticipated: ...
alltom's user avatar
  • 153
0 votes
0 answers
28 views

FontSize of fraction after TableForm is small [duplicate]

FontSize of fraction after applying TableForm is small. ...
imida k's user avatar
  • 4,295
5 votes
1 answer
190 views

Validate `Box` grammar, is it possible?

Is it possible to validate grammar related to Box formed expression (RowBox, FractionBox, ......
imida k's user avatar
  • 4,295
1 vote
1 answer
89 views

The ultimate output control method

The ultimate substance of all matter is the atom, likewise, the ultimate substance of mathematica cell is the cell expression, and it can be obtained easily. After copying the cell expression, and ...
imida k's user avatar
  • 4,295
0 votes
1 answer
33 views

How to launch the cell associated with many tags?

Consider some section Section 1 and its subsection Subsection 1. I want to associate the whole cell with ...
John Taylor's user avatar
  • 5,827
4 votes
1 answer
309 views

What is the difference between code cell and input cell?

What is the difference between code cell and input cell?
vasili111's user avatar
  • 1,225
4 votes
1 answer
127 views

How to programmatically create a notebook from a list of Input Cell[]'s with syntax highlighting?

consider the following list of Cell[]'s: ...
podge cassidy's user avatar
0 votes
1 answer
143 views

Why does font weight sometimes lighten in certain Input cells? [closed]

Why do font weights sometimes change in cells, where they evolve from a regular weight to a dimmer or lighter font weight? The notebook I have open is not heavy as it only has a few cells. Also, there ...
Jules Manson's user avatar
  • 2,467
1 vote
1 answer
222 views

How to check that a user-input of a list of CellObject-s actually belong to the EvaluationNotebook?

Suppose a user inputs a list of CellObject-s to operate on. How might one check these objects to determine if they actually belong to the ...
Jules Manson's user avatar
  • 2,467
2 votes
1 answer
230 views

How can I change the default cell type in Mathematica from Input to Code?

Every time I type something into a notebook, I am compelled to first change the cell type from Input to Code, and then unset the ...
Shredderroy's user avatar
  • 5,249
2 votes
2 answers
204 views

ChangeCellStyle function works in one direction but not in reverse

This post is a continuation of an earlier Question, How to programmatically change CellStyle of all Cells from "Input" to "Code"? but with a ...
Jules Manson's user avatar
  • 2,467
1 vote
0 answers
102 views

How to acquire the background color and font color of output cells?

The following is how I grab the general colors used for an EvaluationNotebook but how does one target the colors to be used when creating an ...
Jules Manson's user avatar
  • 2,467
1 vote
0 answers
100 views

Code to delete all output in a notebook

I am looking for a code I can paste at the beginning of a notebook to delete all the output cells so that when I execute the "Evaluate notebook" command, all the output cells are also ...
akr's user avatar
  • 177
1 vote
1 answer
67 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 ...
JJJanezic's user avatar
  • 277
0 votes
0 answers
32 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 ...
Jules Manson's user avatar
  • 2,467
4 votes
1 answer
202 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 ...
user8281's user avatar
  • 151
0 votes
0 answers
229 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 ...
Jules Manson's user avatar
  • 2,467
1 vote
1 answer
94 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 ...
2stein's user avatar
  • 13
2 votes
0 answers
57 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 ...
azerbajdzan's user avatar
  • 18.8k
1 vote
0 answers
28 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 ...
Jack LaVigne's user avatar
  • 14.5k
8 votes
2 answers
263 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) ...
B flat's user avatar
  • 5,565
3 votes
2 answers
152 views

Left, center, and right justification within a single cell

I can write a cell with the text alignment on the right: ...
David G. Stork's user avatar
0 votes
1 answer
64 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 ...
yode's user avatar
  • 26.8k
2 votes
1 answer
65 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?
Jules Manson's user avatar
  • 2,467

1
2 3 4 5
10