I am writing a programming book on AWK in Latex and I have hundreds of code examples, for example,
awk '1; { print "" }'
I am curious how can I reference the example later in the book. At the current stage it's example #3, but if I add one before it, I'd like the numbering to update automatically, and I'd also like to make a clickable link in the final pdf, that would bring the user to the example.
Thanks!