Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

What determines how a specific cell-style influences grouping of cells?

For example "Text" following "Subtitle" is grouped but not following "Text"

nbtitle = CreateDocument[];
NotebookWrite[nbtitle, Cell["subtitle", "Subtitle"]]
NotebookWrite[nbtitle, Cell["this text gets grouped", "Text"]]

nbtext = CreateDocument[];
NotebookWrite[nbtext, Cell["some text", "Text"]];
NotebookWrite[nbtext, Cell["this text is not grouped", "Text"]];

title


text

All I can find in the documentation is:

Within a given notebook, there is always a collection of styles that can be used to determine the appearance and behavior of cells. Typically the styles are named so as to reflect what role cells which have them will play in the notebook.

share|improve this question
1  
Each style has parameter CellGroupingRules or inherit it. If it is what you are looking for then I post it as answer (with some examples). –  ybeltukov Nov 12 '13 at 22:23
    
@ybeltukov Too slow :) Thanks, it was –  ssch Nov 12 '13 at 22:34
    
Not I but my Internet. I didn't see the update :) –  ybeltukov Nov 12 '13 at 22:43
add comment

1 Answer

up vote 3 down vote accepted

The option that governs this behaviour is CellGroupingRules

enter image description here

By changing the grouping I can make sections group under text e.g.

enter image description here

due to

enter image description here

Notice that a number accompanies the grouping assignment. This allows you to allocate an order to the grouping -- lower numbers have higher rank.

share|improve this answer
    
Thanks! I guess I can cancel the ritual sacrifice for the cell gods now –  ssch Nov 12 '13 at 22:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.