Strikethrough a \cref-generated cross-reference

I'm looking to strikethrough a cross-reference generated with \cref. I thought a basic example like the following would work:

\documentclass{article}
\usepackage{cleveref}
\usepackage{soul}

\begin{document}

Consider
$$\label{eq:int} \int_a^bf(t)dt=0$$

Then \st{Ignore \cref{eq:int}.}

\end{document}


However, I get an error message about one-too-many } symbols. To clarify, I would like the cross-reference to still be present (and blue, but I don't think that's important to this example), but have the strikethrough on top of it.

Any help would be appreciated.

• Similar problems have already showed up; the simplest workaround is \st{Ignore \mbox{\cref{eq:int}}.} – egreg Oct 19 '18 at 9:26

This is a by-pass solution with TikZ, striking out the text by overprinting with a line, using a node aligned to the baseline and applying the west and east node anchors as drawing start and end points.

Using TikZ styles and/or pgfkeys etc. the customization would even better.

\documentclass{article}
\usepackage{cleveref}

\usepackage{tikz}

\newcommand{\tikzst}[2][line width=1pt,blue,opacity=0.4]{%
\tikz[baseline]{ \node[anchor=text,outer sep=0pt,inner sep=0pt] (A) {#2}; \draw[#1] ([xshift=-0.1ex]A.west) --  ([xshift=0.1ex]A.east);}%
}

\begin{document}

Consider
$$\label{eq:int} \int_a^bf(t)dt=0$$

$$c^2 = a^{2} + b^{2} \label{eq:pythagoras}$$

Then \tikzst{Ignore \cref{eq:int}}, but think of \tikzst[red]{\cref{eq:pythagoras}}!

\end{document}