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