Let's say I have different kinds of food nested like this:
1 Fruit
1.1 Apple
1.2 Orange
2 Vegetable
2.1 Tomato
2.2 Onion
The ordering of the foods matter and I don't want to refer to them by name, just numbering. For example, in my latex code, I would like to write something like Food \ref{onion}
and then it would print Food 2.2. Furthermore, when I later realize that a tomato is actually a fruit and move it to the fruit list, Food \ref{onion}
would print Food 2.1.
How can I set up this? I'm only familiar with cross-referencing for sections and equations.
EDIT: The list is "secret" and should not appear in the document, i.e., nowhere am I starting an enumerate
. To give some context, I'm writing a recipe that can't refer to the ingredients explicitly. The person just receives the recipe and ingredient boxes labeled "Food 1.1," "Food 1.2," etc.