I have used LaTeX for a long time, but here is something I couldn't figure out even after vigorous googling (duckduckgoing, actually).
I am using a custom counter to number examples that I am giving throughout a long paper.
Code: Select all
\newcounter{expls}
...
\addtocounter{expls}{1}
...
\textbf{Example \arabic{expls}: \addtocounter{expls}{1} Example 1.
...
\textbf{Example \arabic{expls}: \addtocounter{expls}{1} Example 2.
...
\textbf{Example \arabic{expls}: \addtocounter{expls}{1} Example 3.
...
Sometimes I want to refer to these examples. To refer to an equation or a section, I can use \ref{}, for example "see Section \ref{sectionref}". how can I label and then refer to custom counters like expls above, like "see Example \ref{exampleref}" where of course I have to label the examples somehow.