[Tex/LaTex] Cleveref, capitalize and plurals

capitalizationcleverefcross-referencingntheorem

I recently thought my problem was solved, but it is more involved. Consider the following example:

\documentclass{article}

\usepackage{ntheorem}
\usepackage[capitalize]{cleveref}

\newtheorem{conjecture}{Conjecture}
\newtheorem{solution}{Solution}

\crefname{conjecture}{conjecture}{conjectures}
\crefname{solution}{solution}{solutions}

\begin{document}

\begin{conjecture} \label{c1} Something happened.
\end{conjecture}

\begin{conjecture} \label{c2} Something else also happened.
\end{conjecture}

\begin{solution} \label{s} A lot of things happened.
\end{solution}

\Cref{c1,c2,s} are both \namecref{s} and \namecref{c1}.

\end{document}

The output is the following:

Conjectures 1 and 2 and solution 1 are both solution and conjecture.

I would want the output to be:

Conjectures 1 and 2 and Solution 1 are both solution and conjecture.

How do I achieve this? In other words, I want everything to be capitalized in a \Cref statement with multiple references. In fact, I would even be happy if I could achieve this with a \cref statement, because I want everything to be capitalized when it has a number, but as illustrated in the example, I do not want \namecref output to be capitalized.


Thoughts

The solution to my previous question was the capitalise option, but this does not work here because it relies on cleveref auto-defining the names from the ntheorem definitions, and if we do this the plural for conjecture is not defined. The cleveref manual states:

Therefore, if the plural form is ever required, cleveref will produce
a "\reference type undefined" warning, and type-set the cross-reference where the
plural form is required as:

?? \ref{label} …

In this case, you will have to provide an explicit \crefname or \Crefname definition yourself, to define the plural form as well as the singular form.

If I do that, the capitalise will not work any more because:

[…] if you explicitly define a \cref variant to not be capitalised, cleveref
will still honour your definition. In other words, you're responsible for defining the capitalisation correctly in your own format definitions.

Maybe what I want is not possible, but it seems odd to me that the capitalise option is so useless.

Best Answer

You can use \lcnamecref:

\documentclass{article}

\usepackage{ntheorem}
\usepackage[capitalize]{cleveref}

\newtheorem{conjecture}{Conjecture}
\newtheorem{solution}{Solution}

\Crefname{conjecture}{Conjecture}{Conjectures}
\Crefname{solution}{Solution}{Solutions}

\begin{document}

\begin{conjecture} \label{c1} Something happened.
\end{conjecture}

\begin{conjecture} \label{c2} Something else also happened.
\end{conjecture}

\begin{solution} \label{s} A lot of things happened.
\end{solution}

\cref{c1,c2,s} are both \lcnamecref{s} and \lcnamecref{c1}.

\end{document}

enter image description here

Related Question