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.

enter image description here

I was typesetting some formulas and I encountered a formula number marked with a prime.

I am using the DisplayFormulaNumbered cell style`. How can I add a cell with numbered with $7'$? Here is an excerpt from one of my notebooks marked to show how I want a formula numbered.

enter image description here

share|improve this question
    
That isn't going to work as an automatic cell counter. You would need to set 4' manually or perhaps create a separate style –  Mike Honeychurch Jul 11 '13 at 23:04
    
Are you aware that a DisplayFormulaNumbered cell doesn't contain any reference to the number it displays? That makes it a bit hard to get control over the displayed number. –  m_goldberg Jul 11 '13 at 23:16

1 Answer 1

up vote 9 down vote accepted

I have created a new style to implement this. The first screen grab is the finished product:

enter image description here

Here is a pic with the underlying expression shown. Note the new style "DisplayFormulaNumberedPrimed":

enter image description here

The new style was added to the private stylesheet for this notebook:

enter image description here

The underlying box code for this style is:

Cell[StyleData["DisplayFormulaNumberedPrimed", StyleDefinitions>StyleData["DisplayFormulaNumbered"]],
CellFrameLabels->{{None, 
    Cell[TextData[Cell[BoxData[RowBox[{"(",SuperscriptBox[ CounterBox["DisplayFormulaNumbered"], \[Prime]], ")"}]],
    FontFamily->"Times",FontSize->Inherited]], 
     "DisplayFormulaEquationNumber"]}, {None, None}},
CounterIncrements->""
]

Note that aesthetically you will probably want to tweek this because the parenthesis size rescale due to the prime.

Edit

This is a bit cleaner:

Cell[StyleData["DisplayFormulaNumberedPrimed", StyleDefinitions->StyleData["DisplayFormulaNumbered"]],
CellFrameLabels->{{None, 
Cell[TextData[{
 Cell[BoxData[
  RowBox[{Cell["("], "\[NegativeThinSpace]", 
   SuperscriptBox[ CounterBox["DisplayFormulaNumbered"], \[Prime]], "\[NegativeThinSpace]",Cell[")"]}]],FontFamily->"Times",FontSize->Inherited]
}], "DisplayFormulaEquationNumber"]}, {None, None}},
CounterIncrements->""
]

enter image description here

Note that the way this works is that CounterIncrements->"" prevents any incremental increase in the counter -- since you want to use the same counter number as the "DisplayFormulaNumbered" cell immediately prior to the primed number.

share|improve this answer

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.