X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Flayouts%2Flinguistics.module;h=a3a4002cc286e53ff8bdd61fb1c13ad1488956b2;hb=1a89f89337413adb6188e6265c6e1c49e0969f65;hp=bbca7aa380d6646e6dfe34908eea03e3eac25951;hpb=2bb93b6c549e5a059b5e5cc63c7a25398b1c5d6d;p=lyx.git diff --git a/lib/layouts/linguistics.module b/lib/layouts/linguistics.module index bbca7aa380..a3a4002cc2 100644 --- a/lib/layouts/linguistics.module +++ b/lib/layouts/linguistics.module @@ -1,19 +1,20 @@ -#\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). +#glosses, semantic markup, tableau floats). +#See linguistics.lyx file in examples. #DescriptionEnd # Author: Jürgen Spitzmüller -Format 8 +Format 60 # single numbered example with covington.sty Style Numbered_Example_(multiline) LatexType Environment - LatexName example + LatexName covexample NextNoIndent 1 - LeftMargin XExample: + Margin Dynamic LabelSep xx ParSkip 0.0 ItemSep 0.2 @@ -29,27 +30,41 @@ 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 # multiple numbered examples with covington.sty Style Numbered_Examples_(consecutive) CopyStyle Numbered_Example_(multiline) - Margin Static - LeftMargin XExamples: 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 # multiple numbered example with covington.sty Style Subexample - CopyStyle Numbered_Example_(multiline) - Margin Static - LatexType Item_Environment + CopyStyle Numbered_Examples_(consecutive) LatexName subexample - LeftMargin XSubexample: LabelString "Subexample:" Requires covington,enumitem Preamble @@ -64,8 +79,7 @@ End # glosse (2 lines) with covington.sty -# mandatory translation must be entered verbatim! -InsetLayout Custom:Glosse +InsetLayout Flex:Glosse LyXType custom LabelString Glosse LatexType environment @@ -75,21 +89,32 @@ InsetLayout Custom:Glosse Size Small EndFont MultiPar true - PassThru true + CustomPars false + ForcePlain true + ParbreakIsNewline true FreeSpacing 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 Custom:Tri-Glosse +InsetLayout Flex:Tri-Glosse LyXType custom LabelString Tri-Glosse LatexType environment @@ -99,19 +124,58 @@ InsetLayout Custom:Tri-Glosse Size Small EndFont MultiPar true - PassThru true + CustomPars false + ForcePlain true + ParbreakIsNewline true FreeSpacing 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 [] + Preamble + % Load forest linguistics library, if available + \@ifpackagelater{forest}{2016/02/20}{% + \useforestlibrary*{linguistics} + }{} EndPreamble End -InsetLayout CharStyle:Expression +# Some semantik markup for Semantics +InsetLayout Flex:Expression LyxType charstyle LabelString expr. LatexType command @@ -122,10 +186,12 @@ InsetLayout CharStyle:Expression Preamble \newcommand{\lingexpr}[1]{\emph{#1}} EndPreamble + InToc true + ResetsFont true End -InsetLayout CharStyle:Concepts +InsetLayout Flex:Concepts LyxType charstyle LabelString concept LatexType command @@ -136,16 +202,45 @@ InsetLayout CharStyle:Concepts Preamble \newcommand{\lingconcept}[1]{\textsc{#1}} EndPreamble + InToc true + ResetsFont true End -InsetLayout CharStyle:Meaning +InsetLayout Flex:Meaning LyxType charstyle LabelString meaning LatexType command LatexName lingmeaning - Requires csquotes + Requires csquotes Preamble \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 + + +# Tableaux for Optimality Theory +Float + Type tableau + GuiName Tableau + Placement tbp + Extension otl + NumberWithin none + Style plain + ListName "List of Tableaux" + IsPredefined false + UsesFloatPkg true +End +