]> git.lyx.org Git - lyx.git/blobdiff - lib/layouts/stdinsets.inc
Allow listings insets to be edited externally.
[lyx.git] / lib / layouts / stdinsets.inc
index 1062b3485d2ef23a75da53add07cfde609c52816..e4fec966135028f1cdb11a45021dcff242d854b5 100644 (file)
@@ -4,10 +4,17 @@
 #
 # Detailed format description is available in the customization manual
 
-Format 38
+Format 89
 
 Provides stdinsets 1
 
+OutlinerName marginalnote "Marginal notes"
+OutlinerName footnote     "Footnotes"
+OutlinerName note         "Notes"
+OutlinerName branch       "Branches"
+OutlinerName index        "Index Entries" #no AddToToc (built-in)
+OutlinerName listing      "Listings" #no AddToToc (built-in)
+
 InsetLayout Marginal
        LabelString           margin
        LatexType             command
@@ -35,10 +42,15 @@ InsetLayout Marginal
                        font-style: normal;
                }
        EndHTMLStyle
+       AddToToc              marginalnote
+       IsTocCaption          true
+       DocBookTag            para
 End
 
 InsetLayout Foot
        LabelString           foot
+       LatexType             Command
+       LatexName             footnote
        Counter               footnote
        Font
          Size                Small
@@ -74,12 +86,57 @@ InsetLayout Foot
                        padding: 1em;
                }
        EndHTMLStyle
+       AddToToc              footnote
+       IsTocCaption          true
+       DocBookTag            footnote
+       DocBookTagType        inline
+End
+
+InsetLayout Foot:InTitle
+       CopyStyle             Foot
+       LatexName             thanks
+       NeedProtect           true
+       Counter               thanks
+       MultiPar              false
+       HTMLLabel             \fnsymbol{thanks}
+       HTMLInnerTag          span
+       HTMLStyle
+               span.foot_intitle_label {
+                       vertical-align: super;
+                       font-size: smaller;
+                       font-weight: bold;
+                       text-decoration: underline;
+               }
+               span.foot_intitle {
+                       display: inline;
+                       font-size: small;
+                       font-weight: medium;
+                       font-family: serif;
+                       font-variant: normal;
+                       font-style: normal;
+               }
+               span.foot_intitle_inner { display: none; }
+               span.foot_intitle:hover span.foot_intitle_inner {
+                       display: block;
+                       border: 1px double black;
+                       margin: 0em 1em;
+                       padding: 1em;
+               }
+       EndHTMLStyle
 End
 
+InsetLayout Foot:InFloatTable
+       CopyStyle             Foot
+       LatexName             tablefootnote
+       Requires              tablefootnote
+End
+
+
 InsetLayout Note:Comment
        LabelString           Comment
        LatexType             environment
        LatexName             comment
+       Requires              verbatim
        BgColor               commentbg
        LabelFont
          Color               comment
@@ -89,11 +146,14 @@ InsetLayout Note:Comment
        Display               false
        HTMLTag               div
        HTMLIsBlock           true
-  HTMLStyle
-    div.note_comment {
-      display: none;
-    }
-  EndHTMLStyle
+       HTMLStyle
+       div.note_comment {
+               display: none;
+       }
+       EndHTMLStyle
+       AddToToc              note
+       IsTocCaption          true
+       NeedCProtect          true
 End
 
 
@@ -107,8 +167,9 @@ InsetLayout Note:Note
          Size                Small
        EndFont
        MultiPar              true
-       HTMLIsBlock           false
-# FIXME HTML Need CSS
+       # Not output for XHTML
+       AddToToc              note
+       IsTocCaption          true
 End
 
 
@@ -116,6 +177,7 @@ InsetLayout Note:Greyedout
        LabelString           Greyedout
        LatexType             environment
        LatexName             lyxgreyedout
+       Requires              color,lyxgreyedout
        BgColor               greyedoutbg
        Font
          Color               greyedouttext
@@ -136,6 +198,9 @@ InsetLayout Note:Greyedout
                }
        EndHTMLStyle
        HTMLIsBlock           false
+       AddToToc              note
+       IsTocCaption          true
+       NeedCProtect          true
 End
 
 InsetLayout ERT
@@ -158,6 +223,7 @@ InsetLayout ERT
        KeepEmpty             true
        FreeSpacing           true
        ForceLTR              true
+       EditExternal          true
 End
 
 InsetLayout Phantom
@@ -170,7 +236,54 @@ InsetLayout Phantom
        ForcePlain            true
 End
 
