Context unique to each group at a specified level

后端 未结 2 1775
余生分开走
余生分开走 2021-01-02 20:56

Recent versions of Mathematica provide the option of having a unique $Context for each cell group, via:

  • Evaluation > Notebook\'s Default Context >
相关标签:
2条回答
  • 2021-01-02 21:32

    You should be able to do this by modifying your notebook's stylesheet. You can use the option CellContext to set the context. The mma documentation does this to restrict example context to Cell groups.

    0 讨论(0)
  • 2021-01-02 21:54

    You can achieve this by grouping cells manually instead of relying upon the automatic grouping mechanism. In the notebook in question, use the menu item Cell / Grouping / Manual Grouping to enable manual grouping. Now, as you enter sections, subsections, etc. they will not be grouped automatically. Select the cells that you wish to be in a single group and use the menu item Cell / Grouping / Group Cells/Group Together. Now that they are grouped, you can set the CellContext to be CellGroup and they will all play well together.

    0 讨论(0)
提交回复
热议问题