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