1 # Original Author : Paul Rubin <rubin@msu.edu>
2 # Modified by Richard Kimberly Heck to use enumitem
4 # Definition of case environment as an enumeration
6 # Define Case as an enumeration environment
7 # with its own counters
12 GuiName "Case (Level 1)"
13 PrettyFormat "Case \arabic{casei}"
14 LabelString "Case \arabic{casei}."
17 GuiName "Case (Level 2)"
19 LabelString "Case \roman{caseii}."
20 PrettyFormat "Case \roman{caseii}"
23 GuiName "Case (Level 3)"
25 LabelString "Case \alph{caseiii}."
26 PrettyFormat "Case \alph{caseiii}"
29 GuiName "Case (Level 4)"
31 PrettyFormat "Case \arabic{caseiv}"
32 LabelString "Case \arabic{caseiv}."
38 LatexType Item_Environment
41 LeftMargin "Case ###."
49 AlignPossible Block, Left
60 Argument listpreamble:1
61 LabelString "List preamble"
62 MenuString "List Preamble"
63 Tooltip "LaTeX code to be inserted before the first item"
71 LabelString "Custom Item|s"
72 Tooltip "A customized item string"
76 # It'd be easier to use \setlist[caseenv] here, but that causes problems
77 # if you nest an ordinary list inside a case environment. See discussion
80 \newlist{casenv}{enumerate}{4}
81 \setlist[casenv]{leftmargin=*,align=left,widest={iiii}}
82 \setlist[casenv,1]{label={{\itshape\ \casename} \arabic*.},ref=\arabic*}
83 \setlist[casenv,2]{label={{\itshape\ \casename} \roman*.},ref=\roman*}
84 \setlist[casenv,3]{label={{\itshape\ \casename\ \alph*.}},ref=\alph*}
85 \setlist[casenv,4]{label={{\itshape\ \casename} \arabic*.},ref=\arabic*}
88 \providecommand{\casename}{_(Case)}
91 \addto\captions$$lang{\renewcommand{\casename}{_(Case)}}
95 DocBookAttr role='cases'