4

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

2 Answers 2

7

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
    Commented Jul 14, 2021 at 7:11
  • In general, they are distinct. Are you saying they ar distinct in the particular example?
    – Yossi Gil
    Commented Jul 14, 2021 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
    Commented Jul 14, 2021 at 9:16
0

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).

3
  • 1
    AFAICT, the OP wanted to remove the label "Equation" only from the second cross-reference, not from both of them.
    – Mico
    Commented May 9, 2022 at 8:33
  • 1
    This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
    – FHZ
    Commented May 9, 2022 at 8:36
  • The word 'Equation' is usually unwanted in any reference thus (#) is sufficient, but can be spelled out where it is needed.
    – johfo
    Commented May 13, 2022 at 7:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .