3

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 ...
0
6

Use \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}
3
  • @YossiGil - Your claim that "output is the same" (for \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.".
    – Mico
    Jul 14 at 7:11
  • In general, they are distinct. Are you saying they ar distinct in the particular example?
    – Yossi Gil
    Jul 14 at 7:50
  • @YossiGil - When one generates cross-references to equations, the outputs of \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.
    – Mico
    Jul 14 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.