I have created a notebook for my classes which is full of inputs that need to be evaluated by my students. All these inputs produce standard outputs, which are fine as they are. But there is one of them, and just that one, which needs to produce a special style of output (other similar outputs must remain as they are).
Specifics:
The left margin of this particular output must be set to zero.
This cell is the result of evaluating a
Manipulate[...]
function, which contains graphics and text.This change must be permanent: I don't want to manually assign a style each time the input is evaluated, but I don't mind including any code in the input that generates this cell.
Right now, this is the solution I have implemented:
I have created a duplicate of the Output style (which I called
Output2
and inherits fromOutput
's style:Cell[StyleData["Output2",StyleDefinitions->StyleData["Output"]]]
).Then I changed its margins in the Stylesheet editor (
CellMargins->{{5,10},{5,10}}
).I write
SetOptions[EvaluationNotebook[], "GeneratedCellStyles" -> {"Output" -> "Output2"}];
in the input cell, right before the code that will generate this special output.- I write
SetOptions[EvaluationNotebook[], "GeneratedCellStyles" -> {"Output" -> "Output"}];
after the code of the input cell, to restore future outputs back to normal.
This solution seems too complicated to me and lacking elegance. So, I was hopping that any of you know a better solution. Any help would be very appreciated.
Thank you for reading this and for your time.
Manipulate
may be important. When you say "the output of" I am assuming you mean the interactive Manipulate object itself, created by evaluating a line of code withManipulate[ . . . ]
. $\endgroup$Manipulate[...]
which produces an interactive output. This interactive cell must have a left margin of 5 or less. (I've changed my description to use your words, hopefully this will make things clearer.) $\endgroup$