How can I get cleveref
to produce the following:
Inserting Equation (1) into (2) yields ...
i.e., I don't want the word "Equation" to pop up before (2), which i have when simply using
Inserting \Cref{eq:1} into \Cref{eq:2} yields ...
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityUse \labelcref
for the second cross-reference. Or, assuming the amsmath
package is loaded as well, just write \eqref
to generate the second cross-reference.
A full MWE:
\documentclass{article}
\usepackage{amsmath}
\usepackage{cleveref}
\begin{document}
\begin{equation}\label{eq:1} a \end{equation} % generate two dummy equations
\begin{equation}\label{eq:2} b \end{equation}
Inserting \cref{eq:1} into \labelcref{eq:2} yields \dots
Inserting \cref{eq:1} into \eqref{eq:2} yields \dots
\end{document}
\cref
and \Cref
) is not correct -- at least not when it comes to generating cross-references to equations. To keep the output the when changing \Cref
to \cref
, you should also change \usepackage{cleveref}
to \usepackage[capitalize,noabbrev]{cleveref}
in order to get "Equation" instead of "eq.".
\cref
and \Cref
are very distinct: eq.
vs. Equation
for the singular case, and eqs.
vs. Equations
for the plural case. I used \Cref
precisely because the OP seemed to prefer to output Equation
. If you change my code from \Cref
to \cref
, you should also change the way cleveref
is loaded, so as to get back to Equation
.
It's possible to change with \crefname{}{}{}
. Enter the environment in the first bracket, then the singular form, and last the plural form.
\crefname{equation}{}{}
would remove any form of Eq/Eqs and only print (1), (2).