5

I'm using cleveref with the capitalise option, and I'd like to use the \lcnamecref command to give the name of one of my theorems in the text. But if this is not one of the theorem types pre-defined in cleveref (Lemma, Theorem etc.) then I get an error message. Here's a MWE:

\documentclass{article}
\usepackage{amsthm}
\usepackage[capitalise]{cleveref}

\crefname{mythm}{Mytheorem}{Mytheorems}
\newtheorem{mythm}{Mytheorem}

\begin{document}
\begin{mythm}\label{m}
foo
\end{mythm}
That was a \lcnamecref{m}.
\end{document}

When I compile I get the error message

! Argument of \MakeUppercase has an extra }.

What am I doing wrong?

  • I get no error if I use \Crefname instead of \crefname – egreg Mar 26 '13 at 13:08
7

\lcnamecref will force lowercase for the names defined with \Crefname (the upper-case variant), so you have to use this macro in the preamble.

\documentclass{article}
\usepackage{amsthm}
\usepackage[capitalise]{cleveref}

% \crefname{mythm}{Mytheorem}{Mytheorems}
\Crefname{mythm}{Mytheorem}{Mytheorems}
\newtheorem{mythm}{Mytheorem}

\begin{document}
\begin{mythm}\label{m}
foo
\end{mythm}
That was a \lcnamecref{m}.
\end{document}

enter image description here

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.