8
$\begingroup$

Possible Duplicate:
How do I get the equivalent of the $\LaTeX$ \tag{} in Mathematica?

This seems like an obvious question yet I cannot find any answer to it. I am using Mathematica 8 and am sequentially numbering my equations using (Format->Style->DisplayFormulaNumbered). This works fine but how can I reference specific equations in text so that they will change accordingly if I add new equations before the referenced equation?

I know LaTeX does this fantastically and it seems like an easy process. Just to be specific, If I have equations,

blah=blahblah (1)

nerg=flarg (2)

plugging in equation (2) into equation (1)... but then I want to add an equation before equation (1), how can I automatically have the text change to "plugging in equation (3) into equation (2)..."?

Also, is there anyway to have more control over the numbering? Such as instead of equation (2) can I have equation (2.1)? This would help since I have sections that would make that numbering style much nicer.

Thanks! I hope this is not a frequently asked question but I searched and couldn't find an answer.

$\endgroup$
9
  • 4
    $\begingroup$ you need to use counters for this. I am at work and don't have time for a full answer but do a search for tagging your DisplayFormulaNumbered cell and for using Insert>Automatic Numbering... menu item. If no one posts an answer I'll post something tonight my time. Also to have equations in a format e.g. "2.1" you wil need to modify your cell style. I'll post an example tonight if no one else has answered. $\endgroup$ Jan 22, 2013 at 2:23
  • 1
    $\begingroup$ It's annoyingly cumbersome, but the process is as described by @MikeHoneychurch. Here are two links that cover basically everything: Shortcut to insert CounterBox, Creating a cross referencing shortcut $\endgroup$
    – Jens
    Jan 22, 2013 at 2:43
  • $\begingroup$ (1) Tag the DisplayFormulaNumbered cells. (2) When you want to insert a reference, use menu item Insert > Automatic Numbering, and locate the appropriate cell tag. (2b) Also make sure you set the Counter to the correct type for the tagged cell being referenced (that would be DisplayFormulaNumbered, for the setup you describe above). (2c) Have cursor located in the spot you wish to have the reference appear. $\endgroup$ Jan 22, 2013 at 3:07
  • 2
    $\begingroup$ @DanielLichtblau I haven't heard "egad" be used since the 1600s. $\endgroup$
    – VF1
    Jan 22, 2013 at 3:12
  • 2
    $\begingroup$ @VF1 And it was probably me you heard using it that time too... $\endgroup$ Jan 22, 2013 at 3:14

1 Answer 1

15
$\begingroup$

The numbered formula

In order to make the cross-referencing of formula (or any other object) one needs to perform the following steps.

  1. The first step is to introduce a cell with a Numbered formula by a standard way (Menu/Format/Style->DisplayFormulaNumbered). Then go to Menu/Cell/Cell Tags/Add-Remove Cell Tags and add a tag to the formula. Let us give it the tag:

eqSumOfSquares

A good idea would be also to go to Menu/Cell/Cell Tags/ and check ->Show Cell Tags, keeping it checked during the whole work over the paper, and only uncheck when the paper is finished. This will enable one to see the cell tags during the work. The first equation done that way is written below:

x^2+y^2 (1)

  1. After this has been done, one needs to refer to this equation. Prepare first the round parentheses: (), put the cursor between them go to Menu/Insert->Automatic Numbering. In the opening dialog in the large window at the dialog bottom scroll and choose the tag of equation in question. Check the radio-button "The first cell with the tag" and in the dialog top under "Counter" choose "Display formula numbered". Press OK. After this has been done the number of the equation appears between the parentheses (where the cursor was standing.

If one now repeats the procedure with another formula, say,

sin(x) (2)

makes a tag, say, eqSinus and also introduces the number () by the already described method. The numbering appears again.

Now if one exchanges the positions of the formulas, their numbering will automatically change and so will also the numeration of the cross-references. There is a tutorial movie describing that somewhere on the Wolfram site. I did not save its coordinate, however.

The numbered figures

In order to make the cross-referencing of illustrations one needs to perform the following steps.

  1. The first step is to introduce a cell with the FigureCaption style by a standard way. Then go to Menu/Cell/Cell Tags/Add-Remove Cell Tags and add a tag (say, figA) to the FigureCaption cell.

(* Note that the cell style FigureCaption is absent in the default notebook style. One finds it, however, in the JournalArticle StyleSheet *)

A good idea would be also to go to Menu/Cell/Cell Tags/ and check ->Show Cell Tags, keeping it checked during the whole work over the paper, and only uncheck when the paper is finished. This will enable one to see the cell tags during the work.

  1. Its tag that is already introduced is figA. After this has been done one needs to refer to this equation. Prepare first the text "Fig. " in the FigureCaption cell (found also in the JournalArticle StyleSheet), put the cursor after it. Go to Menu/Insert/Automatic Numbering. In the opening dialog in the large window at the dialog bottom scroll and choose the tag of figure in question (i.e. figA in this case). Check the radio-button "The first cell with the tag" and in the dialog top under "Counter" choose "FigureCaption". After this has been done the number of the equation appears between the parentheses (where the cursor was standing.

If one now repeats the procedure with another figure and also introduce the number Fig. 0 by the already described method. The numbering appears again. Now, if one exchanges the positions of the formula, their numbering will automatically change and so will also the numeration of the cross-references. There is a tutorial movie describing that which may be found under

It is needless to write that the references to literature and internet sources could be managed in the same way.

$\endgroup$
7
  • 1
    $\begingroup$ Old, but they sure make it hard to reference tags in Mathematica. $\endgroup$ Dec 1, 2014 at 14:56
  • $\begingroup$ @ Lonely Mathematician I did not understand your comment $\endgroup$ Dec 1, 2014 at 15:34
  • $\begingroup$ I'm saying, that's a long answer for something that seems simple. Not criticizing your answer--I'm just wondering why they made it so hard. $\endgroup$ Dec 1, 2014 at 15:42
  • $\begingroup$ @Lonely Mathematician Well, if you know it, it's, indeed, simple. But then you do not ask questions about it. If I do not know such a thing, I prefer to have a detailed instruction. But why did you read it, if it is boring? $\endgroup$ Dec 1, 2014 at 15:58
  • $\begingroup$ I'm saying you did a great job by being very thorough. $\endgroup$ Dec 1, 2014 at 15:59

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