5
$\begingroup$

How do I use the styles "DisplayFormula" and "DisplayFormulaNumbered"?

Why is there no margin (or empty space) around the formula? Why does the latter not display numbers?

How to set those styles to do what one expects?

$\endgroup$
2
  • $\begingroup$ I agree that there is no extra margin on the left, but when using DisplayFormulaNumbered I get a number on the extreme right side. What exactly do you expect? $\endgroup$
    – VLC
    Commented Oct 28, 2012 at 10:51
  • $\begingroup$ I do not get a number on the right side. I expect a certain margin, offsetting the formula from the plain text. The problem arises - as I now realize - from the cell being inline. $\endgroup$
    – NoEscape
    Commented Oct 28, 2012 at 11:29

2 Answers 2

6
$\begingroup$

Here is a walk-through with some of the shortcuts that I like to use.

Normally, you'd enter text and inline formulas using the cell style "Text", and when you're ready to enter a displayed equation you have to start a new cell. At that point, you would go to the menu and select, e.g., the style "DisplayFormulaNumbered" with the mouse. Having to take your hands off the keyboard for this purpose inevitably slows you down. But this can be avoided if you make use of the CMD-0 shortcut for Format > Style > Other...: Other...

At this point, I select DisplayFormulaNumbered, and this selection will be remembered next time you do CMD-0 to insert further displayed equations, so you can dismiss the dialog without using the mouse by pressing Return. It's even remembered across Mathematica sessions. This is the fastest way to get into the DisplayFormulaNumbered environment in a new cell.

Usually I now enter the equation in TraditionalForm. The default format type for displayed equations is not TraditionalForm, but you get that format either by converting an existing inline equation to DisplayFormulaNumbered (as mentioned by the OP), or by pasting a TraditionalForm expression, or by doing Cmd-Shift-T on whatever you type in the new DisplayFormulaNumbered cell.

Another useful trick for numbered equations is the shortcut for entering equation references described in Albert Retey's answer to "Creating a cross referencing shortcut."

If you now want to change the margins or alignment of the DisplayFormulaNumbered cell, that can be done by selecting Format > Edit Stylesheet... and choosing the style DisplayFormulaNumbered from the popup menu. Then you can highlight the template cell that appears, and change (e.g.) Format > Text Alignment > Align Center.

$\endgroup$
3
  • $\begingroup$ This is a little off topic, but what is the purpose of using DisplayFormula. What is the advantage of this over using an Inline cell within a Text cell. Similarly, what is the advantage of using the style InlineFormula? $\endgroup$ Commented Aug 7, 2014 at 19:34
  • $\begingroup$ @BenAllgeier I'm proposing to use DisplayFormulaNumbered because it provides equation numbers that can be referenced later. The difference between displayed and inline formulas becomes clear when you use symbols requiring two-dimensional typesetting, e.g., sums and integrals with limits. Inline formulas don't typeset the limits below and above the symbol, but next to it (by default). $\endgroup$
    – Jens
    Commented Aug 7, 2014 at 20:23
  • $\begingroup$ Thanks. I thought perhaps they had something to do with LaTeX. I have ScriptLevel->0 for InlineCell so I guess I forgot that issue. It seems more difficult to type in formulas in DisplayFormula than it does in a Text cell (if you don't want Equation Numbers). Are you supposed to use InlineFormula inside of a text cell like you do Inline Cell (those two sound the same but I can only see use for InlineCell). $\endgroup$ Commented Aug 7, 2014 at 20:52
3
$\begingroup$

You must NOT use inline math cells. A DisplayFormula must be a cell on its own. If you want to turn an inline math cell into a DisplayFormula, first select the line containing it and choose "Divide Cells", then apply the DisplayFormula style to the new cell!

$\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.