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.
Questions tagged [cells]
450 questions
7
votes
2 answers
How to generate an input cell?
For example I have a block of code
Module[{}, a=1;b=2;...]
I want to have a function called gencode, so when I run gencode, it will generate an input cell which contains this block of code just like I type them by hand.
How to write this gencode?
matheorem
- 17,132
- 8
- 45
- 115
5
votes
2 answers
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:
Cell["How to get new text cells to group right?", "ItemNumbered",
…
M.R.
- 31,425
- 8
- 90
- 281
5
votes
2 answers
shorcut key of Cell->Cell Properties->Open
Is there a shortcut key to control the Open property of cell?
Thanks!
wind1239
- 91
- 6
4
votes
1 answer
Is there a way to convert Wolfram Language expression to string?
Is there a way to convert a Wolfram Language expression / code into a string expression? For example,
Convert the following including its indentations (very important),
If[Length[$ScriptCommandLine]==1,
Print["No expressions were given to…
user13892
- 9,375
- 1
- 13
- 41
4
votes
2 answers
How to assign a tag to a cell
I want to assign each cell in my current notebook a tag so that I can rerun cells with specific tags later in the notebook (Using a method similar to this answer).
My questions are
How do I assign cells in my current notebook tags?
How do I view…
AzJ
- 697
- 4
- 14
3
votes
1 answer
Column and CellLabel
Is it possible to add a CellLabel over multiple lines? When trying the code
SetOptions[ NotebookSelect[mb], CellLabel-> Column@{"line 1", "line 2"} ]
with a Cell selected in the mb Notebook, nothing shows up. What's the solution for this?
Thanks…
Gabriel
- 1,877
- 12
- 22
3
votes
0 answers
Is it possible to frame a group of cells?
Is it possible to put a frame around a group of cells (e.g. a numbered list)?
My problem is, that if I select the cell group and then click frame on the writing assistant, then it puts a frame around each cell in stead of one frame around all the…
Sofic
- 673
- 3
- 8
2
votes
0 answers
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 low, how can I modify its behaviour to have a…
Ranza
- 1,205
- 9
- 22
2
votes
0 answers
How to get the CellID of a cell
I can count how many cells there are in a notebook up to and including the one whose ID i need, and then evaluate Cells[EvaluationNotebook[]][[number, 1]].
How to do this simpler? And how to get a list of cell IDs when a number of cells are…
MeMyselfI
- 1,116
- 5
- 12
1
vote
1 answer
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 mouse click. I wonder if there is a way that we can set "WholeCellGroupOpener" only for cells that have "Section" or "Chapter" CellStyle, and…
Rudy Yan
- 23
- 3
1
vote
1 answer
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 character:
/ NL
or hex:
5C 0A
For example,…
2stein
- 13
- 3
1
vote
1 answer
How to hide a cell with multiple output?
i'm working on a presentation using a Mathematica notebook. I'd like to hide the code i wrote.
I found this answer and red this guide.
After 7 years from that first answer that hacky method is still the way to go?
What i am trying to do, to be clear…
zurg
- 117
- 5
1
vote
1 answer
How to create inline math with CellPrint within Text cell?
I can create a text cell with text like this:
CellPrint@Cell[
"this is a function call: f[x,y]",
"Text"
]
This produces:
this is a function call: f[x,y]
But I want f[x,y] to be in inline math form within the text cell, like below:
user13892
- 9,375
- 1
- 13
- 41
1
vote
2 answers
How to read the data from output cells?
I have results of some calculation as a number of output cells in the saved .nb file. Since these results are obtained before (not during this run of Mathematica), I cannot use % to access previous output. They are many so I cannot do this…
user15933
- 173
- 7
0
votes
1 answer
Do ShowGroupOpener and TitleGrouping suffice to control cell grouping?
[ Running Mathematica 9.0.1.0 under Ms Win XP Ver 5.1.2600 ]
Here I group toghter ;-) some relate questions about cell grouping, because I presume that they all pertain to the same cell options (or strictly siblings), but I can't figure out what…
mitochondrial
- 1,843
- 10
- 16