How to hide inline Cells

By giving a cell the simple option CellOpen -> False, it can be hidden from view.

But for inline cells (cell within a cell) this does not work.

An option Visible -> False only seems to exist for notebooks, not for cells.

What to do?

• One way would be to add a CellSize option to the inline cell and toggle between {0,0} and Inherited but this would be quite messy to implement I think. – Mike Honeychurch Oct 18 '12 at 22:05
• May be you can add an White color or Balck color or other color for all your inline cells and set the content unseen. – HyperGroups May 8 '13 at 6:31

One way is to go with stylesheets, you can set DefaultNewInlineCellStyle option for StyleData["Notebook"] and for this given style, a specific CellSize, then you can proceed with toggling it. But it is messy and probably an overreaction.

I'd go with this simple procedure, you can put it as a MenuItem, a new shortcut or whatever you find convenient. For simplicity let's create a quick palette:

So, first of all, from documentation of Cells[obj]:

obj may be a NotebookObject or a CellObject. If obj is a CellObject, then Cells returns the inline cells in the specified cell.

CreatePalette[
Button[
"Toggle inline cells visibility",
Module[{inlineCells},
inlineCells = Cells /@ Cells @ InputNotebook[] // Flatten;
If[
CurrentValue[#, CellSize] === {1, 1},
SetOptions[#, CellSize -> Automatic],
SetOptions[#, CellSize -> {1, 1}]
] & /@ inlineCells
]
]
]


Size {0,0} is not supported so we are using {1, 1} which is small enough :)