-InsetLayout ListOfListings
+InsetLayout IPADeco
+       Decoration            minimalistic
+       Font
+         Color               foreground
+       EndFont
+       MultiPar              false
+       CustomPars            false
+       ForcePlain            true
+End
+
+InsetLayout TOC
+  HTMLTag h2
+  HTMLStyle
+    div.toc {
+      margin: 2em 0em;
+      border-style: solid;
+      border-width: 2px 0px;
+      padding: 1em 0em;
+    }
+    h2.tochead { font-size: x-large; font-weight: bold; }
+    div.lyxtoc-0 {
+      margin: 2em 0em 0em 0em;
+      font-size: xx-large;
+      font-weight: bold;
+    }
+    div.lyxtoc-1 {
+      margin: 1em 0em 0em 0em;
+      font-size: x-large;
+      font-weight: bold;
+    }
+    div.lyxtoc-2 {
+      margin: 0em 0.1em 0em 1em;
+      font-size: large;
+      font-weight: normal;
+    }
+    div.lyxtoc-3 { margin: 0em 0.1em 0em 0.5em; font-size: medium; }
+    div.lyxtoc-4 { margin: 0em 0.1em 0em 0.5em; }
+    div.lyxtoc-5 { margin: 0em 0.1em 0em 0.5em; }
+    div.lyxtoc-6 { margin: 0em 0.1em 0em 0.5em; }
+    a.tocentry {
+      text-decoration: none;
+      color: black;
+    }
+    a.tocentry:visited { color: black; }
+  EndHTMLStyle
+End
+
+InsetLayout TOC:Listings
        # We need the [[List of Listings]] context, since "Listings" is also
        # the name of the inset and translated differently.
        # "Listings[[List of Listings]]" is the name of the "List of listings"
@@ -185,9 +298,41 @@ InsetLayout ListOfListings
        LangPreamble
                \renewcommand{\lstlistlistingname}{_(Listings[[List of Listings]])}
        EndLangPreamble
+       FixedWidthPreambleEncoding true
+  HTMLTag h2
+  HTMLStyle
+    div.lyxtoc-flat {
+      margin: 0em 0em 0em 1em;
+      font-size: large;
+      font-weight: normal;
+    }
+  EndHTMLStyle
+End
+
+InsetLayout TOC:MintedListings
+       # "List of Listings" is the name of the "List of listings"
+       # in minted.sty so it must be used here as well.
+       BabelPreamble
+               \addto\captions$$lang{\renewcommand{\listoflistingscaption}{_(List of Listings)}}
+       EndBabelPreamble
+       # The command does not need to be defined in LangPreamble, since
+       # minted.sty does that already. However it needs to be redefined
+       # in order to be used for non-english single-language documents.
+       LangPreamble
+               \renewcommand{\listoflistingscaption}{_(List of Listings)}
+       EndLangPreamble
+       FixedWidthPreambleEncoding false
+  HTMLTag h2
+  HTMLStyle
+    div.lyxtoc-flat {
+      margin: 0em 0em 0em 1em;
+      font-size: large;
+      font-weight: normal;
+    }
+  EndHTMLStyle
 End
 
-InsetLayout IncludeListings
+InsetLayout Include:Listings
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\lstlistingname}{_(Listing)}}
        EndBabelPreamble
@@ -197,10 +342,11 @@ InsetLayout IncludeListings
        LangPreamble
                \renewcommand{\lstlistingname}{_(Listing)}
        EndLangPreamble
+       FixedWidthPreambleEncoding true
 End
 
 InsetLayout Listings
-       CopyStyle IncludeListings
+       CopyStyle Include:Listings
        LabelString           Listings[[inset]]
        LatexType             none
        Decoration            minimalistic
@@ -219,7 +365,39 @@ InsetLayout Listings
        KeepEmpty             true
        FreeSpacing           true
        ForceLTR              true
+       ForcePlain            true
+       NeedCProtect          true
        RefPrefix             lst
+       EditExternal          true
+       HTMLTag               pre
+       HTMLStyle
+               div.float-listings {
+                       border: 2px solid black;
+                       padding: 1ex;
+                       margin: 1ex;
+               }
+               div.listings-caption {
+                       text-align: center;
+                       border: 2px solid black;
+                       padding: 1ex;
+                       margin: 1ex;
+       }
+       EndHTMLStyle
+       DocBookTag            programlisting
+End
+
+InsetLayout MintedListings
+       CopyStyle Listings
+       BabelPreamble
+               \addto\captions$$lang{\renewcommand{\listingscaption}{_(Listing)}}
+       EndBabelPreamble
+       # The command does not need to be defined in LangPreamble, since
+       # minted.sty does that already. However it needs to be redefined
+       # in order to be used for non-english single-language documents.
+       LangPreamble
+               \renewcommand{\listingscaption}{_(Listing)}
+       EndLangPreamble
+       FixedWidthPreambleEncoding false
 End
 
 InsetLayout Branch
