FrontEnd: Creating an Input Style that produces a specific Output Style.

Hello,

Suppose that I have created two input styles (say the normal input style from Core.nb) and another called myInputStyle; also, suppose that I have another Output Style called myOutputStyle.

I have a suite of notebooks with embedded style sheets that have these two different kinds of input and output styles.

I’d like to have myInputStyle produce only myOutputStyle.

I do realize that this will not play nice with standard style sheets. But, I’ll solve that problem later----I hope.

I am not sure where to look in the documentation for this----or find an example from which I can extrapolate a solution.

If anyone has a pointer to the right direction, or even the name of a Cell Option to look at, I’d be grateful.
Thanks, Craig

CellEvaluationFunction might be what you are looking for.

The following creates a notebook where evaluating the first cell gives a result
similar to a typical evaluation. Evaluating the second cell gives a result with
“Input” style instead. Evaluation the third cell gives a result with “Text” style.

CreateDocument[Notebook[{
   Cell[BoxData[RowBox[{"2", " ", "3"}]], "Input", 
    CellEvaluationFunction -> (NotebookWrite[EvaluationNotebook[], 
        Cell[BoxData[ToString[ToExpression[#]]], "Output"]] &)],
   Cell[BoxData[RowBox[{"2", " ", "3"}]], "Input", 
    CellEvaluationFunction -> (NotebookWrite[EvaluationNotebook[], 
        Cell[BoxData[ToString[ToExpression[#]]], "Input"]] &)],
   Cell[BoxData[RowBox[{"2", " ", "3"}]], "Input", 
    CellEvaluationFunction -> (NotebookWrite[EvaluationNotebook[], 
        Cell[ToString[ToExpression[#]], "Text"]] &)]
   }]]

You should be able to add CellEvaluationFunction to your ‘myInputStyle’ style and specify the ‘myOutputStyle’ style in the corresponding NotebookWrite[].