I'm trying to typeset a proof of a theorem, and I'd like to produce the following output:

Case 3: my text goes here and it can wrap to
        another line, wherein I have subcases:
        Case 3.a: some text
        Case 3.b: some more text

etc. I'd also like to be say \cref{case3a}, for a label defined just before "some text", and have it produce "Case 3.a".

Initially, I tried using a simple \newenvironment to wrap the enumerate environment, but that causes \cref{case3a} to produce "Item 3.a", and anyway I'd have to work on the numbering of items.

Here's a (nearly) minimal working example that shows the behavior I have, and questions inline what I'd like to achieve:

\usepackage[pass,showframe]{geometry} % For showing the margins
\usepackage{cleveref} % For \cref
\usepackage{calc} % For \widthof
\usepackage{enumitem} % For defining {proofcases} environment
% QUESTION: Is there a better way to integrate cref's capitalization
% with enumitem's case names?
% QUESTION: Is there a better way to hook up the three levels of
% counters to the main one?
This is the start of the document
\item This is case 1.
\item This is case 2.
\item Case 3 has a very long line of text that is certain to wrap
  around to at least the second line, probably the third line too if
  it feels like it, and then has some sub-cases: \begin{proofcases}
  \item\label{case3a} This is case 3.a.  It has a label, to be
    checked later.
  \item This is case 3.b.
  \item Case 3.c will have some subcases:
    \item Case 3.c.i.
    \item Case 3.c.ii.
\item This is case 4.
This is a reference to \cref{case3a}

It gives the results I want (the funny business with margins and label seps is to fine-tune the alignment of the labels, and is not 100% essential to the questions here), but it feels kludgy, because I'm using an @-internal macro of cleveref, and manually managing crefaliases. My question is, is there a way to get this behavior without the peeking under the hood of cleveref? The documentation for enumitem says that it automagically handles this kind of thing for theorem environments, but I didn't quite figure out enough of the implementation details to understand how it did that...

  • Sorry to see the question only now; a minimal example is necessary to understand what's really going on.
    – egreg
    Sep 3, 2011 at 23:32
  • Your example doesn't compile.
    – lockstep
    Sep 4, 2011 at 20:58
  • @lockstep, Fixed. That's a new warning from enumitem, I think, telling me that my new environment was too deeply nested. D'oh! I was trying to point out an error case anyway, but apparently the package was smarter than I was...
    – Ben Lerner
    Sep 4, 2011 at 21:03
  • @egreg, my focus in this question (the "kldugy" bit) was having to specify all three levels of proofcasesi, proofcasesii, proofcasesiii as aliases to proofcases --- it seemed to me at the time that defining \newlist{X} ought to link Xi, Xii, etc and the aliases seemed like I was missing something important in the documentation. It's entirely possible that the answer here is, "that's the best you can do, it's not a kludge", in which case feel free to vote the question closed...
    – Ben Lerner
    Sep 4, 2011 at 21:15

1 Answer 1


I don't think there's much you can do other than what you already do. In cleveref.sty we find something like




(this is the code for English, it's replicated for all other known languages). So basically also cleveref solves the issue in a similar way as you do. The package has many predefined tags, so maybe enumitem's automagic relies on this.

As regards capitalization, probably the package author thought that in a document one already knows whether it's used or not. Thus he didn't provide a user interface, but only one for the package writer.

Probably a package command \Xcrefname to be used as


might help; it would be a matter of saying


in cleveref.sty; this could also shorten the package itself. You could make a feature request to the author.

  • Thanks :) I was hoping there was some such macro already defined that I'd missed (I was focusing on writing my thesis, at least mostly ;-p), but I'm semi-glad to see I didn't miss a trick here. I'll ping the package author to suggest your \Xcrefname approach. I'm going to wait a day before accepting this answer, just in case someone else found something we both missed; otherwise this works for me.
    – Ben Lerner
    Sep 5, 2011 at 1:07

You must log in to answer this question.

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