0
$\begingroup$

When I select

Style-> Style-> DisplayFormulaNumbered

enter image description here

Then I type some formula show as below:

enter image description here

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)

enter image description here

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

  • enter image description here

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

enter image description here

$\endgroup$
2
  • $\begingroup$ Which stylesheet are you using? $\endgroup$ Jan 6, 2015 at 22:12
  • $\begingroup$ @MikeHoneychurch, the stylesheet is the Default.nb of Mathematica $\endgroup$
    – xyz
    Jan 7, 2015 at 1:14

2 Answers 2

3
$\begingroup$

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,
 MenuSortingValue->1700,
 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).

enter image description here

$\endgroup$
2
$\begingroup$

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,
 MenuSortingValue->1700,
 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:

Mathematica graphics

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:

Mathematica graphics

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:

Mathematica graphics

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):

Mathematica graphics

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.

$\endgroup$
3
  • $\begingroup$ 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. $\endgroup$
    – xyz
    Jan 7, 2015 at 1:43
  • 1
    $\begingroup$ Change the DefaultFormatType line to read DefaultFormatType->DefaultTextFormatType, see Mike's answer. $\endgroup$ Jan 7, 2015 at 7:14
  • 1
    $\begingroup$ @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. $\endgroup$ Jan 7, 2015 at 8:30

Your Answer

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

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