]> git.lyx.org Git - lyx.git/blob - lib/layouts/enumitem.module
enumitem.module: typo
[lyx.git] / lib / layouts / enumitem.module
1 #\DeclareLyXModule[enumitem.sty]{Customizable Lists (enumitem)}
2 #DescriptionBegin
3 # Controls the layout of enumerate, itemize and description
4 # with an optional argument.
5 # See http://mirror.ctan.org/macros/latex/contrib/enumitem/enumitem.pdf
6 #DescriptionEnd
7 # Author: Günter Milde <milde@users.berlios.de>
8
9 # 2008-12-04 first published version
10 # 2009-02-02 use name Labeling for "LyX-List/Labeling" list type,
11 #            copy standard layout verbatim for failsave working with 
12 #            both KOMA and non-KOMA document classes
13 # 2010-11-16 use Require keyword instead of \usepackage in preamble
14 #
15 # The package enumitem provides user control over the layout of the three
16 # basic list environments: enumerate, itemize and description. It supersedes
17 # both enumerate and mdwlist (providing well-structured replacements for all
18 # their funtionality), and in addition provides functions to compute the
19 # layout of labels, and to ‘clone’ the standard environments, to create new
20 # environments with counters of their own.
21 #
22 # - fancy labels and fancy refs,
23 # - leftmargin, labelsep and labelwidth automatically set,
24 # - changes applied globally or only in one of the three
25 #   types or even in a single list (including topsep),
26 # - several description styles (which fix some bad spacing, too),
27 # - starting value and counter resuming,
28 # - trivlists properly formatted,
29 # - control on page breaking
30 #
31 # Styling the basic lists is possible 
32 #
33 # a) generally in the LaTeX preamble and 
34 # b) per environment with optional arguments
35 #
36 # See enumitem.pdf for details and examples.
37 #    http://dante.ctan.org/CTAN/macros/latex/contrib/enumitem/enumitem.pdf
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 Format 30
44
45 AddToPreamble
46         \newlength{\lyxlabelwidth}      % auxiliary length 
47 EndPreamble
48
49 # Customizable Basic Lists
50 # ------------------------
51
52 # With enumitem, the three standard list environments take an optional
53 # argument. See enumitem.pdf_ for possible values.
54
55 Style Itemize
56         OptionalArgs          1
57         Requires        enumitem
58 End
59
60 Style Enumerate
61         OptionalArgs          1
62         Requires        enumitem
63 End
64
65 Style Description
66         OptionalArgs          1
67         Requires        enumitem
68 End
69
70 # Customizable LyX List
71 # ---------------------
72
73 Style Labeling
74         # verbatim insert definition of List environment, 
75         # The KOMA script classes replace List with Labeling, 
76         # this leads to an error with "CopyStyle List"!
77         Category              List
78         Margin                Manual
79         LatexType             List_Environment
80         NextNoindent          1
81         LabelSep              xxx
82         ParSkip               0.4
83         TopSep                0.7
84         BottomSep             0.7
85         ParSep                0.5
86         Align                 Block
87         AlignPossible         Block, Left
88         LabelType             Manual
89         LabelString           "00.00.0000"
90         # en of verbatim copy
91         
92         LatexName             elabeling
93         OptionalArgs          1
94         Requires              enumitem
95         Preamble
96         % labeling-like list based on enumitem's description list with
97         % mandatory second argument (label-pattern):
98         \newenvironment{elabeling}[2][]%
99           {\settowidth{\lyxlabelwidth}{#2}
100            \begin{description}[font=,style=sameline,
101                                leftmargin=\lyxlabelwidth,#1]}
102           {\end{description}}
103         EndPreamble
104 End
105
106
107 # List Variants
108 # -------------
109 #
110 # Styles with pre-defined optional arguments for ease of use
111
112 Style Enumerate-Resume
113         CopyStyle             Enumerate
114         LatexParam            [resume]
115         OptionalArgs          0
116         Requires              enumitem
117         # a blue label to indicate that this is not a WYSIWYG label
118         # because the numbering differs in the output
119         LabelFont
120           Color               blue
121         EndFont
122 End
123