5
$\begingroup$

I want a different evaluation context for different sections of my Notebook.Mike Honeychurch suggested to me than changing the CellContext to CellGroup would create a different context for each section of a document. According to the documentation, this seems to the right thing to do.

However, I'm unable to use that properly in the Wolfram Cloud Notebook. Here is a screenshot of my current session. Cells were evaluated by "Evaluate All" in the menu:

enter image description here

As you can see despite my use of SetOptions[EvaluationNotebook[], CellContext -> CellGroup] at different places, the $Context is always set to Global`.

What is the proper way of setting The Notebook evaluation option CellContext -> CellGroup in the Wolfram Cloud Notebook?


Eventually related to Stylesheets & Wolfram Cloud, since, to quote Mickael E2 in a comment below "In the documentation pages, this seems to be done through the stylesheet"

$\endgroup$
11
  • $\begingroup$ In the documentation pages, this seems to be done through the stylesheet. They set the cell option CellContext -> CellGroup on both the "Input" and "Output" styles. Examine FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", "StyleSheets", "Wolfram", "Reference.nb"}]. $\endgroup$
    – Michael E2
    Dec 12, 2019 at 12:38
  • 1
    $\begingroup$ Sorry, I don't use the cloud version much and am unfamiliar many such things. I tried adding private StyleDefinitions to a cloud notebook. I took them from a desktop notebook, in which CellContext -> CellGroup works properly. However, on the cloud, the StyleDefinitions have no effect. This might be a limitation of the WolframCloud. Maybe someone else will come along who has better knowledge than me. $\endgroup$
    – Michael E2
    Dec 12, 2019 at 13:04
  • 1
    $\begingroup$ Here is the StyleDefinitions from my desktop notebook: StyleDefinitions -> Notebook[{Cell[StyleData[StyleDefinitions -> "Default.nb"]], Cell[StyleData["Input"], CellContext -> CellGroup, MenuSortingValue -> 10000], Cell[StyleData["Output"], CellContext -> CellGroup, MenuSortingValue -> 10000]}, WindowSize -> {808, 905}, WindowMargins -> {{20, Automatic}, {Automatic, 44}}, FrontEndVersion -> "12.0 for Mac OS X x86 (64-bit) (April 8, 2019)", StyleDefinitions -> "PrivateStylesheetFormatting.nb"] -- but it didn't work on the cloud, as I said. $\endgroup$
    – Michael E2
    Dec 12, 2019 at 13:06
  • 4
    $\begingroup$ Yes, CellContext is not implemented in its entirety in the cloud yet, but it's on our list. $\endgroup$ Dec 13, 2019 at 9:28
  • 1
    $\begingroup$ To download that stylesheet file from the cloud, you'd have to turn it into a proper cloud object (in your cloud directory) first, e.g. using CopyFile[FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", "StyleSheets", "Wolfram", "Reference.nb"}], CloudObject["Reference.nb"]]. Then you can download it using the in-browser cloud file explorer, or by executing e.g. CopyFile[CloudObject["Reference.nb"], "Reference.nb"] in desktop Mathematica. $\endgroup$ Dec 13, 2019 at 9:30

1 Answer 1

4
$\begingroup$

A CW answer for clarity

As of $CloudVersion 1.53.0.1 the CellContext is not supported in cloud notebooks.

Yes, CellContext is not implemented in its entirety in the cloud yet, but it's on our list.

– Jan Pöschko

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.