# Clickable cross-references to deduction labels

I'm using the package proof for drawing deductions. The package supports labels. However, I'd like to have clickable cross-references to them. Is this possible? Note that I want the label to be a custom text, not a number. The package doesn't seem to have inbuilt support for cross-references (neither clickable nor non-clickable). Neither does the seemingly more comprehensive bussproof. Below's an example of intended use:

\documentclass{llncs}   %or {article}
\usepackage{proof}      %\infer

\begin{document}

$\infer[\mbox{mylabel}]{a : A}{a ~\mbox{exists}}$

As %\intendedrefto{mylabel} shows, ...

\end{document}

• Using the hyperref package should work, but not with this style of labelling, of course.
– user31729
Jun 12, 2016 at 14:58
• You could make it an answer w/ a MWE
– jaam
Jun 12, 2016 at 15:07
• Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. Apr 16, 2018 at 21:54

You can set the reference text yourself, since \label uses the current definition of \@currentlabel:

\documentclass{article}
\usepackage{proof}

\makeatletter
\newcommand{\labelthis}[2]{%
\def\@currentlabel{#2}\label{#1}#2%
}
\makeatother

\begin{document}

$\infer[\mbox{\labelthis{ml}{mylabel}}]{a : A}{a ~\mbox{exists}}$

As \ref{ml} shows, ...

\end{document}


If you are also using amsmath, you need to use \ltx@label instead of \label

\makeatletter
\newcommand{\labelthis}[2]{%
\def\@currentlabel{#2}\ltx@label{#1}#2%
}
\makeatother

• Thanks. Could you expand on the meaning of [2]{\def\@currentlabel{#2}\label{#1}#2}?
– jaam
Jun 13, 2016 at 21:33
• @jaam The macro has two arguments; #1 is used to set the label, #2 is the text that you want to be printed by \ref (so it's stored in \@currentlabel) and also in the formula. Jun 13, 2016 at 21:44
• I unaccepted the answer since I couldn't get the solution to work in my manuscript (my solution works but isn't ideal)
– jaam
Feb 12, 2017 at 5:56
• @jaam Unaccepting, in this case, seems unfair in my opinion. Mar 20, 2018 at 19:02
• @Dr.ManuelKuehner Well, at least it retained the upvote
– jaam
Mar 20, 2018 at 19:07

Here's a solution:

\documentclass{llncs}
\usepackage{proof}      %\infer
\usepackage{mathtools}  %\tag
\usepackage{hyperref}
\usepackage{xcolor}     %\color

\begin{document}

$$\label{wha} \infer[\mbox{mylabel}]{a : A}{a ~\mbox{exists}} \color{white}{\tag*{mylabel}}$$

As \ref{wha} shows, ...

\end{document}