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