ExPex allows you to stipulate a list of items for a label list, so we can simply define a labeltype
called devanagari
and set it to the list of the corresponding alpha labels. I've used the width parameter from the uppercase alpha labels; this might not be appropriate for the Devanagari labels, so adjust the labelwidth
accordingly.
The labelgen
key can be thought of as a function that provides the mapping between the counter of the subexample to its label. It accepts four values: char
, number
, romannumber
or list
. Using char
will give you the equivalent of \alph
in LaTeX, but because ExPex doesn't implement it using \alph
it won't work with language definitions that redefine \alph
like polyglossia
or babel
. The number
and romannumber
values are self-explanatory. The list
value tells ExPex to consult an ordered list of characters to construct the label. This is the recommended solution for non-Latin alphabets.
ExPex also uses a somewhat idiosyncratic method for specifying the label and reference format. These are the keys labelformat
and fullrefformat
. The labelformat
provides a template for formatting the label, where A
is a stand-in for the label. So using labelformat=A.
says format the label with a period after it. If you wanted the label to be parenthesized, you could specify labelformat=(A)
for example.
The fullrefformat
key specifies how references to the label will appear (using ExPex's builtin \getref
system (which is not the usual LaTeX \label
and \ref
system.)) The fullrefformat
key provides a template for formatting the reference, where X is a stand-in the example number and A is the stand-in for the subexample label. Since the label includes a period (labelformat=A.
) but we typically don't want the reference to the label to include the .
, we specify the fullrefformat
to be XA
.
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{marathi}
\setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{ITF Devanagari}
\usepackage{expex}
\usepackage{etoolbox}
\makeatletter
\makeatother
\definelabeltype{devanagari}
{labelgen=list,labellist={अ, आ, इ, ई, उ, ऊ, ए, ऐ, ओ, औ, अं, अः},
labelformat=A.,fullrefformat=XA,labelalign=left,labelwidth=.92em}
\begin{document}
\lingset{labeltype=devanagari}
\pex
\a\begingl
\gla रामः आम्रफलम् खादति//
\glb राम आंबा खातो//
\glft राम आंबा खातो.//
\endgl
\a\begingl
\gla रामः आम्रफलम् खादति//
\glb राम आंबा खातो//
\glft राम आंबा खातो.//
\endgl
\xe
\end{document}
\char
to format alpha labels. It may not be trivial to make it use regular LaTeX methods.babel
language files provide a way to map\alph
counters to Hindi letters, but as of June 2020, this is not available for Marathi.