-#\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).
# Author: Jürgen Spitzmüller <spitz@lyx.org>
-Format 33
+Format 68
+
+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
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
+ \@ifundefined{covexample}{%
+ \newenvironment{covexample}{\begin{example}}{\end{example}}%
+ }{}
+ EndPreamble
+ Category Linguistics
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 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)
- LatexType Item_Environment
+ CopyStyle Numbered_Examples_(consecutive)
LatexName subexample
- LabelString "Subexample:"
+ LabelCounter "subexample"
+ StepMasterCounter true
Requires covington,enumitem
Preamble
\newenvironment{subexample}{%
# glosse (2 lines) with covington.sty
-# mandatory translation must be entered verbatim!
InsetLayout Flex:Glosse
LyXType custom
LabelString 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
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 []
+ Preamble
+ % Load forest linguistics library, if available
+ \@ifpackagelater{forest}{2016/02/20}{%
+ \useforestlibrary*{linguistics}
+ }{}
EndPreamble
End
\newcommand{\lingexpr}[1]{\emph{#1}}
EndPreamble
InToc true
+ ResetsFont true
End
\newcommand{\lingconcept}[1]{\textsc{#1}}
EndPreamble
InToc true
+ ResetsFont true
End
\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
+OutlinerName tableau "Tableaux" #no AddToToc
+
Float
Type tableau
GuiName Tableau