Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

enter image description here

This example is in DisplayFormula cell.


How can I format them to the appearance like the following in batch.

I set FontSize->Times, and Italic for $\color{Green}{f'(x)}$, $x$ seperately, but not so easy for too many InlineFormula/DisplayFormula/... cells by hand.

Mathematica graphics

$$\begin{align*}\color{blue}{f'(x)}=\sin \frac{1}{\color{red}{x}}-\frac{1}{\color{red}{x}}\cos\frac{1}{\color{red}{x}}(\color{red}{x}\neq 0)\tag{1}\end{align*}$$

When I export notebook as html, the formulas are rasterized to image which not in TraditionalForm which shown above as that I setted by hand.

sample typesetting, inline formulas are images, I'm thinking that how to make them more beautiful and more traditional formal. Most of them are typed into Mathematica by hand

As you'll see that some single fs are Times Italic, they are good shown, but in DisplayFormula they are not.


Mike Honeychurch's example

enter image description here

My Setting(related?):

enter image description here


I've tried Mike's method, however failed, how about yours.

I'm on Windows and Mathemtaica 9.

share|improve this question
@Nasser well, good to know about that, I'll consider it after I can play around converting Notebook To Latex well. – HyperGroups Jul 15 '13 at 5:54

Your underlying box structure is not quite right. You need to add FormBoxes and TextData. e.g.

cellExpression = 
      FormBox[RowBox[{RowBox[{SuperscriptBox["f", "\[Prime]", 
            MultilineFunction -> None], RowBox[{"(", "x", ")"}]}], 
         "=", RowBox[{RowBox[{"sin", "", FractionBox["1", "x"]}], "-",
            RowBox[{FractionBox["1", "x"], "cos", 
             FractionBox["1", "x"], 
             RowBox[{"(", RowBox[{"x", "\[NotEqual]", "0"}], 
               ")"}]}]}]}], TraditionalForm]],
     FormatType -> "TraditionalForm"]
    ], "DisplayFormulaNumbered"];

The correct form can be determined by building these equations in a e.g. text cell, starting with the new cell and then pressing control 9.


pasted is the gif image that Mathematica generates when you save the code and generated cell above as HTML.

enter image description here

I did this with V8 on Mac 10.6.8

share|improve this answer
When I saved your sample as .html, they're also not traditional form. How about in yours? – HyperGroups Jul 15 '13 at 5:50
yep they are traditional form. see edit. – Mike Honeychurch Jul 15 '13 at 6:11
I donot know why I can't follow your effect, only Output Cell and InlineFormula cell can become TraditionalForm. – HyperGroups Aug 12 '13 at 13:35
What version & platform are you using and what stylesheet are you using? Have you modified the stylesheet? – Mike Honeychurch Aug 12 '13 at 21:53
mathematica 9, windows 8, Default Stylesheet and Styled stylesheets. – HyperGroups Aug 13 '13 at 0:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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