-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.tex
More file actions
336 lines (283 loc) · 8.32 KB
/
example.tex
File metadata and controls
336 lines (283 loc) · 8.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
% Options for packages loaded elsewhere
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
%
\documentclass[
letterpaper,
DIV=11,
numbers=noendperiod]{scrartcl}
\usepackage{xcolor}
\usepackage{amsmath,amssymb}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\usepackage{iftex}
\ifPDFTeX
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math} % this also loads fontspec
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
\usepackage{lmodern}
\ifPDFTeX\else
% xetex/luatex font selection
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
% Make \paragraph and \subparagraph free-standing
\makeatletter
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}{
\@ifstar
\xxxParagraphStar
\xxxParagraphNoStar
}
\newcommand{\xxxParagraphStar}[1]{\oldparagraph*{#1}\mbox{}}
\newcommand{\xxxParagraphNoStar}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}{
\@ifstar
\xxxSubParagraphStar
\xxxSubParagraphNoStar
}
\newcommand{\xxxSubParagraphStar}[1]{\oldsubparagraph*{#1}\mbox{}}
\newcommand{\xxxSubParagraphNoStar}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
\makeatother
\usepackage{longtable,booktabs,array}
\usepackage{calc} % for calculating minipage widths
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx}
\makeatletter
\newsavebox\pandoc@box
\newcommand*\pandocbounded[1]{% scales image to fit in text height/width
\sbox\pandoc@box{#1}%
\Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
\Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
\ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
\ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
\else\usebox{\pandoc@box}%
\fi%
}
% Set default figure placement to htbp
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\KOMAoption{captions}{tableheading}
% Fix compatibility with unicode-math (https://github.com/wspr/unicode-math/issues/379#issuecomment-276079476)
\usepackage{expex}
\let\expexgla\gla
\AtBeginDocument{%
\let\umgla\gla
\let\gla\expexgla
}
\makeatletter
\@ifpackageloaded{caption}{}{\usepackage{caption}}
\AtBeginDocument{%
\ifdefined\contentsname
\renewcommand*\contentsname{Table of contents}
\else
\newcommand\contentsname{Table of contents}
\fi
\ifdefined\listfigurename
\renewcommand*\listfigurename{List of Figures}
\else
\newcommand\listfigurename{List of Figures}
\fi
\ifdefined\listtablename
\renewcommand*\listtablename{List of Tables}
\else
\newcommand\listtablename{List of Tables}
\fi
\ifdefined\figurename
\renewcommand*\figurename{Figure}
\else
\newcommand\figurename{Figure}
\fi
\ifdefined\tablename
\renewcommand*\tablename{Table}
\else
\newcommand\tablename{Table}
\fi
}
\@ifpackageloaded{float}{}{\usepackage{float}}
\floatstyle{ruled}
\@ifundefined{c@chapter}{\newfloat{codelisting}{h}{lop}}{\newfloat{codelisting}{h}{lop}[chapter]}
\floatname{codelisting}{Listing}
\newcommand*\listoflistings{\listof{codelisting}{List of Listings}}
\makeatother
\makeatletter
\makeatother
\makeatletter
\@ifpackageloaded{caption}{}{\usepackage{caption}}
\@ifpackageloaded{subcaption}{}{\usepackage{subcaption}}
\makeatother
\usepackage{bookmark}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same}
\hypersetup{
pdftitle={interlinear examples},
colorlinks=true,
linkcolor={blue},
filecolor={Maroon},
citecolor={Blue},
urlcolor={Blue},
pdfcreator={LaTeX via pandoc}}
\title{\texttt{interlinear} examples}
\author{}
\date{}
\begin{document}
\maketitle
The Quarto filter \texttt{interlinear} enables users to write numbered
linguistic examples. The filter can also render interlinear glosses. A
custom implementation for example numbering has been developed for the
HTML output, while in LaTeX it is handled by expex. Interlinear glossing
is handled by Leipzig.js in HTML and expex in LaTeX.
\subsection{Numbered examples}\label{numbered-examples}
To create a numbered example, use a fenced Div block (\texttt{:::}) with
class \texttt{ex}. For example the following code results in Example
(1).
\begin{verbatim}
::: ex
You do the job. You are not the job.
:::
\end{verbatim}
\pex
You do the job. You are not the job.
\xe
\subsection{Subexamples}\label{subexamples}
You can create subexamples within an \texttt{ex} Div block with a fenced
Div block with class \texttt{exi} (for ``example item'') for each
subexample.
\begin{verbatim}
::: ex
::: exi
A bird sings a beautiful song.
:::
::: exi
A fish swims in the pool.
:::
:::
\end{verbatim}
Which renders as:
\pex
\a A bird sings a beautiful song.
\a A fish swims in the pool.
\xe
\subsection{Interlinear glosses}\label{interlinear-glosses}
To create an interlinear gloss, use a fenced Div block (\texttt{:::})
with class \texttt{gl} (usually, within an \texttt{ex} Div). These are
the current rules:
\begin{itemize}
\tightlist
\item
Each line of the interlinear gloss should start with
\texttt{\textbar{}}.
\item
Interlinear lines that start with \texttt{\textbar{}\ -} are treated
as preambles/original text (i.e.~they are not aligned).
\item
The last interlinear line is treated as the free translation.
\end{itemize}
For example:
\begin{verbatim}
::: ex
::: gl
| - Gila aburun ferma hamišaluǧ güǧüna amuq’dač.
| gila abur-u-n ferma hamišaluǧ güǧüna amuq’-da-č.
| now they-OBL-GEN farm forever behind stay-FUT-NEG
| 'Now their farm will not stay behind forever.'
:::
:::
\end{verbatim}
\phantomsection\label{ex-lez}
\pex
\begingl
\glpreamble Gila aburun ferma hamišaluǧ güǧüna amuq’dač. //
\gla gila abur-u-n ferma hamišaluǧ güǧüna amuq’-da-č. //
\glb now they-OBL-GEN farm forever behind stay-FUT-NEG //
\glft ‘Now their farm will not stay behind forever.’ //
\endgl
\xe
To create a gloss without free translation, add a final empty line
starting with \texttt{\textbar{}\ -} (the following example is also
without the original text line):
\begin{verbatim}
::: ex
::: gl
| el perrito está comiendo
| the {little dog} is eating
| -
:::
:::
\end{verbatim}
Renders as:
\phantomsection\label{ex-sp}
\pex
\begingl
\gla el perrito está comiendo //
\glb the {little dog} is eating //
\endgl
\xe
You can include interlinear glosses in subexamples and mix glosses with
simple sentences. Note that more than three colons \texttt{:} can be
used for fenced Div blocks to show the different levels of embedding
within the \texttt{ex} Div (this is entirely optional).
\begin{verbatim}
::::: ex
::: exi
Abandon all hope, ye who enter.
:::
::: exi
The Self, smaller than small, greater than great, is hidden in the heart of every creature.
:::
:::: exi
::: gl
| n=an apedani mehuni essandu
| CONN=him that.DAT.SG time.DAT.SG eat.they.shall
| 'They shall celebrate him on that date.'
:::
::::
:::::
\end{verbatim}
Rendered as:
\pex
\a Abandon all hope, ye who enter.
\a The Self, smaller than small, greater than great, is hidden in the
heart of every creature.
\a \begingl
\gla n=an apedani mehuni essandu //
\glb CONN=him that.DAT.SG time.DAT.SG eat.they.shall //
\glft ‘They shall celebrate him on that date.’ //
\endgl
\xe
\end{document}