# [XeTeX] Devanagari Ligature Problem

Ravi Parimi rparimi at gmail.com
Fri Sep 25 15:45:12 CEST 2009

On Thu, Sep 24, 2009 at 4:21 PM, Neal Delmonico
<ndelmonico at sbcglobal.net> wrote:
> Greetings,
>
> I am new to XeTeX though I have been working with LaTeX using the Devanagari
> and Sanskrit packages for years. Recently I decided to see what Unicode and
> XeTeX is about and after some struggle have managed to set up a document
> using both Devanagari and English that looks great, with one small
> exception, I can't get the j + n combination to work. Since I am used to the
> Velthuis system of typing in Devanagari, I start with the Velthuis system
> and use mapping of the text with velthuis.tec. It works great again with
> this one exception. In the Velthuis system the j~na combo is turned into ज्ञ
> . But now the result is j with halanta, a space, and a dental n. I have
> tried various fonts but always with the same result. Any suggestions?
>
> Here is my preamble:
>
> \documentclass[10pt]{article}
>
> \usepackage{bidi}
>
> \usepackage{polyglossia}
>
> \usepackage{fontspec,xltxtra,xunicode}
>
> \setmainfont[]{Gentium Basic}
>
> \setdefaultlanguage{english}
>
> \setotherlanguage{sanskrit}
>
> \newfontfamily{\dev}[Script=Devanagari,Mapping=velthuis-sanskrit]{Nakula}
>
>
> And here is the input text:
>
>
> {\dev \large
>
> \begin{verse}
>
>
> aanukuulyena k.r.s.naanu"siilana.m bhaktiruttamaa||
>
> \end{verse}
>
>
> "sriik.r.s.namuddi"syaanukulyena kaaya\-vaa"n\-manobhiryaavatii kriyaa saa
>
> bhakti.h|| 1||
>
> }

I am a newbie to using xetex and have been working on a few devanagari
documents myself. Did you look at the examples (especially
xetex-misspaal.tex) posted here:
http://www.ctan.org/tex-archive/language/devanagari/velthuis/doc/generic/velthuis/

I made the following changes to your doc and can now see the conjunct
consonant j~n as expected:

newcommand\dn{\catcode\~=12
\fontspec[Script=Devanagari,Mapping=velthuis-sanskrit]{Nakula}}

{\dn \large

\begin{verse}

aanukuulyena k.r.s.naanu"siilana.m bhaktiruttamaa||

\end{verse}

"sriik.r.s.namuddi"syaanukulyena kaaya\-vaa"n\-manobhiryaavatii kriyaa saa

bhakti.h|| 1||

}

The advantage of using xetex is that you can directly input devanagari
`