I've written a command to `hide' text, equations, and content, by changing its colour (e.g. to all white). Based on the discussion in [1] I'm using the command:
\newcommand{\hi}[1]{{\leavevmode\color{gray!0}{#1}}}
It's important that it colours all text, all equations, and all environments (like enumerate). This works well. However, where it seems to fail is if hyperref colours the links. Here is a minimal example:
\documentclass{minimal}
\usepackage[usenames, dvipsnames]{xcolor}
\usepackage{hyperref}
\hypersetup{colorlinks=true,linkcolor=Red,citecolor=Red}
\usepackage{amsmath}
\newcommand{\hi}[1]{{\leavevmode\color{gray!0}{#1}}}
\begin{document}
\hi{This is an equation
\begin{equation} \label{myref}
a = b.
\end{equation}
%
I will reference the equation \eqref{myref}.}
\end{document}
On this minimal example, the equation reference \eqref{myref}
produces a red-coloured number 1. Is there a way to keep coloured links `on' (in areas of the document not affected by '\hi{}') and yet colour them appropriately in affected areas?