Assuming you want to use the same counter variable for both equation-like and inequality-like environments, you can proceed by informing cleveref
(i) that certain environments are "special" (specifically, that they are inequalities) and (ii) what to do in terms of typesetting the cross-references to these "special" objects. The former can be achieved by providing an optional argument to the \label
command. (cleveref
cleverly redefines \label
to make this possible.) The latter can be achieved by executing appropriate \crefname
and \creflabelformat
instructions.
\documentclass[12pt,letterpaper]{article}
\usepackage{amsmath,geometry}
\usepackage[colorlinks]{hyperref} %% just for this example
\usepackage[nameinlink]{cleveref}
\crefname{ineq}{inequality}{inequalities}
\creflabelformat{ineq}{#2{\upshape(#1)}#3}
%% \upshape ensures that the number and surrounding parens are typeset in upright mode
\setlength\parindent{0pt} %% just for this example
\setlength\textwidth{4in} %% just for this example
\begin{document}
\begin{flalign}
&f(x) \geq g(x)& \label[ineq]{i:positivity} %% note optional argument of \label
\end{flalign}
Admitting that \cref{i:positivity} has a solution, \dots
\end{document}
Section 6 of the user guide of the cleveref
package provides a fuller explanation of how this works. In that section, it's also explained how to automate this a bit if you have lots and lots of inequalities, in which case it might become tedious to have to remember to supply the option ineq
to \label
whenever the object is an inequality.
\eqref{}
?cref
to automatically handle all the different types of references, I was wondering if this would still be doable using it.hyperref
package is loaded andcleveref
was loaded with the optionnameinlink
. By writing "by inequality \eqref{xyz}
" instead of "by \cref{xyz}
", one loses the feature of having the word "inequality" be part of the "target" of the hyperlink.