]> git.lyx.org Git - lyx.git/blob - lib/layouts/enumitem.module
1b78f936a55beec1fdd41ab1f950d98a851dcb82
[lyx.git] / lib / layouts / enumitem.module
1 #\DeclareLyXModule[enumitem.sty]{Customisable Lists (enumitem)}
2 #DescriptionBegin
3 # Controls the layout of enumerate, itemize, description, and list/labeling.
4 # See section Customized Lists of the User's Guide for a detailed description.
5 #DescriptionEnd
6 #Excludes: paralist
7
8 # Author: Günter Milde <milde@users.berlios.de>
9
10 # 2008-12-04 first published version.
11 # 2009-02-02 use name Labeling for "LyX-List/Labeling" list type,
12 #            copy standard layout verbatim for failsave working with 
13 #            both KOMA and non-KOMA document classes.
14 # 2011-01-12 bugfix: set elabeling label font to \normalfont.
15
16 Format 68
17
18 # The package enumitem provides user control over the layout of the three
19 # basic list environments: enumerate, itemize and description. It supersedes
20 # both enumerate and mdwlist (providing well-structured replacements for all
21 # their funtionality), and in addition provides functions to compute the
22 # layout of labels, and to ‘clone’ the standard environments, to create new
23 # environments with counters of their own.
24 #
25 # - fancy labels and fancy refs,
26 # - leftmargin, labelsep and labelwidth automatically set,
27 # - changes applied globally or only in one of the three
28 #   types or even in a single list (including topsep),
29 # - several description styles (which fix some bad spacing, too),
30 # - starting value and counter resuming,
31 # - trivlists properly formatted,
32 # - control on page breaking
33 #
34 # Styling the basic lists is possible 
35 #
36 # a) generally in the LaTeX preamble and 
37 # b) per environment with optional arguments
38 #
39 # See enumitem.pdf_ for details and examples.
40 #
41 # TODO: since version 2.0, enumitem supports "cloning" of lists.
42 #       Producing a labeling as clone of a description allows
43 #       Preamble-Styling specific to this list type.
44
45 AddToPreamble
46         \newlength{\lyxlabelwidth}      % auxiliary length 
47 EndPreamble
48
49
50 # Customisable Basic Lists
51 # ------------------------
52
53 # With enumitem, the three standard list environments take an optional
54 # argument. See enumitem.pdf for possible values.
55
56 ModifyStyle Itemize
57         Argument 1
58                 LabelString   "Itemize Options"
59                 Tooltip       "Optional arguments for this list (see enumitem manual)"
60         EndArgument
61         Requires enumitem
62 End
63
64 ModifyStyle Enumerate
65         Argument 1
66                 LabelString   "Enumerate Options"
67                 Tooltip       "Optional arguments for this list (see enumitem manual)"
68         EndArgument
69         Requires enumitem
70 End
71
72 ModifyStyle Description
73         Argument 1
74                 LabelString   "Description Options"
75                 Tooltip       "Optional arguments for this list (see enumitem manual)"
76         EndArgument
77         Requires enumitem
78 End
79
80
81 # Customisable LyX List
82 # ---------------------
83
84 Input stdlyxlist.inc
85
86 Style Labeling
87         Category              List
88         LatexName             elabeling
89         # FIXME This should probably be defined using \newlist instead
90         Preamble
91         % labeling-like list based on enumitem's description list with
92         % mandatory second argument (label-pattern):
93                 \newenvironment{elabeling}[2][]%
94                 {\settowidth{\lyxlabelwidth}{#2}
95                         \begin{description}[font=\normalfont,style=sameline,
96                                 leftmargin=\lyxlabelwidth,#1]}
97                 {\end{description}}
98         EndPreamble
99         Requires enumitem
100 End
101
102
103 # List Variants
104 # -------------
105 #
106 # Styles with pre-defined optional arguments for ease of use
107
108 Style Enumerate-Resume
109         CopyStyle             Enumerate
110         Argument 1
111                 LabelString   "Enumerate Options"
112                 Tooltip       "Optional arguments for this list (see enumitem manual)"
113                 PresetArg     "resume"
114         EndArgument
115         ResumeCounter true
116         Requires enumitem
117 End
118
119 # References
120 # ----------
121 #
122 # .. _enumitem.pdf:
123 #    http://dante.ctan.org/CTAN/macros/latex/contrib/enumitem/enumitem.pdf
124