Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cleveref's \crefname{equation} loses parentheses

1,021 views
Skip to first unread message

fgnievinski

unread,
Jul 4, 2008, 11:39:41 AM7/4/08
to
Hi.

I'm using the excellent cleveref package [1].
It automatically adds the name e.g. "Figure" when I reference
\cref{fig:example}.
Due to dept. regulations, I need all reference names (e.g. figure,
table, equation) to start with a capital letter, no matter if they
occur at the middle of a sentence (don't tell me).
I was able to achieve that for figures and table through \crefname,
e.g.,:

\Crefname{figure}{Figure}{Figures}
\crefname{figure}{Figure}{Figures}

but if I try the same for equation,

\Crefname{equation}{Eq.}{Eq.}
\crefname{equation}{Eq.}{Eq.}

then I lose the parentheses around the eq. number in e.g.,
"Eq.~(4.4)".
The only way that I could capitalize equation while keeping the
parentheses was through \crefformat:

\crefformat{equation}{Eq.~(#2#1#3)}
\Crefformat{equation}{Eq.~(#2#1#3)}

But I expected that the simpler \crefname would suffice -- am I mis-
interpreting something here?

Thanks,
Felipe.

[1]<http://www.ctan.org/tex-archive/macros/latex/contrib/cleveref/>

Steve Hicks

unread,
Jul 4, 2008, 1:30:23 PM7/4/08
to
On Jul 4, 11:39 am, fgnievinski <fgnievin...@terra.com.br> wrote:
...

> but if I try the same for equation,
>
> \Crefname{equation}{Eq.}{Eq.}
> \crefname{equation}{Eq.}{Eq.}
>
> then I lose the parentheses around the eq. number in e.g.,
> "Eq.~(4.4)".
> The only way that I could capitalize equation while keeping the
> parentheses was through \crefformat:
>
> \crefformat{equation}{Eq.~(#2#1#3)}
> \Crefformat{equation}{Eq.~(#2#1#3)}
>
> But I expected that the simpler \crefname would suffice -- am I mis-
> interpreting something here?

It seems like \crefname, etc, overwrites the format. Internally, the
package uses \@crefname, and this is less destructive. So you could
use

\makeatletter
\@crefname{cref}{equation}{Eq.}{Eqs.}
\@crefname{Cref}{equation}{Eq.}{Eqs.}
\makeatother

This is probably the behavior that was intended... \crefname should
produce an undecorated number, so this shouldn't change just because
it's predefined differently. On the other hand (and completely
unrelated) is that the package gives a silly error with the minimal
document class because it tries to \renewcommand\appendix...

--
Steve

0 new messages