Change background color of equation in text style

In Mathematica, when you write a cell in the Text style, if you create a formatted equation, for example, by pressing "x ctrl_ a", the background color changes when you select an equation. Does anyone know what this form of equation format is called, and specifically how to change the background color when choosing an equation.

+5
source share
2 answers

In general, if you press Cmd- Shift- Ewhen in a cell, it will show you the basic low-level syntax that makes up the nice formatting you see. In my case for x_a foo bar, where x_ais typed as an index, it shows:

 Cell[TextData[{
 Cell[BoxData[
  FormBox[
   SubscriptBox["x", "a"], TraditionalForm]]],
 " foo bar "
}], "Text",
 CellChangeTimes->{{3.528581300759695*^9, 3.5285813422683*^9}, {
  3.528581510346758*^9, 3.5285815118015013`*^9}}]

Now, to access the necessary information, open the stylesheet Core.nband see Styles for Mathematica System-specific Elements > FormatType Styles > InlineCellEditing. Use the above key combination to see the base code that shows:

Cell[StyleData["InlineCellEditing"],
 StyleMenuListing->None,
 Background->RGBColor[0.964706, 0.929412, 0.839216]]

This is the background color that is used. To confirm:

Graphics[{RGBColor[0.964706, 0.929412, 0.839216], Disk[]}]

enter image description here

Oops! To change, you just need to create your own stylesheet with the changed definition and use it as the default for a laptop.


Example:

, Format > Edit Stylesheet , Private style definitions for <filename.nb>, enter, , ( RGB , ), , CellExpression. , :

Cell[StyleData["InlineCellEditing"],
 StyleMenuListing->None,
 Background->RGBColor[0.3, 0.9, 0.8]]

- :

enter image description here

, .

+8

Format > Edit Stylesheet . , :

SetOptions[EvaluationNotebook[], 
 StyleDefinitions -> 
  Notebook[{
    Cell[StyleData[StyleDefinitions -> "Default.nb"]], 
    Cell[StyleData["InlineCellEditing"], 
         Background -> RGBColor[0.9, 0.6, 0.6]]}]]

.

+3

All Articles