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