]> git.lyx.org Git - lyx.git/blobdiff - lib/layouts/linguistics.module
layout files: add the new AllowedPlacement
[lyx.git] / lib / layouts / linguistics.module
index ce9d6a4311e80f1b821991f0e06912fd9c94d5a6..2d71717aa89ddfc8701c20990b914737e394dc9d 100644 (file)
@@ -1,4 +1,4 @@
-#\DeclareLyXModule[covington.sty]{Linguistics}
+#\DeclareLyXModule[covington.sty,enumitem.sty,forest.sty]{Linguistics}
 #DescriptionBegin
 #Defines some special environments useful for linguistics (numbered examples,
 #glosses, semantic markup, tableau floats).
@@ -7,7 +7,7 @@
 
 # Author: Jürgen Spitzmüller <spitz@lyx.org>
 
-Format 45
+Format 54
 
 # single numbered example with covington.sty
 Style Numbered_Example_(multiline)
@@ -40,13 +40,16 @@ Style Numbered_Examples_(consecutive)
        LatexType             Item_Environment
        LatexName             examples
        LabelString           "Examples:"
+       Argument item:1
+               LabelString   "Custom Numbering|s"
+               Tooltip       "Customize the numeration"
+       EndArgument
 End
 
 
 # multiple numbered example with covington.sty
 Style Subexample
-       CopyStyle             Numbered_Example_(multiline)
-       LatexType             Item_Environment
+       CopyStyle             Numbered_Examples_(consecutive)
        LatexName             subexample
        LabelString           "Subexample:"
        Requires              covington,enumitem
@@ -62,7 +65,6 @@ End
 
 
 # glosse (2 lines) with covington.sty
-# mandatory translation must be entered verbatim!
 InsetLayout Flex:Glosse
        LyXType               custom
        LabelString           Glosse
@@ -75,23 +77,29 @@ InsetLayout Flex:Glosse
        MultiPar              true
        CustomPars            false
        ForcePlain            true
-       PassThru              true
        ParbreakIsNewline     true
        FreeSpacing           true
-       ForceLTR              true
        Requires              covington
        Preamble
+               \def\glosstr{}
                \@ifundefined{linggloss}{%
-               \newenvironment{linggloss}[1]{%
-                       \gll #1}
-               {\glend}}{}
+               \newenvironment{linggloss}[2][]{
+                       \def\glosstr{\glt #1}%
+                       \gll #2}
+               {\glosstr\glend}}{}
        EndPreamble
        InToc                 true
+       ResetsFont            true
+       Argument 1
+               Decoration    conglomerate
+               LabelString   "Translation"
+               MenuString    "Glosse Translation|s"
+               Tooltip       "Add a translation for the glosse"
+       EndArgument
 End
 
 
 # glosse (3 lines) with covington.sty
-# mandatory translation must be entered verbatim!
 InsetLayout Flex:Tri-Glosse
        LyXType               custom
        LabelString           Tri-Glosse
@@ -104,18 +112,45 @@ InsetLayout Flex:Tri-Glosse
        MultiPar              true
        CustomPars            false
        ForcePlain            true
-       PassThru              true
        ParbreakIsNewline     true
        FreeSpacing           true
-       ForceLTR              true
        InToc                 true
        Requires              covington
        Preamble
+               \def\glosstr{}
                \@ifundefined{lingglosss}{%
-               \newenvironment{lingglosss}[1]{%
-                       \glll #1}
-               {\glend}}{}
+               \newenvironment{lingglosss}[2][]{
+                       \def\glosstr{\glt #1}%
+                       \glll #2}
+               {\glosstr\glend}}{}
        EndPreamble
+       ResetsFont            true
+       Argument 1
+               Decoration    conglomerate
+               LabelString   "Translation"
+               MenuString    "Glosse Translation|s"
+               Tooltip       "Add a translation for the glosse"
+       EndArgument
+End
+
+
+# Structure trees via the forest package
+InsetLayout Flex:Structure_Tree
+       LyXType               custom
+       LabelString           Tree
+       LatexType             environment
+       LatexName             forest
+       Decoration            classic
+       LabelFont
+         Size                Small
+       EndFont
+       MultiPar              true
+       CustomPars            false
+       ParbreakIsNewline     true
+       FreeSpacing           true
+       Requires              forest
+       ResetsFont            true
+       PassThruChars         []
 End
 
 
@@ -132,6 +167,7 @@ InsetLayout Flex:Expression
                \newcommand{\lingexpr}[1]{\emph{#1}}
        EndPreamble
        InToc                 true
+       ResetsFont true
 End
 
 
@@ -147,6 +183,7 @@ InsetLayout Flex:Concepts
                \newcommand{\lingconcept}[1]{\textsc{#1}}
        EndPreamble
        InToc                 true
+       ResetsFont true
 End
 
 
@@ -160,6 +197,17 @@ InsetLayout Flex:Meaning
                \newcommand{\lingmeaning}[1]{\enquote*{#1}}
        EndPreamble
        InToc                 true
+       ResetsFont true
+End
+
+
+# A helper to group words in Glosses
+InsetLayout Flex:GroupGlossedWords
+       LyxType               charstyle
+       LabelString           Group
+       LeftDelim             {
+       RightDelim            }
+       ResetsFont            true
 End