4
$\begingroup$

I'm wring a thesis which has quite amount of tables. When the thesis gets printed, Mathematica often breaks pages between the table title and table. I would like to keep the title and table in the same page. How can I do so by editing the Stylesheet?

Details regarding this problem: First I chosen the initial style sheet to be Artical -> Preprint. Then I selected "TableTitle" for the cell style of the title, and self-defined "TableText" for the cell style of the table. The self-defined "TableText" basically inherits the definition of the existing cell style "Text" as follows:

Cell[StyleData["TableText", StyleDefinitions -> StyleData["Text"]], TextAlignment->Center,
 MenuSortingValue->1911,
 FontSize->12]

The problem is even if I group the cells of titles and tables, Mathematica still often breaks the page between the cell "TableTitle" and the cell "TableText" when the Screen Environment is in Printout and I choose Printing Settings -> Show Page Breaks. I wouldn't like to add the page break lines manually. I'm wondering how to tell Mathematica not to add the page break lines between the cells "TableTitle" and the cells "TableText". Is it possible to do so by adding something to the StyleData of "TableTitle" in the environment of "Printout":

Cell[StyleData["TableTitle", "Printout"],
 PageWidth->PaperWidth,
 Hyphenation->False,
 FontSize->12]

I tried to add PageBreakBelow -> False but it did not work.

$\endgroup$
3
  • $\begingroup$ Really need more detail about how the titles and the tables appear in your notebook. There are many ways to solve this problem but they depend on the details. One solution would be to combine the titles and tables into one cell. Mathematica tries hard not to make a page break inside a cell. $\endgroup$
    – m_goldberg
    Commented Jul 6, 2014 at 4:35
  • $\begingroup$ Thank you very much for your reply. It does not work by combining the titles and tables. I've added more details about my problem. $\endgroup$
    – user16345
    Commented Jul 6, 2014 at 7:33
  • $\begingroup$ Could you please add a screen grab or two, perhaps of the relevant cells in the stylesheet and what your notebook (with broken tables) look like? $\endgroup$ Commented Jul 6, 2014 at 11:46

1 Answer 1

2
$\begingroup$

I have solved this problem. Glynn and Gray (2000) state the settings for PageBreakAbove, PageBreakBelow, PageBreakWithin, and GroupPageBreakWithin are available only in the Option Inspector. Therefore, these settings cannot be applied to Edit Stylesheet. The table titles, tables, and table notes are kept in the same pages using the following procedure:

Select all TableTitle cells by clicking on the bracket of any TableTitle cell while holding keyboard key Alt. Then press Shift + Ctrl + O to open the Option Inspector dialog. Type in PageBreakBelow in Lookup to find four options of PageBreakAbove, PageBreakBelow, PageBreakWithin, and GroupPageBreakWithin. Then choose False for both PageBreakBelow and PageBreakWithin before close the dialop.

Next, in the same way choose False for PageBreakAbove, PageBreakBelow, and PageBreakWith for self-defined TableText cells and select False for PageBreakAbove and PageBreakWith for TableNote cells.

Finally, you will find Mathematica avoids breaking pages among table titles, tables, and table notes.

Reference:

Glynn, J. and Gray, T.W., 2000. The beginner's guide to Mathematica. 4th ed. Cambridge: Cambridge University Press.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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