]> git.lyx.org Git - lyx.git/blobdiff - lib/layouts/linguistics.module
Remove debugging code.
[lyx.git] / lib / layouts / linguistics.module
index 22da764099d682a88fc48c80f44172cb650874f4..a3a4002cc286e53ff8bdd61fb1c13ad1488956b2 100644 (file)
@@ -7,12 +7,12 @@
 
 # Author: Jürgen Spitzmüller <spitz@lyx.org>
 
-Format 54
+Format 60
 
 # single numbered example with covington.sty
 Style Numbered_Example_(multiline)
        LatexType             Environment
-       LatexName             example
+       LatexName             covexample
        NextNoIndent          1
        Margin                Dynamic
        LabelSep              xx
@@ -30,6 +30,13 @@ Style Numbered_Example_(multiline)
                Color         Blue
        EndFont
        Requires              covington
+       Preamble
+       % Backwards compatibility with covington < 1.1
+       % This code can be removed eventually
+       \@ifundefined{covexample}{%
+           \newenvironment{covexample}{\begin{example}}{\end{example}}%
+       }
+       EndPreamble
        Category              Linguistics
 End
 
@@ -38,12 +45,19 @@ End
 Style Numbered_Examples_(consecutive)
        CopyStyle             Numbered_Example_(multiline)
        LatexType             Item_Environment
-       LatexName             examples
+       LatexName             covexamples
        LabelString           "Examples:"
        Argument item:1
                LabelString   "Custom Numbering|s"
                Tooltip       "Customize the numeration"
        EndArgument
+       Preamble
+       % Backwards compatibility with covington < 1.1
+       % This code can be removed eventually
+       \@ifundefined{covexamples}{%
+           \newenvironment{covexamples}{\begin{examples}}{\end{examples}}%
+       }
+       EndPreamble
 End
 
 
@@ -65,7 +79,6 @@ End
 
 
 # glosse (2 lines) with covington.sty
-# mandatory translation must be entered verbatim!
 InsetLayout Flex:Glosse
        LyXType               custom
        LabelString           Glosse
@@ -78,24 +91,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
+       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
@@ -108,21 +126,28 @@ 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
+       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
@@ -137,9 +162,15 @@ InsetLayout Flex:Structure_Tree
        CustomPars            false
        ParbreakIsNewline     true
        FreeSpacing           true
-       Requires              forest
+       Requires              forest
        ResetsFont            true
-        PassThruChars         []
+       PassThruChars         []
+       Preamble
+       % Load forest linguistics library, if available
+       \@ifpackagelater{forest}{2016/02/20}{%
+       \useforestlibrary*{linguistics}
+       }{}
+       EndPreamble
 End
 
 
@@ -156,7 +187,7 @@ InsetLayout Flex:Expression
                \newcommand{\lingexpr}[1]{\emph{#1}}
        EndPreamble
        InToc                 true
-       ResetsFont true
+       ResetsFont            true
 End
 
 
@@ -172,7 +203,7 @@ InsetLayout Flex:Concepts
                \newcommand{\lingconcept}[1]{\textsc{#1}}
        EndPreamble
        InToc                 true
-       ResetsFont true
+       ResetsFont            true
 End
 
 
@@ -186,7 +217,17 @@ InsetLayout Flex:Meaning
                \newcommand{\lingmeaning}[1]{\enquote*{#1}}
        EndPreamble
        InToc                 true
-       ResetsFont true
+       ResetsFont            true
+End
+
+
+# A helper to group words in Glosses
+InsetLayout Flex:GroupGlossedWords
+       LyxType               charstyle
+       LabelString           Group
+       LeftDelim             {
+       RightDelim            }
+       ResetsFont            true
 End