I'd like to write, e.g., \xlabel[custom text]{dual}. That need not output anything, but whenever I write \ref{dual} (or, e.g., \xref{dual}), that should output "custom text".
There are two advantages.
- One can change the name of a concept later.
- The text "custom text" still serves as a link to the definition*, provided \usepackage{hyperref}.
A solution is given here: Defining custom labels. However, with hyperref it produces an error: "Paragraph ended before \Hy@setref@link was complete."
Does somebody have a solution to that? Even better, if the solution would make clicking the \ref jump to the location of the label instead of the previous numbered item (such as an equation or a theorem), but even such an approximate jumping would be better than none.
Another solution is given here Bold enumerate labels, non-bold reference to them. However, it requires one to add lots of code and a new enumbered item, whereas the original solution allows one to add numerous labels without changing the presentation at all.