]> git.lyx.org Git - lyx.git/blob - lib/layouts/tcolorbox.module
1907cac4b9aae4e7549b6aed26db0c7c1ae5b12d
[lyx.git] / lib / layouts / tcolorbox.module
1 #\DeclareLyXModule[tcolorbox.sty,environ.sty,etoolbox.sty,pgf.sty]{Fancy Colored Boxes}
2 #DescriptionBegin
3 #Adds custom insets that support colored boxes via the tcolorbox package.
4 #See the tcolorbox documentation for details.
5 #DescriptionEnd
6 #Authors: Jürgen Spitzmüller
7 #         Uwe Stöhr <uwestoehr@lyx.org>
8
9 Format 68
10
11 InsetLayout Flex:Color_Box
12   LyXType               custom
13   Decoration            classic
14   LabelString           "Color Box"
15   LatexType             environment
16   LatexName             tcolorbox
17   Requires              tcolorbox
18   Argument 1
19     LabelString         "Color Box Options"
20     Tooltip             "Insert the color box options here (see tcolorbox manual)"
21     PassThruChars       "\[]{}"
22   EndArgument
23   ResetsFont            true
24 End
25
26 InsetLayout Flex:Dynamic_Color_Box
27   CopyStyle             Flex:Color_Box
28   LatexType             command
29   LabelString           "Color Box (Dynamic)"
30   LatexName             tcbox
31 End
32
33 InsetLayout Flex:Fit_Color_Box
34   CopyStyle             Flex:Dynamic_Color_Box
35   LabelString           "Color Box (Fit Contents)"
36   LatexName             tcboxfit
37 End
38
39 InsetLayout Flex:Raster_Color_Box
40   CopyStyle             Flex:Color_Box
41   LabelString           "Raster Color Box"
42   LatexName             tcbraster
43 End
44
45 InsetLayout Flex:Subtitle
46   CopyStyle            Flex:Dynamic_Color_Box
47   LatexName            tcbsubtitle
48   LabelString          "Subtitle"
49   Argument 1
50     LabelString        "Subtitle Options"
51     ToolTip            "Insert the options here"
52     PassThruChars      "\[]{}"
53   EndArgument
54 End
55
56 Style Color_Box_Separator
57   Category         "Color Boxes"
58   LatexType        command
59   LatexName        tcblower
60   ParIndent        MM
61   ParSkip          0.4
62   Align            Left
63   AlignPossible    Block, Left, Right, Center
64   Margin           First_Dynamic
65   TopSep           0
66   BottomSep        0
67   ParSep           0
68   LabelType        Static
69   LabelBottomSep   0
70   LabelString      "-----"
71   KeepEmpty        1
72   LabelFont 
73     Series         medium
74     Size           normal
75     Color          latex
76     Series         bold
77   EndFont
78   Requires         tcolorbox
79 End
80
81 Style Color_Box_Line
82   CopyStyle        Color_Box_Separator
83   LatexName        tcbline
84   LabelFont 
85     Color          blue
86   EndFont
87   Requires         tcolorbox
88 End
89
90 Style Color_Box_Setup
91   Category         "Color Boxes"
92   LatexName        tcbset
93   LatexType        command
94   PassThru         1
95   Margin           Dynamic
96   LabelSep         xx
97   ParSkip          0.0
98   ItemSep          0.2
99   TopSep           0.7
100   BottomSep        0.7
101   ParSep           0.3
102   Align            Block
103   AlignPossible    Block
104   LabelType        Static
105   LabelString      "Color Box Setup"
106   Font
107     Color          latex
108     Family         typewriter
109   EndFont
110   LabelFont
111     Color          green
112     Family         roman
113   EndFont
114   Requires         tcolorbox
115   Spellcheck       0
116 End
117
118 Style New_Color_Box_Type
119   CopyStyle            Color_Box_Setup
120   LatexName        newtcolorbox
121   LabelString      "New Color Box Type"
122   Font
123     Family         roman
124   EndFont
125   LabelFont
126     Color          green
127   EndFont
128   Argument 1
129     LabelString    "New Box Options"
130     Tooltip        "Options for the new box type (optional)"
131     PassThruChars  "\[]{}"
132   EndArgument
133   Argument 2
134     LabelString    "Name"
135     Tooltip        "Name of the new box type"
136     Mandatory      1
137     AutoInsert     1
138   EndArgument
139   Argument 3
140     LabelString    "Arguments"
141     Tooltip        "Number of arguments (remove this inset if none!)"
142     Requires       4
143     PassThru       1
144   EndArgument
145   Argument 4
146     LabelString    "Default Value"
147     Tooltip        "Default value for argument (keep empty!)"
148     Requires       3
149   EndArgument
150 End
151
152 # define 5 different box environments that can be customized by the user
153
154 InsetLayout Flex:Custom_Color_Box_1
155   CopyStyle        Flex:Color_Box
156   LabelString      "Custom Color Box 1"
157   LatexName        cBoxA
158   Argument 2
159     LabelString    "More Color Box Options"
160     Tooltip        "Insert more color box options here"
161     Mandatory      1
162   EndArgument
163 End
164
165 InsetLayout Flex:Custom_Color_Box_2
166   CopyStyle        Flex:Custom_Color_Box_1
167   LabelString      "Custom Color Box 2"
168   LatexName        cBoxB
169 End
170
171 InsetLayout Flex:Custom_Color_Box_3
172   CopyStyle        Flex:Custom_Color_Box_1
173   LabelString      "Custom Color Box 3"
174   LatexName        cBoxC
175 End
176
177 InsetLayout Flex:Custom_Color_Box_4
178   CopyStyle        Flex:Custom_Color_Box_1
179   LabelString      "Custom Color Box 4"
180   LatexName        cBoxD
181 End
182
183 InsetLayout Flex:Custom_Color_Box_5
184   CopyStyle        Flex:Custom_Color_Box_1
185   LabelString      "Custom Color Box 5"
186   LatexName        cBoxE
187 End