CellProlog

CellProlog

is an option to Cell that gives an expression to evaluate before each ordinary evaluation of the contents of the cell.

Details

  • CellProlog:>expr evaluates expr for every ordinary kernel evaluation done in the cell, as initiated for example by TemplateBox[{shift, return}, Key1, BaseStyle -> {Notes, FontWeight -> Plain, FontFamily -> Source Sans Pro}] or by Evaluate in Place.
  • CellProlog is not evaluated for evaluations associated with Dynamic objects.
  • The default setting is CellProlog->None.
  • CellProlog is often set at a style or notebook level, rather than for individual cells.

Examples

Applications  (2)

Rules for temporarily setting $Post:

In[1]:=
Click for copyable input

Rules for setting up local package contexts for a cell:

In[1]:=
Click for copyable input

See Also

CellEpilog  CellContext  $Pre  Evaluator

Introduced in 2007
(6.0)