1
$\begingroup$

If we open DocumentationCenter and then run code, we will find that the Cells are independent from each other.

For example:

enter image description here

  • a or b in third Cell is independent from the one in the first or second Cell.

I think maybe it is local cell?

If I want to achieve this behaviour in my notebook, how to do this?

Thanks.

$\endgroup$
4
$\begingroup$

Not each Cell but each CellGroup has separate context. If you create new cell you will get In[2]:

enter image description here

You can confirm this thesis with:

nb = Select[Notebooks[], "Help" === ("DocumentType" /. NotebookInformation[#]) &][[1]]

Options[#, CellContext] & /@ Cells[nb, GeneratedCell -> False, CellStyle -> "Input"]
{{CellContext -> CellGroup}, <<18>>, {CellContext -> CellGroup}}

So it is an Option that you can fix, e.g. via menu:

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.