4
$\begingroup$

I made a custom stylesheet, installed it, and applied it to a new blank notebook. Adding a cell and changing it to Text results in the expected behavior. The font and font size change to whatever the stylesheet says.

But this does not happen for DisplayFormulaNumbered cells. The Front End ignores some (but not all!) of my stylesheet settings when formatting a cell as DisplayFormulaNumbered.

The stylesheet contains:

Cell[StyleData["DisplayFormulaNumbered"],
 FontFamily->"CMU Serif",
 FontSize->12,
 FontWeight->"Plain",
 FontSlant->"Plain",
 PrivateFontOptions->{
 "FontPostScriptName"->
  "Automatic"},ExpressionUUID->"272b9ba5-a88d-4627-839e-26d5afa11266"]

But making a DisplayFormulaNumbered cell results in a 14-point, medium weight Source Code Pro font.

I can get it to pay attention to the font settings if I add DefaultFormatType->DefaultTextFormat but then it really does treat it as text, rather than as an equation in TraditionalForm, so integrals and sums are vertically compressed, etc.

By inspecting the options for numbered equations set to TraditionalForm via Cell->Convert To->TraditionalForm Display, I tried adding

SingleLetterItalics->True,
TraditionalFunctionNotation->True,
DelimiterMatching->None,

to the stylesheet. This succeeds in producing a 12-point plain-weighted font, just not CMU Serif. It's still Source Code Pro. Why any of these would affect the font, I cannot see.

This is very confusing. I thought the styles were applied in a cascade from Core.nb to Default.nb to my ScottStyle.nb, and finally any changes I make to cells directly in the Front End. But I can't see how I could get this behavior of paying attention to some but not all of my stylesheet commands without there being some other styling applied after my stylesheet but before anything I might do in the front end. Maybe TraditionalFunctionNotation overrules the font family but not the size and weight?

Moreover, Shift-Ctrl-E shows that the cell is indeed a DisplayFormulaNumbered cell and CurrentValue[{StyleDefinitions, "DisplayFormulaNumbered"}] shows FontFamily->CMU Serif but the actual font displayed is clearly SourceCode Pro.

What magic incantation should I chant to get a stylesheet to produce the same result as using the mouse to do Format->Style->DisplayFormulaNumbered, Cell->Convert To->TraditionalForm Display, ctrl-T, choose font and size?

$\endgroup$
0

1 Answer 1

4
$\begingroup$

I failed to find a duplicate so here it is:

StyleData["DisplayFormulaNumbered"] is not environment specific so e.g. StyleData["DisplayFormulaNumbered", "Working"] will take precedence over your settings.

My guess is this is what happens as there is always a default stylesheet inherited (87184).

So the way to fix is to specify your style changes for all environments you care about. Or to create completely different style, which makes sense if there is only a small part you want to inherit from the original style. But I think it is not the case here and you should go with the former one.

Does not feel neat to have to duplicate those settings for each environment but I'm not aware of any faster method to merge styles and enforce your changes.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.