Skip to main content
added 7 characters in body
Source Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375

Based on this answer by Carl Woll, the syntax should be:

Cell[StyleData["Input", StyleDefinitions -> StyleData["Code"]]]

Setting the option programmatically:

SetOptions[
    EvaluationNotebook[],
    StyleDefinitions -> Notebook[
        {
        Cell[StyleData[StyleDefinitions -> "Default.nb"]],
        Cell[StyleData["Input", StyleDefinitions ->StyleData["Code"]]]> StyleData["Code"]]]
        }
    ]
]

Checking:

screenshot

As one can see, the input cell is formatted likeas a "Code" cell, while in its definition it still has the style "Input". Done!

Based on this answer by Carl Woll, the syntax should be:

Cell[StyleData["Input", StyleDefinitions -> StyleData["Code"]]]

Setting the option programmatically:

SetOptions[
    EvaluationNotebook[],
    StyleDefinitions -> Notebook[
        {
        Cell[StyleData[StyleDefinitions -> "Default.nb"]],
        Cell[StyleData["Input",StyleDefinitions->StyleData["Code"]]]
        }
    ]
]

Checking:

screenshot

As one can see, the input cell is formatted like "Code" cell, while in its definition it still has style "Input". Done!

Based on this answer by Carl Woll, the syntax should be:

Cell[StyleData["Input", StyleDefinitions -> StyleData["Code"]]]

Setting the option programmatically:

SetOptions[
    EvaluationNotebook[],
    StyleDefinitions -> Notebook[
        {
        Cell[StyleData[StyleDefinitions -> "Default.nb"]],
        Cell[StyleData["Input", StyleDefinitions -> StyleData["Code"]]]
        }
    ]
]

Checking:

screenshot

As one can see, the input cell is formatted as a "Code" cell, while in its definition it still has the style "Input". Done!

Source Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375

Based on this answer by Carl Woll, the syntax should be:

Cell[StyleData["Input", StyleDefinitions -> StyleData["Code"]]]

Setting the option programmatically:

SetOptions[
    EvaluationNotebook[],
    StyleDefinitions -> Notebook[
        {
        Cell[StyleData[StyleDefinitions -> "Default.nb"]],
        Cell[StyleData["Input",StyleDefinitions->StyleData["Code"]]]
        }
    ]
]

Checking:

screenshot

As one can see, the input cell is formatted like "Code" cell, while in its definition it still has style "Input". Done!