I would like to be able to have Mathematica output appear in my "DisplayFormulaNumbered"
style, which puts an automatically incremented equation number at the right margin. My stylesheet defines this as:
Cell[StyleData["DisplayFormulaNumbered"],
CellFrame->False,
CellMargins->{{66, Inherited}, {0, 7}},
StyleKeyMapping->{
KeyEvent["Backspace", Modifiers -> {Shift}] -> "Input",
"Tab" -> "DisplayFormula"},
CellFrameLabels->{{None,
Cell[
TextData[{"(",
CounterBox["DisplayFormulaNumbered"], ")"}],
"DisplayFormulaEquationNumber", FontSlant ->
"Plain"]}, {None, None}},
MenuSortingValue->24,
MenuCommandKey->None,
FontFamily->"Times New Roman",
FontSize->12,
FontWeight->"Plain",
FontSlant->"Italic",
FontVariations->{"StrikeThrough"->False,"Underline"->False},
FontProperties->{"ScreenResolution"->96},
FontColor->RGBColor[0., 0., 0.]]
So now I'd like to do something like
u[x_, f_] := 1 - f (Pi/2 + ArcTan[x])/Pi
Style[U[x, α] == Evaluate[u[x, α]], "DisplayFormulaNumbered"]
which almost works (I get the output in the style I want), but it omits the equation number. How do I fix this?
Part of the story is that, for presentation purposes, I use a special style for Input cells like so:
Cell[StyleData["InputHidden", StyleDefinitions -> StyleData["Input"]],
CellEpilog:>(SelectionMove[EvaluationNotebook[], All, GeneratedCell];
FrontEndTokenExecute["SelectionCloseUnselectedCells"]),
MenuSortingValue->21,
MenuCommandKey->"9"]
which gives me an input cell that automatically hides when evaluated, leaving only the Output cell to be displayed. The problem with Kubo's suggestion below is that it breaks this mechanism, by producing a new cell that's not considered the Output cell of its Input.