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