kjo
kjo

Reputation: 35321

References/links to numbered list items?

Here's a homey example to illustrate my question.

Say I have a cooking recipe in the form of a numbered list, where the steps of the recipe correspond to the items of the list, and that somewhere in the recipe I refer to "the mixture prepared in step 3". Now suppose that I decide to insert an additional step between steps 2 and 3. This means that the phrase "the dressing prepared in step 3" is now incorrect, since what used to be step 3 is now actually step 4.

Is there some way to format the reference "step 3" in such a way that the number will get automatically updated to reflect the items current position in the numbered list?

Upvotes: 0

Views: 213

Answers (1)

John Kitchin
John Kitchin

Reputation: 2433

I don't think so. You should avoid using the numbers if you are reading it in org-mode. Org-ref (https://github.com/jkitchin/jmax/blob/master/org/org-ref.org) provides a label and ref link that you could use for this.

  1. add stuff label:stuff
  2. Stir
  3. Use ingredients from step ref:stuff to fill container.

When you export this to LaTeX then the ref links will be replaced by numbers as you want.

For vanilla org-mode use targets like this:

  1. add stuff
  2. Stir <<stir-label>>
  3. Use something from step [[stir-label]] to get there.

Upvotes: 2

Related Questions