I am trying to change the font of the formula number in a cell which has style DisplayFormulaNumbered. I can easily change the font of the formula I enter by selecting it and using the format menu. But the number to the right of the formula wont change. Any help with this would be greatly appreciated. I am using mathematica 9.
2 Answers
You can get the Style definitions for "DisplayFormulaNumbered"
using
CurrentValue[{StyleDefinitions, "DisplayFormulaNumbered"}]
{CellMargins -> {{66, Inherited}, {Inherited, Inherited}}, StripStyleOnPaste -> True, CellFrameLabels -> {{None, Cell[TextData[{"(", CounterBox["DisplayFormulaNumbered"], ")"}], "DisplayFormulaEquationNumber"]}, {None, None}}, DefaultFormatType -> DefaultInputFormatType, "HyphenationOptionsHyphenationCharacter" -> "\[Continuation]", LanguageCategory -> "Formula", ScriptLevel -> 0, SingleLetterItalics -> True, CounterIncrements -> "DisplayFormulaNumbered", MenuSortingValue -> 1710, FontFamily -> "Arial", FontSize -> 14, FontColor -> GrayLevel[0.2], UnderoverscriptBoxOptionsLimitsPositioning -> True}
and for "DisplayFormulaEquationNumber"
using
CurrentValue[{StyleDefinitions, "DisplayFormulaEquationNumber"}]
{FontFamily -> "Arial", FontSize -> -1 + Inherited}
You can use this information to define your custom style for numbered display formulas:
SetOptions[EvaluationNotebook[],
StyleDefinitions ->
Notebook[{Cell[StyleData[StyleDefinitions -> "Default.nb"]],
Cell[StyleData["myNumberedDisplayFormula"],
CellMargins -> {{66, Inherited}, {Inherited, Inherited}},
StripStyleOnPaste -> True,
CellFrameLabels -> {{None,
Cell[TextData[{"(", CounterBox["myNumberedDisplayFormula"],
")"}], FontColor -> Orange, FontFamily -> Inherited,
FontSize -> -1 + Inherited]}, {None, None}},
DefaultFormatType -> DefaultInputFormatType,
"HyphenationOptionsHyphenationCharacter" -> "\[Continuation]",
LanguageCategory -> "Formula", ScriptLevel -> 0,
SingleLetterItalics -> True,
CounterIncrements -> "myNumberedDisplayFormula",
MenuSortingValue -> 1710, FontFamily -> "Arial", FontSize -> 14,
FontColor -> GrayLevel[.2],
UnderoverscriptBoxOptionsLimitsPositioning -> True]},
Saveable -> True,
StyleDefinitions -> "PrivateStylesheetFormatting.nb"]];
-
$\begingroup$ You just beat me! (+1) I think my answer is sufficiently different, although there are similarities. $\endgroup$ Commented Sep 13, 2014 at 20:16
-
$\begingroup$ @Michael, just saw (and upvoted :)) your answer. I think editing the stylesheet and changing the style definition for
"DisplayFormulaEquationNumber"
is a more practical approach. $\endgroup$– kglrCommented Sep 13, 2014 at 20:31 -
$\begingroup$ That worked great, but killed some other styles that I had defined before. I was wondering how I can preserve my current customizations and implement these new ones? $\endgroup$– VirgoCommented Sep 14, 2014 at 0:41
-
The style of the number is "DisplayFormulaEquationNumber"
. I'm going to assume you want all the displayed numbers to have the same style.
From the menu, choose Format > Edit Stylesheet...
Enter DisplayFormulaEquationNumber in the Enter a style name box (no quotes).
Select the cell and format as you wish. You can use the font menu commands or the Options inspector to modify the style. You can also use the Cell > Show Expression to manually enter options.
Example stylesheet, which "DisplayFormulaEquationNumber"
styled to be large and bold:
The equations in the notebook:
-
$\begingroup$ Thanks, my current workbook didn't have the option to enter the stylename. I went to the stylesheet that it inherited from and I could do it there. But unfortunately I found changing the fonts did not propagate through to my notebook. $\endgroup$– VirgoCommented Sep 14, 2014 at 0:28
-
$\begingroup$ @physicsphile Did you try reopening your notebook? $\endgroup$ Commented Sep 14, 2014 at 0:29
-
$\begingroup$ Yes, it din't seem to make any difference. $\endgroup$– VirgoCommented Sep 14, 2014 at 0:53
-
$\begingroup$ @physicsphile, I put some screenshots to show what I get. $\endgroup$ Commented Sep 14, 2014 at 2:05
-
$\begingroup$ Thanks, it works when I start a new file but not on my old file. $\endgroup$– VirgoCommented Sep 14, 2014 at 4:13