8
$\begingroup$

In 1998 there was a discussion on comp.soft-sys.math.mathematica how to add am PageBreak menu to Mathematica.

I used the recipe from there for very long time (in fact, I used Mathematica 4 till almost a year ago).

Now this recipe does not work any longer. I get strange error messages.

$\endgroup$
9
$\begingroup$

On a Linux pc, the relevant file is in a place like this one:

/usr/local/Wolfram/Mathematica/10.1/SystemFiles/FrontEnd/TextResources/X/MenuSetup.tr

To edit the file, one needs administrator rights, i.e. modify it under sudo.

Since introducing errors can make Mathematica no longer usable, first make a backup copy of the original file before trying to change it!

I put the following sniplet between the defintions of Palettes and Window:

    Menu["Page&Breaks",
     {
          MenuItem["Page Break Above Cell", PageBreakAbove->True, Scope->SelectionCell],
MenuItem["Page Break Below Cell", PageBreakBelow->True, Scope->SelectionCell],
          Delimiter,
          MenuItem["No Break Above Cell",   PageBreakAbove->False, Scope->SelectionCell],
          MenuItem["No Break Below Cell",   PageBreakBelow->False, Scope->SelectionCell]
     }],

If you want to indent the new code like everything else in this file, be careful not to use tab as white spaces! They will cause errors when Mathamatica starts and no menu items will be accessible then!

The result looks like this:

enter image description here

$\endgroup$
2
$\begingroup$

An even better version than the one above from me: Paste between the defintions of Palettes and Window:

    Menu["Page&Breaks", 
{
    MenuItem["ShowPageBreaks ON ",    ShowPageBreaks->True,      Scope->NotebookDefault],
    MenuItem["ShowPageBreaks OFF",    ShowPageBreaks->False,     Scope->NotebookDefault],
    Delimiter,
    MenuItem["PageBreak Above Cell ", PageBreakAbove->True,      Scope->SelectionCell],
    MenuItem["NO   PageBreak Above ", PageBreakAbove->False,     Scope->SelectionCell],
    MenuItem["AUTO PageBreak Above ", PageBreakAbove->Automatic, Scope->SelectionCell],
    Delimiter,
    MenuItem["PageBreak Below Cell ", PageBreakBelow->True,      Scope->SelectionCell],
    MenuItem["NO   PageBreak Below ", PageBreakBelow->False,     Scope->SelectionCell],
    MenuItem["AUTO PageBreak Below ", PageBreakBelow->Automatic, Scope->SelectionCell],
    Delimiter,
    MenuItem["PageBreak Within Cell", PageBreakWithin->True,     Scope->SelectionCell],
    MenuItem["NO   PageBreak Within", PageBreakWithin->False,    Scope->SelectionCell],
    MenuItem["AUTO PageBreak Within", PageBreakWithin->Automatic, Scope->SelectionCell],
    Delimiter,
    MenuItem["GroupPageBreak Within", GroupPageBreakWithin->True, Scope->SelectionCell],
    MenuItem["NO   GroupPBr. Within", GroupPageBreakWithin->False, Scope->SelectionCell],
    MenuItem["AUTO GroupPBr. Within", GroupPageBreakWithin->Automatic, Scope->SelectionCell],
}],

This one also gives you access to the other relevant functions around PageBreaks:

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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