@@ -231,6 +409,8 @@ InsetLayout Branch
        MultiPar              true
        InToc                 true
        HTMLIsBlock           false
+       AddToToc              branch
+       IsTocCaption          true
 End
 
 InsetLayout Index
@@ -247,6 +427,7 @@ InsetLayout Index
        CustomPars            false
        ForcePlain            true
        ContentAsLabel        true
+       PassThruChars         @|!
 End
 
 InsetLayout Box
@@ -255,6 +436,8 @@ InsetLayout Box
          Size                Small
        EndFont
        MultiPar              true
+       DocBookWrapperTag     sidebar
+       DocBookTag            para
 End
 
 InsetLayout Box:Frameless
@@ -262,6 +445,9 @@ InsetLayout Box:Frameless
        HTMLStyle
                div.Frameless { margin: 1em; }
        EndHTMLStyle
+       DocBookWrapperTag     sidebar
+       DocBookTag            para
+       DocBookWrapperAttr    role='frameless'
 End
 
 InsetLayout Box:Shaded
@@ -273,6 +459,9 @@ InsetLayout Box:Shaded
                        padding: 0.5ex;
                }
        EndHTMLStyle
+       DocBookWrapperTag     sidebar
+       DocBookTag            para
+       DocBookWrapperAttr    role='shaded'
 End
 
 InsetLayout Box:Boxed
@@ -283,6 +472,9 @@ InsetLayout Box:Boxed
                        padding: 0.5ex;
                }
        EndHTMLStyle
+       DocBookWrapperTag     sidebar
+       DocBookTag            para
+       DocBookWrapperAttr    role='boxed'
 End
 
 InsetLayout Box:Framed
@@ -293,6 +485,9 @@ InsetLayout Box:Framed
                        padding: 0.5ex;
                }
        EndHTMLStyle
+       DocBookWrapperTag     sidebar
+       DocBookTag            para
+       DocBookWrapperAttr    role='framed'
 End
 
 InsetLayout Box:ovalbox
@@ -303,6 +498,9 @@ InsetLayout Box:ovalbox
                        padding: 0.5ex;
                }
        EndHTMLStyle
+       DocBookWrapperTag     sidebar
+       DocBookTag            para
+       DocBookWrapperAttr    role='ovalbox'
 End
 
 InsetLayout Box:Ovalbox
@@ -313,6 +511,9 @@ InsetLayout Box:Ovalbox
                        padding: 0.5ex;
                }
        EndHTMLStyle
+       DocBookWrapperTag     sidebar
+       DocBookTag            para
+       DocBookWrapperAttr    role='ovalbox-var'
 End
 
 InsetLayout Box:Shadowbox
@@ -320,6 +521,9 @@ InsetLayout Box:Shadowbox
        HTMLStyle
                div.Shadowbox { border: solid gray medium; border-bottom: solid black 1ex; border-right: solid black 1ex; padding: 0.5ex; }
        EndHTMLStyle
+       DocBookWrapperTag     sidebar
+       DocBookTag            para
+       DocBookWrapperAttr    role='shadowbox'
 End
 
 InsetLayout Box:Doublebox
@@ -330,11 +534,15 @@ InsetLayout Box:Doublebox
                        padding: 0.5ex;
                }
        EndHTMLStyle
+       DocBookWrapperTag     sidebar
+       DocBookTag            para
+       DocBookWrapperAttr    role='doublebox'
 End
 
 InsetLayout Float
+       LaTeXType             environment
        LabelFont
-         Color               collapsable
+         Color               collapsible
          Size                Small
        EndFont
        MultiPar              true
@@ -346,9 +554,13 @@ InsetLayout Float
        EndHTMLStyle
 End
 
+#InsetWrap requires these, independently of whether stdfloats.inc is included
+OutlinerName table        "Tables" #no AddToToc (built-in)
+OutlinerName figure       "Figures" #no AddToToc (built-in)
+
 InsetLayout Wrap
        LabelFont
-         Color               collapsable
+         Color               collapsible
          Size                Small
        EndFont
        MultiPar              true
