]> git.lyx.org Git - lyx.git/blob - lib/layouts/stdinsets.inc
Simplify preamble code when using listings
[lyx.git] / lib / layouts / stdinsets.inc
1 # Textclass definition file for LaTeX.
2 # Author : Martin vermeer <martin.vermeer@hut.fi>
3 # Inset layouts definition
4 #
5 # Detailed format description is available in the customization manual
6
7 Format 63
8
9 Provides stdinsets 1
10
11 OutlinerName marginalnote "Marginal notes"
12 OutlinerName footnote     "Footnotes"
13 OutlinerName note         "Notes"
14 OutlinerName branch       "Branches"
15 OutlinerName index        "Index Entries" #no AddToToc (built-in)
16 OutlinerName listing      "Listings" #no AddToToc (built-in)
17
18 InsetLayout Marginal
19         LabelString           margin
20         LatexType             command
21         LatexName             marginpar
22         Font
23           Size                Small
24         EndFont
25         LabelFont
26           Color               marginlabel
27           Size                Small
28         EndFont
29         MultiPar              true
30         NeedProtect           true
31         HTMLStyle
32                 div.marginal {
33                         border: 2px solid black;
34                         padding: 1ex;
35                         margin: 1ex;
36                         background-color: #F0F0F0;
37                         float:right;
38                         font-size: small;
39                         font-weight: medium;
40                         font-family: serif;
41                         font-variant: normal;
42                         font-style: normal;
43                 }
44         EndHTMLStyle
45         AddToToc              marginalnote
46         IsTocCaption          true
47 End
48
49 InsetLayout Foot
50         LabelString           foot
51         LatexType             Command
52         LatexName             footnote
53         Counter               footnote
54         Font
55           Size                Small
56         EndFont
57         LabelFont
58           Color               footlabel
59           Size                Small
60         EndFont
61         MultiPar              true
62         RefPrefix             fn
63         HTMLLabel             \arabic{footnote}
64         HTMLInnerTag          div
65         HTMLStyle
66                 span.foot_label {
67                         vertical-align: super;
68                         font-size: smaller;
69                         font-weight: bold;
70                         text-decoration: underline;
71                 }
72                 div.foot {
73                         display: inline;
74                         font-size: small;
75                         font-weight: medium;
76                         font-family: serif;
77                         font-variant: normal;
78                         font-style: normal;
79                 }
80                 div.foot_inner { display: none; }
81                 div.foot:hover div.foot_inner {
82                         display: block;
83                         border: 1px double black;
84                         margin: 0em 1em;
85                         padding: 1em;
86                 }
87         EndHTMLStyle
88         AddToToc              footnote
89         IsTocCaption          true
90 End
91
92 InsetLayout Foot:InTitle
93         CopyStyle             Foot
94         LatexName             thanks
95         NeedProtect           true
96         Counter               thanks
97         MultiPar              false
98         HTMLLabel             \fnsymbol{thanks}
99         HTMLInnerTag          span
100         HTMLStyle
101                 span.foot_intitle_label {
102                         vertical-align: super;
103                         font-size: smaller;
104                         font-weight: bold;
105                         text-decoration: underline;
106                 }
107                 span.foot_intitle {
108                         display: inline;
109                         font-size: small;
110                         font-weight: medium;
111                         font-family: serif;
112                         font-variant: normal;
113                         font-style: normal;
114                 }
115                 span.foot_intitle_inner { display: none; }
116                 span.foot_intitle:hover span.foot_intitle_inner {
117                         display: block;
118                         border: 1px double black;
119                         margin: 0em 1em;
120                         padding: 1em;
121                 }
122         EndHTMLStyle
123 End
124
125 InsetLayout Note:Comment
126         LabelString           Comment
127         LatexType             environment
128         LatexName             comment
129         Requires              verbatim
130         BgColor               commentbg
131         LabelFont
132           Color               comment
133           Size                Small
134         EndFont
135         MultiPar              true
136         Display               false
137         HTMLTag               div
138         HTMLIsBlock           true
139         HTMLStyle
140         div.note_comment {
141                 display: none;
142         }
143         EndHTMLStyle
144         AddToToc              note
145         IsTocCaption          true
146 End
147
148
149 InsetLayout Note:Note
150         LabelString           Note
151         LatexType             command
152         LatexName             note
153         BgColor               notebg
154         LabelFont
155           Color               note
156           Size                Small
157         EndFont
158         MultiPar              true
159         # Not output for XHTML
160         AddToToc              note
161         IsTocCaption          true
162 End
163
164
165 InsetLayout Note:Greyedout
166         LabelString           Greyedout
167         LatexType             environment
168         LatexName             lyxgreyedout
169         Requires              color,lyxgreyedout
170         BgColor               greyedoutbg
171         Font
172           Color               greyedouttext
173         EndFont
174         LabelFont
175           Color               greyedout
176           Size                Small
177         EndFont
178         MultiPar              true
179         Display               false
180         HTMLInnerTag div
181         HTMLStyle
182                 div.note_greyedout {
183                         display: inline;
184                         color: #A0A0A0;
185                         padding-left: 1ex;
186                         padding-right: 1ex;
187                 }
188         EndHTMLStyle
189         HTMLIsBlock           false
190         AddToToc              note
191         IsTocCaption          true
192 End
193
194 InsetLayout ERT
195         LabelString           ERT
196         LatexType             none
197         Decoration            minimalistic
198         Font
199           Color               latex
200           Family              typewriter
201         EndFont
202         LabelFont
203           Color               latex
204           Size                Small
205         EndFont
206         MultiPar              true
207         CustomPars            false
208         ForcePlain            true
209         PassThru              true
210         ParbreakIsNewline     true
211         KeepEmpty             true
212         FreeSpacing           true
213         ForceLTR              true
214 End
215
216 InsetLayout Phantom
217         Decoration            minimalistic
218         Font
219           Color               phantomtext
220         EndFont
221         MultiPar              false
222         CustomPars            false
223         ForcePlain            true
224 End
225
226 InsetLayout IPADeco
227         Decoration            minimalistic
228         Font
229           Color               foreground
230         EndFont
231         MultiPar              false
232         CustomPars            false
233         ForcePlain            true
234 End
235
236 InsetLayout TOC
237   HTMLTag h2
238   HTMLStyle
239     div.toc {
240       margin: 2em 0em;
241       border-style: solid;
242       border-width: 2px 0px;
243       padding: 1em 0em;
244     }
245     h2.tochead { font-size: x-large; font-weight: bold; }
246     div.lyxtoc-0 {
247       margin: 2em 0em 0em 0em;
248       font-size: xx-large;
249       font-weight: bold;
250     }
251     div.lyxtoc-1 {
252       margin: 1em 0em 0em 0em;
253       font-size: x-large;
254       font-weight: bold;
255     }
256     div.lyxtoc-2 {
257       margin: 0em 0.1em 0em 1em;
258       font-size: large;
259       font-weight: normal;
260     }
261     div.lyxtoc-3 { margin: 0em 0.1em 0em 0.5em; font-size: medium; }
262     div.lyxtoc-4 { margin: 0em 0.1em 0em 0.5em; }
263     div.lyxtoc-5 { margin: 0em 0.1em 0em 0.5em; }
264     div.lyxtoc-6 { margin: 0em 0.1em 0em 0.5em; }
265     a.tocentry {
266       text-decoration: none;
267       color: black;
268     }
269     a.tocentry:visited { color: black; }
270   EndHTMLStyle
271 End
272
273 InsetLayout TOC:Listings
274         # We need the [[List of Listings]] context, since "Listings" is also
275         # the name of the inset and translated differently.
276         # "Listings[[List of Listings]]" is the name of the "List of listings"
277         # ("Listings" is the predefined english name) in listings.sty, so it
278         # must be used here as well.
279         BabelPreamble
280                 \addto\captions$$lang{\renewcommand{\lstlistlistingname}{_(Listings[[List of Listings]])}}
281         EndBabelPreamble
282         # The command does not need to be defined in LangPreamble, since
283         # listings.sty does that already. However it needs to be redefined
284         # in order to be used for non-english single-language documents.
285         LangPreamble
286                 \renewcommand{\lstlistlistingname}{_(Listings[[List of Listings]])}
287         EndLangPreamble
288         FixedWidthPreambleEncoding true
289   HTMLTag h2
290   HTMLStyle
291     div.lyxtoc-flat {
292       margin: 0em 0em 0em 1em;
293       font-size: large;
294       font-weight: normal;
295     }
296   EndHTMLStyle
297 End
298
299 InsetLayout TOC:MintedListings
300         # We need the [[List of Listings]] context, since "Listings" is also
301         # the name of the inset and translated differently.
302         # "Listings[[List of Listings]]" is the name of the "List of listings"
303         # ("Listings" is the predefined english name) in minted.sty so it
304         # must be used here as well.
305         BabelPreamble
306                 \addto\captions$$lang{\renewcommand{\listoflistingscaption}{_(Listings[[List of Listings]])}}
307         EndBabelPreamble
308         # The command does not need to be defined in LangPreamble, since
309         # minted.sty does that already. However it needs to be redefined
310         # in order to be used for non-english single-language documents.
311         LangPreamble
312                 \renewcommand{\listoflistingscaption}{_(Listings[[List of Listings]])}
313         EndLangPreamble
314         FixedWidthPreambleEncoding true
315   HTMLTag h2
316   HTMLStyle
317     div.lyxtoc-flat {
318       margin: 0em 0em 0em 1em;
319       font-size: large;
320       font-weight: normal;
321     }
322   EndHTMLStyle
323 End
324
325 InsetLayout Include:Listings
326         BabelPreamble
327                 \addto\captions$$lang{\renewcommand{\lstlistingname}{_(Listing)}}
328         EndBabelPreamble
329         # The command does not need to be defined in LangPreamble, since
330         # listings.sty does that already. However it needs to be redefined
331         # in order to be used for non-english single-language documents.
332         LangPreamble
333                 \renewcommand{\lstlistingname}{_(Listing)}
334         EndLangPreamble
335         FixedWidthPreambleEncoding true
336 End
337
338 InsetLayout Listings
339         CopyStyle Include:Listings
340         LabelString           Listings[[inset]]
341         LatexType             none
342         Decoration            minimalistic
343         Font
344           Color               foreground
345           Family              typewriter
346         EndFont
347         LabelFont
348           Color               foreground
349           Size                Small
350         EndFont
351         BgColor               listingsbg
352         MultiPar              true
353         PassThru              true
354         ParbreakIsNewline     true
355         KeepEmpty             true
356         FreeSpacing           true
357         ForceLTR              true
358         RefPrefix             lst
359         HTMLTag               pre
360         HTMLStyle
361                 div.float-listings {
362                         border: 2px solid black;
363                         padding: 1ex;
364                         margin: 1ex;
365                 }
366                 div.listings-caption {
367                         text-align: center;
368                         border: 2px solid black;
369                         padding: 1ex;
370                         margin: 1ex;
371         }
372         EndHTMLStyle
373 End
374
375 InsetLayout MintedListings
376         CopyStyle Listings
377         BabelPreamble
378                 \addto\captions$$lang{\renewcommand{\listingscaption}{_(Listing)}}
379         EndBabelPreamble
380         # The command does not need to be defined in LangPreamble, since
381         # minted.sty does that already. However it needs to be redefined
382         # in order to be used for non-english single-language documents.
383         LangPreamble
384                 \renewcommand{\listingscaption}{_(Listing)}
385         EndLangPreamble
386         FixedWidthPreambleEncoding true
387 End
388
389 InsetLayout Branch
390         Decoration            classic
391         LabelFont
392           Color               branchlabel
393           Size                Small
394         EndFont
395         MultiPar              true
396         InToc                 true
397         HTMLIsBlock           false
398         AddToToc              branch
399         IsTocCaption          true
400 End
401
402 InsetLayout Index
403         LabelString           Idx
404         Decoration            classic
405         Font
406           Size                Small
407         EndFont
408         LabelFont
409           Color               indexlabel
410           Size                Small
411         EndFont
412         MultiPar              false
413         CustomPars            false
414         ForcePlain            true
415         ContentAsLabel        true
416         PassThruChars         @|!
417 End
418
419 InsetLayout Box
420         LabelFont
421           Color               foreground
422           Size                Small
423         EndFont
424         MultiPar              true
425 End
426
427 InsetLayout Box:Frameless
428         CopyStyle Box
429         HTMLStyle
430                 div.Frameless { margin: 1em; }
431         EndHTMLStyle
432 End
433
434 InsetLayout Box:Shaded
435         CopyStyle Box
436         BgColor shaded
437         HTMLStyle
438                 div.Shaded {
439                         background-color: gray;
440                         padding: 0.5ex;
441                 }
442         EndHTMLStyle
443 End
444
445 InsetLayout Box:Boxed
446         CopyStyle Box
447         HTMLStyle
448                 div.Boxed {
449                         border: solid thick black;
450                         padding: 0.5ex;
451                 }
452         EndHTMLStyle
453 End
454
455 InsetLayout Box:Framed
456         CopyStyle Box
457         HTMLStyle
458                 div.Framed {
459                         border: solid thick black;
460                         padding: 0.5ex;
461                 }
462         EndHTMLStyle
463 End
464
465 InsetLayout Box:ovalbox
466         CopyStyle Box
467         HTMLStyle
468                 div.ovalbox {
469                         border: groove medium black;
470                         padding: 0.5ex;
471                 }
472         EndHTMLStyle
473 End
474
475 InsetLayout Box:Ovalbox
476         CopyStyle Box
477         HTMLStyle
478                 div.Ovalbox {
479                         border: ridge thick black;
480                         padding: 0.5ex;
481                 }
482         EndHTMLStyle
483 End
484
485 InsetLayout Box:Shadowbox
486         CopyStyle Box
487         HTMLStyle
488                 div.Shadowbox { border: solid gray medium; border-bottom: solid black 1ex; border-right: solid black 1ex; padding: 0.5ex; }
489         EndHTMLStyle
490 End
491
492 InsetLayout Box:Doublebox
493         CopyStyle Box
494         HTMLStyle
495                 div.Doublebox {
496                         border: double thick black;
497                         padding: 0.5ex;
498                 }
499         EndHTMLStyle
500 End
501
502 InsetLayout Float
503         LabelFont
504           Color               collapsable
505           Size                Small
506         EndFont
507         MultiPar              true
508         HTMLStyle
509                 div.float {
510                         border: 2px solid black;
511                         text-align: center;
512                 }
513         EndHTMLStyle
514 End
515
516 #InsetWrap requires these, independently of whether stdfloats.inc is included
517 OutlinerName table        "Tables" #no AddToToc (built-in)
518 OutlinerName figure       "Figures" #no AddToToc (built-in)
519
520 InsetLayout Wrap
521         LabelFont
522           Color               collapsable
523           Size                Small
524         EndFont
525         MultiPar              true
526         RefPrefix             wrap
527         HTMLStyle
528                 div.wrap {
529                         float: right;
530                         border: 2px solid black;
531                         padding: 1ex;
532                         margin: 1ex;
533                 }
534         EndHTMLStyle
535 End
536
537 InsetLayout "Flex:URL"
538         LyXType               standard
539         Decoration            classic
540         LabelString           URL
541         ContentAsLabel        true
542         LatexName             url
543         LatexType             command
544         Requires              url
545         MultiPar              false
546         CustomPars            false
547         ForcePlain            true
548         PassThru              true
549         FreeSpacing           true
550         ForceLTR              true
551         Font
552           Family              Typewriter
553           Color               urltext
554         EndFont
555         LabelFont
556           Family              Typewriter
557           Color               urllabel
558           Size                Small
559         EndFont
560         HTMLIsBlock           false
561 End
562
563 InsetLayout Argument
564         LabelString           Argument
565         LabelFont
566           Color               collapsable
567           Size                Small
568         EndFont
569         MultiPar              false
570         ForceLocalFontSwitch  1
571 End
572
573 InsetLayout Info
574         Decoration            conglomerate
575         HTMLStyle
576                 span.info { font-family: sans-serif; }
577         EndHTMLStyle
578         HTMLTag               span
579         MultiPar              false
580 End
581
582 InsetLayout Info:menu
583         CopyStyle             Info
584         LatexType             command
585         LatexName             menuitem
586         Preamble
587           \providecommand{\menuitem}[1]{\textsf{#1}}
588         EndPreamble
589         Decoration            conglomerate
590         Font
591           Family              sans
592         EndFont
593         HTMLAttr              "class='info menu'"
594         HTMLStyle
595                 span.menu { font-family: sans-serif; }
596         EndHTMLStyle
597 End
598
599 InsetLayout Info:shortcut
600         CopyStyle             Info
601         LatexType             command
602         LatexName             shortcut
603         Preamble
604           \providecommand{\shortcut}[1]{\mbox{\textsf{#1}}}
605         EndPreamble
606         Decoration            conglomerate
607         Font
608           Family              sans
609         EndFont
610         HTMLAttr              "class='info shortcut'"
611         HTMLStyle
612                 span.shortcut { font-family: sans-serif; }
613         EndHTMLStyle
614 End
615
616 InsetLayout Info:shortcuts
617         CopyStyle             Info
618         LatexType             command
619         LatexName             shortcut
620         Preamble
621           \providecommand{\shortcut}[1]{\textsf{#1}}
622         EndPreamble
623         Decoration            conglomerate
624         Font
625           Family              sans
626         EndFont
627         HTMLAttr              "class='info shortcut'"
628         HTMLStyle
629                 span.shortcuts { font-family: sans-serif; }
630         EndHTMLStyle
631 End
632
633 InsetLayout Caption:Standard
634         LabelString          standard
635         LaTeXType            command
636         LatexName            caption
637         NeedProtect          1
638         MultiPar             false
639         Argument 1
640                 LabelString   "Short Title|S"
641                 Tooltip       "The caption as it appears in the list of figures/tables"
642                 InsertCotext  1
643         EndArgument
644         HTMLStyle
645                 div.float-caption {
646                         text-align: center;
647                         border: 2px solid black;
648                         padding: 1ex;
649                         margin: 1ex;
650                 }
651         EndHTMLStyle
652         HTMLAttr "class='float-caption float-caption-standard'"
653 End
654
655
656 InsetLayout Caption:Unnumbered
657         CopyStyle            Caption:Standard
658         LabelString          unlabelled
659         LatexName            caption*
660         ResetArgs            1
661 End
662
663
664 InsetLayout Preview
665         LabelString           Preview
666         Decoration            minimalistic
667         MultiPar              true
668 End
669
670
671 InsetLayout Script
672         LatexType       command
673         MultiPar        false
674         ForcePlain      1
675         CustomPars      0
676         InToc           1
677         HTMLIsBlock     0
678 End
679
680
681 InsetLayout Script:superscript
682         CopyStyle       Script
683         LaTeXName       textsuperscript
684         HTMLTag         sup
685 End
686
687
688 InsetLayout Script:subscript
689         CopyStyle       Script
690         Requires        subscript
691         LaTeXName       textsubscript
692         HTMLTag         sub
693 End
694
695
696 InsetLayout PrintNomencl
697   HTMLTag h2
698 End
699
700 InsetLayout Tabular
701         HTMLStyle
702                 table {
703                         border-collapse: collapse;
704                         display: inline-block;
705                 }
706                 td {
707                         border: 1px solid black;
708                         padding: 0.5ex;
709                 }
710         EndHTMLStyle
711 End