]> git.lyx.org Git - lyx.git/blobdiff - lib/layouts/linguistics.module
Fix grammar
[lyx.git] / lib / layouts / linguistics.module
index d93885abc875cc6e6ea54333d7fca1150b7cd796..33d6c09ed5bc2254dd0fce7dfdfbb14221160eb7 100644 (file)
@@ -1,4 +1,5 @@
-#\DeclareLyXModule[covington.sty,elocalloc.sty,enumitem.sty,forest.sty,pgfopts.sty,trimspaces.sty]{Linguistics}
+#\DeclareLyXModule[covington.sty,enumitem.sty,forest.sty]{Linguistics}
+#\DeclareCategory{Academic Field Specifics}
 #DescriptionBegin
 #Defines some special environments useful for linguistics (numbered examples,
 #glosses, semantic markup, tableau floats).
@@ -7,14 +8,37 @@
 
 # Author: Jürgen Spitzmüller <spitz@lyx.org>
 
-Format 59
+Format 74
+
+Counter example
+       Within               chapter
+       LabelString          "(\arabic{example})"
+End
+
+Counter examplei
+       Within               chapter
+       LabelString          "(\arabic{examplei})"
+End
+
+Counter subexample
+       Within               examplei
+       LabelString          "\theexamplei (\alph{subexample})"
+End
+
+Counter subexamplei
+       Within               examplei
+       LabelString          "\theexamplei (\alph{subexamplei})"
+End
+
+OutlinerName tableau    "Tableaux" #no AddToToc (built-in)
 
 # single numbered example with covington.sty
 Style Numbered_Example_(multiline)
        LatexType             Environment
-       LatexName             example
+       LatexName             covexample
        NextNoIndent          1
-       Margin                Dynamic
+       Margin                First_Dynamic
+       ParIndent             (1)x
        LabelSep              xx
        ParSkip               0.0
        ItemSep               0.2
@@ -24,12 +48,20 @@ Style Numbered_Example_(multiline)
        Align                 Block
        AlignPossible         Block, Left
        LabelType             Static
-       LabelString           "Example:"
+       LabelCounter          "examplei"
        LabelFont
-               Shape         Italic
                Color         Blue
        EndFont
        Requires              covington
+       Preamble
+       % Backwards compatibility with covington < 1.1
+       % This code can be removed eventually
+       \AtBeginDocument{%
+               \@ifundefined{covexample}{%
+                   \newenvironment{covexample}{\begin{example}}{\end{example}}%
+               }{}
+       }
+       EndPreamble
        Category              Linguistics
 End
 
@@ -38,28 +70,58 @@ End
 Style Numbered_Examples_(consecutive)
        CopyStyle             Numbered_Example_(multiline)
        LatexType             Item_Environment
-       LatexName             examples
-       LabelString           "Examples:"
+       LatexName             covexamples
+       LabelType             Enumerate
+       LabelCounter          "example"
+       ResumeCounter         true
+       Argument listpreamble:1
+               LabelString    "List preamble"
+               MenuString     "List Preamble"
+               Tooltip        "LaTeX code to be inserted before the first item"
+               PassThru       1
+               Font
+                       Family typewriter
+                       Color latex
+               EndFont
+       EndArgument
        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
+       \AtBeginDocument{%
+               \@ifundefined{covexamples}{%
+                   \newenvironment{covexamples}{\begin{examples}}{\end{examples}}%
+               }{}
+       }
+       EndPreamble
 End
 
 
-# multiple numbered example with covington.sty
+# multiple numbered examples with covington.sty
 Style Subexample
        CopyStyle             Numbered_Examples_(consecutive)
-       LatexName             subexample
-       LabelString           "Subexample:"
-       Requires              covington,enumitem
+       LatexName             covsubexamples
+       LabelCounter          "subexample"
+       StepMasterCounter     true
+       Requires              covington
        Preamble
-               \newenvironment{subexample}{%
-                       \begin{example}\begin{enumerate}[leftmargin=1.7em]
-                       \renewcommand\theenumi{\alph{enumi}}
-                       \renewcommand\labelenumi{(\theenumi)}
-                       \renewcommand\p@enumi{\theequation\,}}%
-                       {\end{enumerate}\end{example}}
+               % Backwards compatibility with covington < 1.6
+               % This code can be removed eventually
+               \AtBeginDocument{%
+                       \@ifundefined{covsubexamples}{%
+                               \newenvironment{covsubexamples}{%
+                                       \addtolength{\examplenumbersep}{-0.5em}%
+                                       \begin{covexample}%
+                                       \begin{enumerate}
+                                       \renewcommand\theenumi{\alph{enumi}}
+                                       \renewcommand\labelenumi{(\theenumi)}
+                                       \renewcommand\p@enumi{\theequation\,}}%
+                               {\end{enumerate}\end{covexample}}
+                       }{}
+               }
        EndPreamble
 End
 
@@ -151,6 +213,12 @@ InsetLayout Flex:Structure_Tree
        Requires              forest
        ResetsFont            true
        PassThruChars         []
+       Preamble
+       % Load forest linguistics library, if available
+       \@ifpackagelater{forest}{2016/02/20}{%
+       \useforestlibrary*{linguistics}
+       }{}
+       EndPreamble
 End
 
 
@@ -167,7 +235,7 @@ InsetLayout Flex:Expression
                \newcommand{\lingexpr}[1]{\emph{#1}}
        EndPreamble
        InToc                 true
-       ResetsFont true
+       ResetsFont            true
 End
 
 
@@ -183,7 +251,7 @@ InsetLayout Flex:Concepts
                \newcommand{\lingconcept}[1]{\textsc{#1}}
        EndPreamble
        InToc                 true
-       ResetsFont true
+       ResetsFont            true
 End
 
 
@@ -197,7 +265,7 @@ InsetLayout Flex:Meaning
                \newcommand{\lingmeaning}[1]{\enquote*{#1}}
        EndPreamble
        InToc                 true
-       ResetsFont true
+       ResetsFont            true
 End
 
 
@@ -212,6 +280,8 @@ End
 
 
 # Tableaux for Optimality Theory
+OutlinerName tableau        "Tableaux" #no AddToToc
+
 Float
        Type                  tableau
        GuiName               Tableau