@@ -377,6 +589,7 @@ InsetLayout "Flex:URL"
        PassThru              true
        FreeSpacing           true
        ForceLTR              true
+       NeedCProtect          true
        Font
          Family              Typewriter
          Color               urltext
@@ -387,15 +600,18 @@ InsetLayout "Flex:URL"
          Size                Small
        EndFont
        HTMLIsBlock           false
+       DocBookTag            link
+       DocBookTagType        inline
 End
 
 InsetLayout Argument
-       LabelString           opt
+       LabelString           Argument
        LabelFont
-         Color               collapsable
+         Color               collapsible
          Size                Small
        EndFont
        MultiPar              false
+       ForceLocalFontSwitch  1
 End
 
 InsetLayout Info
@@ -422,6 +638,8 @@ InsetLayout Info:menu
        HTMLStyle
                span.menu { font-family: sans-serif; }
        EndHTMLStyle
+       DocBookTag            guimenu
+       DocBookTagType        inline
 End
 
 InsetLayout Info:shortcut
@@ -439,6 +657,10 @@ InsetLayout Info:shortcut
        HTMLStyle
                span.shortcut { font-family: sans-serif; }
        EndHTMLStyle
+       DocBookWrapperTag     keycombo
+       DocBookWrapperTagType inline
+       DocBookTag            keycap
+       DocBookTagType        inline
 End
 
 InsetLayout Info:shortcuts
@@ -456,9 +678,23 @@ InsetLayout Info:shortcuts
        HTMLStyle
                span.shortcuts { font-family: sans-serif; }
        EndHTMLStyle
-End
-
-InsetLayout Caption
+       DocBookWrapperTag     keycombo
+       DocBookWrapperTagType inline
+       DocBookTag            keycap
+       DocBookTagType        inline
+End
+
+InsetLayout Caption:Standard
+       LabelString          standard
+       LaTeXType            command
+       LatexName            caption
+       NeedProtect          1
+       MultiPar             false
+       Argument 1
+               LabelString   "Short Title|S"
+               Tooltip       "The caption as it appears in the list of figures/tables"
+               InsertCotext  1
+       EndArgument
        HTMLStyle
                div.float-caption {
                        text-align: center;
@@ -467,6 +703,15 @@ InsetLayout Caption
                        margin: 1ex;
                }
        EndHTMLStyle
+       HTMLAttr "class='float-caption float-caption-standard'"
+End
+
+
+InsetLayout Caption:Unnumbered
+       CopyStyle            Caption:Standard
+       LabelString          unlabelled
+       LatexName            caption*
+       ResetArgs            1
 End
 
 
@@ -476,14 +721,59 @@ InsetLayout Preview
        MultiPar              true
 End
 
+
+InsetLayout Script
+       LatexType       command
+       MultiPar        false
+       ForcePlain      1
+       CustomPars      0
+       InToc           1
+       HTMLIsBlock     0
+End
+
+
 InsetLayout Script:superscript
-       MultiPar false
-       HTMLTag sup
-       HTMLIsBlock 0
+       CopyStyle       Script
+       LaTeXName       textsuperscript
+       HTMLTag         sup
 End
 
+
 InsetLayout Script:subscript
-       MultiPar false
-       HTMLTag sub
-       HTMLIsBlock 0
+       CopyStyle       Script
+       Requires        subscript
+       LaTeXName       textsubscript
+       HTMLTag         sub
+End
+
+
+InsetLayout PrintNomencl
+       BabelPreamble
+               \addto\captions$$lang{%
+                       \def\eqdeclaration#1{, _(see equation[[nomencl]])\nobreakspace(#1)}%
+                       \def\pagedeclaration#1{, _(page[[nomencl]])\nobreakspace#1}%
+                       \def\nomname{_(Nomenclature[[output]])}%
+               }
+       EndBabelPreamble
+       # The command is defined for several languages in nomencl.sty. However, we need to define
+       # it anyway for the other, non suppported languages.
+       LangPreamble
+               \def\eqdeclaration#1{, _(see equation[[nomencl]])\nobreakspace(#1)}
+               \def\pagedeclaration#1{, _(page[[nomencl]])\nobreakspace#1}
+               \def\nomname{_(Nomenclature[[output]])}
+       EndLangPreamble
+       HTMLTag h2
+End
+
+InsetLayout Tabular
+       HTMLStyle
+               table {
+                       border-collapse: collapse;
+                       display: inline-block;
+               }
+               td {
+                       border: 1px solid black;
+                       padding: 0.5ex;
+               }
+       EndHTMLStyle
 End