]> git.lyx.org Git - lyx.git/blob - lib/layouts/linguistics.module
Merge branch '2.2.x' into 2.2.2-staging
[lyx.git] / lib / layouts / linguistics.module
1 #\DeclareLyXModule[covington.sty,elocalloc.sty,enumitem.sty,forest.sty,pgfopts.sty,trimspaces.sty]{Linguistics}
2 #DescriptionBegin
3 #Defines some special environments useful for linguistics (numbered examples,
4 #glosses, semantic markup, tableau floats).
5 #See linguistics.lyx file in examples.
6 #DescriptionEnd
7
8 # Author: Jürgen Spitzmüller <spitz@lyx.org>
9
10 Format 60
11
12 # single numbered example with covington.sty
13 Style Numbered_Example_(multiline)
14         LatexType             Environment
15         LatexName             covexample
16         NextNoIndent          1
17         Margin                Dynamic
18         LabelSep              xx
19         ParSkip               0.0
20         ItemSep               0.2
21         TopSep                0.7
22         BottomSep             0.7
23         ParSep                0.3
24         Align                 Block
25         AlignPossible         Block, Left
26         LabelType             Static
27         LabelString           "Example:"
28         LabelFont
29                 Shape         Italic
30                 Color         Blue
31         EndFont
32         Requires              covington
33         Preamble
34         % Backwards compatibility with covington < 1.1
35         % This code can be removed eventually
36         \@ifundefined{covexample}{%
37             \newenvironment{covexample}{\begin{example}}{\end{example}}%
38         }
39         EndPreamble
40         Category              Linguistics
41 End
42
43
44 # multiple numbered examples with covington.sty
45 Style Numbered_Examples_(consecutive)
46         CopyStyle             Numbered_Example_(multiline)
47         LatexType             Item_Environment
48         LatexName             covexamples
49         LabelString           "Examples:"
50         Argument item:1
51                 LabelString   "Custom Numbering|s"
52                 Tooltip       "Customize the numeration"
53         EndArgument
54         Preamble
55         % Backwards compatibility with covington < 1.1
56         % This code can be removed eventually
57         \@ifundefined{covexamples}{%
58             \newenvironment{covexamples}{\begin{examples}}{\end{examples}}%
59         }
60         EndPreamble
61 End
62
63
64 # multiple numbered example with covington.sty
65 Style Subexample
66         CopyStyle             Numbered_Examples_(consecutive)
67         LatexName             subexample
68         LabelString           "Subexample:"
69         Requires              covington,enumitem
70         Preamble
71                 \newenvironment{subexample}{%
72                         \begin{example}\begin{enumerate}[leftmargin=1.7em]
73                         \renewcommand\theenumi{\alph{enumi}}
74                         \renewcommand\labelenumi{(\theenumi)}
75                         \renewcommand\p@enumi{\theequation\,}}%
76                         {\end{enumerate}\end{example}}
77         EndPreamble
78 End
79
80
81 # glosse (2 lines) with covington.sty
82 InsetLayout Flex:Glosse
83         LyXType               custom
84         LabelString           Glosse
85         LatexType             environment
86         LatexName             linggloss
87         Decoration            minimalistic
88         LabelFont
89           Size                Small
90         EndFont
91         MultiPar              true
92         CustomPars            false
93         ForcePlain            true
94         ParbreakIsNewline     true
95         FreeSpacing           true
96         Requires              covington
97         Preamble
98                 \def\glosstr{}
99                 \@ifundefined{linggloss}{%
100                 \newenvironment{linggloss}[2][]{
101                         \def\glosstr{\glt #1}%
102                         \gll #2}
103                 {\glosstr\glend}}{}
104         EndPreamble
105         InToc                 true
106         ResetsFont            true
107         Argument 1
108                 Decoration    conglomerate
109                 LabelString   "Translation"
110                 MenuString    "Glosse Translation|s"
111                 Tooltip       "Add a translation for the glosse"
112         EndArgument
113 End
114
115
116 # glosse (3 lines) with covington.sty
117 InsetLayout Flex:Tri-Glosse
118         LyXType               custom
119         LabelString           Tri-Glosse
120         LatexType             environment
121         LatexName             lingglosss
122         Decoration            minimalistic
123         LabelFont
124           Size                Small
125         EndFont
126         MultiPar              true
127         CustomPars            false
128         ForcePlain            true
129         ParbreakIsNewline     true
130         FreeSpacing           true
131         InToc                 true
132         Requires              covington
133         Preamble
134                 \def\glosstr{}
135                 \@ifundefined{lingglosss}{%
136                 \newenvironment{lingglosss}[2][]{
137                         \def\glosstr{\glt #1}%
138                         \glll #2}
139                 {\glosstr\glend}}{}
140         EndPreamble
141         ResetsFont            true
142         Argument 1
143                 Decoration    conglomerate
144                 LabelString   "Translation"
145                 MenuString    "Glosse Translation|s"
146                 Tooltip       "Add a translation for the glosse"
147         EndArgument
148 End
149
150
151 # Structure trees via the forest package
152 InsetLayout Flex:Structure_Tree
153         LyXType               custom
154         LabelString           Tree
155         LatexType             environment
156         LatexName             forest
157         Decoration            classic
158         LabelFont
159           Size                Small
160         EndFont
161         MultiPar              true
162         CustomPars            false
163         ParbreakIsNewline     true
164         FreeSpacing           true
165         Requires              forest
166         ResetsFont            true
167         PassThruChars         []
168         Preamble
169         % Load forest linguistics library, if available
170         \@ifpackagelater{forest}{2016/02/20}{%
171         \useforestlibrary*{linguistics}
172         }{}
173         EndPreamble
174 End
175
176
177 # Some semantik markup for Semantics
178 InsetLayout Flex:Expression
179         LyxType               charstyle
180         LabelString           expr.
181         LatexType             command
182         LatexName             lingexpr
183         Font
184           Shape               Italic
185         EndFont
186         Preamble
187                 \newcommand{\lingexpr}[1]{\emph{#1}}
188         EndPreamble
189         InToc                 true
190         ResetsFont            true
191 End
192
193
194 InsetLayout Flex:Concepts
195         LyxType               charstyle
196         LabelString           concept
197         LatexType             command
198         LatexName             lingconcept
199         Font
200           Shape               Smallcaps
201         EndFont
202         Preamble
203                 \newcommand{\lingconcept}[1]{\textsc{#1}}
204         EndPreamble
205         InToc                 true
206         ResetsFont            true
207 End
208
209
210 InsetLayout Flex:Meaning
211         LyxType               charstyle
212         LabelString           meaning
213         LatexType             command
214         LatexName             lingmeaning
215         Requires              csquotes
216         Preamble
217                 \newcommand{\lingmeaning}[1]{\enquote*{#1}}
218         EndPreamble
219         InToc                 true
220         ResetsFont            true
221 End
222
223
224 # A helper to group words in Glosses
225 InsetLayout Flex:GroupGlossedWords
226         LyxType               charstyle
227         LabelString           Group
228         LeftDelim             {
229         RightDelim            }
230         ResetsFont            true
231 End
232
233
234 # Tableaux for Optimality Theory
235 Float
236         Type                  tableau
237         GuiName               Tableau
238         Placement             tbp
239         Extension             otl
240         NumberWithin          none
241         Style                 plain
242         ListName              "List of Tableaux"
243         IsPredefined          false
244         UsesFloatPkg          true
245 End
246