Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
    
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? –  VLC Oct 28 '12 at 10:51
    
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. –  NoEscape Oct 28 '12 at 11:29
add comment

2 Answers

up vote 3 down vote accepted

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.

share|improve this answer
add comment

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!

share|improve this answer
add comment

Your Answer

 
discard

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.