Why MMA cannot apply the correct style of unit?

When I select

Style-> Style-> DisplayFormulaNumbered

Then I type some formula show as below:

I found that the font of formula is not Times New Roman,so I select the unit ,then select Style->Font, which shows that the font of formula is courier new.

Question

How to revise this condtion? or is it the default style of DisplayFormulaNumbered

Update

Thanks for Sjoerd C. de Vries's solution.

When I select

• Format > StyleSeet > Book > Textbook

then I select

• Format > Style > EquationNumbered

Lastly, I input some formula shown as below (it show the correct formula style)

I looked up the definition of EquationNumbered,then I found a difference DefaultFormatType -> TraditionalForm

So I execute some operations as below

• Format > StyleSeet > Default

• Format > Edit StyleSeet

• copying the DisplayFormulaNumbered style definitions from the Default.nb parent

However, the result of formula remains keep the font of courier new.

• Which stylesheet are you using? – Mike Honeychurch Jan 6 '15 at 22:12
• @MikeHoneychurch, the stylesheet is the Default.nb of Mathematica – xyz Jan 7 '15 at 1:14

The problem is that the way it has been configured DisplayFormula creates cells with the structure Cell[BoxData[...],...] whereas what you preferably want (IMO) for displaying formaulas is Cell[TextData[...],...].

So the first step would be to make this change to your private stylesheet:

DefaultFormatType->DefaultTextFormatType,


or you could also make the cell style inherit from the Text style:

Cell[StyleData["DisplayFormula",StyleDefinitions -> StyleData["Text"]],
CellMargins->{{66, Inherited}, {Inherited, Inherited}},
StripStyleOnPaste->True,
DefaultFormatType->DefaultTextFormatType,
HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"},
LanguageCategory->"Formula",
ScriptLevel->0,
SingleLetterItalics->True,
FontFamily->"Times",
FontSize->14,
FontColor->GrayLevel[0.2],
UnderoverscriptBoxOptions->{LimitsPositioning->True}]


IMO the default input style formatting is an oversight or error given that this cell style is almost always used for, or to try and obtain, traditional form text formatting. In the screen grab below you can see on top a cell created with the default DisplayFormula style which has an underlying Cell[BoxData[ ... structure. After editing the stylesheet you create a new cell and begin typing and you have a Cell[TextData... structure (equation below).

If you dig in the default stylesheet belonging to your notebook the definition of the DisplayFormula style form which the DisplayFormula is derived. On my WIndows 8 PC it looks like this:

Cell[StyleData["DisplayFormula"],
CellMargins->{{66, Inherited}, {Inherited, Inherited}},
StripStyleOnPaste->True,
DefaultFormatType->DefaultInputFormatType,
HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"},
LanguageCategory->"Formula",
ScriptLevel->0,
SingleLetterItalics->True,
FontFamily->"Arial",
FontSize->14,
FontColor->GrayLevel[0.2],
UnderoverscriptBoxOptions->{LimitsPositioning->True}]


You can see that the base font type is Arial. However you also see the line

DefaultFormatType->DefaultInputFormatType


which seems to indicate the default display type is InputForm. This usually formats in a monospaced font such as Courier. Your formula will therefore look like this:

What you can do is change the format type to TraditionalForm. You can do that by selecting the Cell>Convert to>TraditionalForm Display menu item. Now your formula looks like this:

Checking the font using the Format menu confirms that this is indeed Arial as demanded in the stylesheet.

This is still different from a TraditionalForm formatted code input which looks like this:

According to the font dialog this is indeed Times New Roman.

You can achieve this by copying the DisplayFormula and DisplayFormulaNumbered style definitions from the Default.nb parent of the private stylesheet of your notebook to this private stylesheet and opening the DisplayFormula definition using Cell>Show Expression (Ctrl+Shift+E) and changing the above line to read

FontFamily->"Times New Roman"


Your formula now looks like this (in TraditionalForm display):

This is pretty close. You probably need to copy some definitions from the TraditionalForm definition into the DisplayFormula definition to make it a perfect match.

• Is it possible to make the formula show the result of Times New Roman font, not Courier new font. Namely, I didn't need to select the Cell >Convert to >TraditionalForm Display menu item. – xyz Jan 7 '15 at 1:43
• Change the DefaultFormatType line to read DefaultFormatType->DefaultTextFormatType, see Mike's answer. – Sjoerd C. de Vries Jan 7 '15 at 7:14
• @ShutaoTang 1. When you change the StyleSheet make sure that you correctly saved the changed StyleSheet. Just to remind: to save the StyleSheet you cannot go to Menu/File/Save or do Ctrl+S. Instead you should do Menu/File/SaveAs. 2. In my case instead of changing the Default StyleSheet I created a custom one, a DefaultModified. In this one there are e.g., comfortably formatted DisplayFormula and DisplayFormulaNumbered and several other cell styles. May be it is a good idea to make your own style as I did. – Alexei Boulbitch Jan 7 '15 at 8:30