Function Repository Resource:

ManipulateFormattingPalette

Source Notebook

Create a palette for formatting notebook cells, especially Manipulate cells

Contributed by: Jayanta Phadikar and Kunal Khadke

ResourceFunction["ManipulateFormattingPalette"][]

creates a palette for formatting Manipulate cells.

Details

While making presentations or writing computational essays, it is often necessary to format the input/output cells of a Manipulate. For example, the input cells may need to be hidden, the output cell may need to be centrally aligned and so on.
ResourceFunction["ManipulateFormattingPalette"] can be used for closing and hiding an input cell.
With ResourceFunction["ManipulateFormattingPalette"], one can mark cells as "To Be Deleted" and create a deployed version of the original notebook with marked cells removed from the notebook.
ResourceFunction["ManipulateFormattingPalette"] can be used for formatting different Wolfram Language expressions within input and output cells.
Before you click the button, either the cell in question can be selected or the cursor can be placed in an empty area of the cell. In the latter case, the palette will automatically move the selection to the entire cell.
The following buttons are created within a palette by ResourceFunction["ManipulateFormattingPalette"]:
Close:
Close Cellclose the selected cells
Unmark ToCloseunmark cell to close when the Close All button is used
Close Allclose all the opened cells closed with the Close Cell button
Open Allopen all the cells closed with the Close Cell button
Hide:
Hide Cellhide the selected cells
Unmark ToHideunmark cell to hide when the Hide All button is used
Hide Allhide all the shown cells hidden with the Hide Cell button
Show Allshow all the cells closed with the Hide Cell button
Deploy:
Mark ToBeDeletedmark the selected cells to be deleted in the deployed notebook
Unmark ToBeDeletedunmark the selected cells to be deleted in the deployed notebook
Deploycreate a copy of the current notebook in which all the marked cells will be deleted
Output:
Center Aligncenter-align the selected cells
Align & Hide Bracketscenter-align the selected cells and hide the cell brackets

Examples

Basic Example (1) 

Create the palette:

In[1]:=
ResourceFunction["ManipulateFormattingPalette"][];

Scope (9) 

A pair of Manipulate input/output cells:

In[2]:=
Manipulate[Plot[Sin[x (1 + a x)], {x, 0, 6}], {a, 0, 2}]
Out[2]=

Close (2) 

Select the previous input cell and click Close Cell to close the cell; note that the tiny cell bracket for the input cell is still visible:

All the cells closed in this way can be reopened by clicking Open All:

Close all the opened cells that were closed with the Close Cell button by using Close All. This operation is the opposite of Open All.

Use the Unmark ToClose button for unmarking certain cells (among the previously marked cells) to be closed using the Close All button.

Hide (2) 

Select the input Manipulate cell from the previous section and click Hide Cell to hide the cell. Note that the cell is hidden and the cell bracket is no longer visible:

All the cells that are hidden in this way can be shown again by clicking Show All:

Hide all the opened cells that were closed with the Hide Cell button with Hide All. This operation is the opposite of Show All.

Use the Unmark ToHide button for unmarking certain cells (among the previously marked cells) to be hidden using the Hide All button.

Deploy (1) 

Select the input Manipulate cell from the previous section and click Mark ToBeDeleted to mark the cell:

Use Unmark ToBeDeleted to unmark certain cells among the previously marked cells.

Click Deploy to create a copy of the current Notebook in which all the marked cells will be deleted.

Output cell (2) 

Select the Manipulate output cell and click Center Align to center the cell:

Select the Manipulate output cell and click Align & Hide Brackets to center the cell and hide the cell bracket (it also sets DeployedTrue for the cell):

Other content (2) 

In addition to Manipulate cells, ManipulateFormattingPalette can be used for formatting other types of inputs and outputs as well. Create a simple table:

In[3]:=
grid  = Grid[
Prepend[{{"first", 1, 2, 3}, {"second", 11, 5, 6}, {"third", 111, 8, 9}, {"fourth", 1111, 10, 11}}, {"name", "a", "b", "c"}], Background -> {None, {
Lighter[Yellow, 0.9], {White, 
Lighter[
Blend[{Blue, Green}], 0.8]}}}, Dividers -> {{
Darker[Gray, 0.6], {
Lighter[Gray, 0.5]}, 
Darker[Gray, 0.6]}, {
Darker[Gray, 0.6], 
Darker[Gray, 0.6], {False}, 
Darker[Gray, 0.6]}}, Alignment -> {{Left, Right, {Left}}}, ItemSize -> {{10, 5, 3, 3}}, Frame -> Darker[Gray, 0.6], ItemStyle -> 14, Spacings -> {Automatic, 0.8}]
Out[3]=

To only show the grid, select the input cell and click Hide Cell, then select the output cell and click Align & Hide Brackets to format the output cell:

Publisher

Kunal Khadke

Version History

  • 1.1.0 – 27 September 2021

Related Resources

License Information