I have tried to follow another question but I cannot get it to work. My question is: How do print a text based on if a reference exists or not?
I have tried the following:
\usepackage{etoolbox}
\usepackage{xparse}
...
\NewDocumentCommand\calledName{m}{%
\ifcsundef{r@KN:#1}{\ref{FN:#1}}{\ref{KN:#1}}%
}
Best Answer
Here's a way with
\@ifundefined
and usinglatex.ltx
core features.If the label
KN:#1
is undefined, a reference toFN:#1
is used (or at least tried to do so.Another way would use
\getrefnumber
etc. byrefcount
package.