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