Is there a way to assign a reference to something (using \label
), but to not actually have it show up in the document? I would still like to cross-reference it in a later part of the document?
For example, I have an counter called \productitem
, and I'd like to do something like this:
\productitem\label{initialitem}\\ %Lorem ipsum
Then later in the document:
\ref{initialitem} is sold...
Now this code would print a reference number for initialitem
, and then later on reference that number. However, I don't want the initial reference number to be printed, nor do I want any space given to it or any blank lines.
I realise you might wonder why I want to do this. I am producing a product listing; the initial product not available (or is not relevant to a particular listing) and so can't be listed. However, a variant of it does need to be listed. I would like to use the initial product's reference number as a basis for the variant's product number.
\label
itself never outputs anything, only\ref
does.