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.

I had expected that this option would prevent a page break occurring within a group of cells of which this cell is the "group leader". In my case it is a "Subsubsection" containing a group of graphics cells.

NotebookWrite[notebook,Cell["Title","Subsubsection",PageBreakWithin->False,GroupPageBreakWithin->False]];

Some more cells containing graphics are then written.

When I look at the notebook generated I see page breaks between some of these Subsubsection cells and the cells immediately below when it is clear the page break could have been placed above this Subsubsection cell.

What am I doing wrong / How do I force some groups of cells to be kept together (the equivalent of MSWord's KeepWithNext)?

A fuller example...

notebook = NotebookCreate[];
Do[
NotebookWrite[notebook,Cell["Title","Subsubsection",PageBreakWithin->False,GroupPageBreakWithin->False]];
NotebookWrite[notebook,Cell[BoxData[ToBoxes[Plot[Sin[10x]Exp[-x],{x,0,1}]]]]];,{10}]

In the notebook created with the option ShowPageBreaks set to True in option inspector two page breaks show between title and the graphic beneath.

share|improve this question

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.