<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<blockquote type="cite">
  <pre>On Thu, Sep 24, 2009 at 4:21 PM, Neal Delmonico
&lt;<a href="http://tug.org/mailman/listinfo/xetex">ndelmonico at sbcglobal.net</a>&gt; wrote:
&gt;<i> Greetings,
</i>&gt;<i>
</i>&gt;<i> I am new to XeTeX though I have been working with LaTeX using the Devanagari
</i>&gt;<i> and Sanskrit packages for years. Recently I decided to see what Unicode and
</i>&gt;<i> XeTeX is about and after some struggle have managed to set up a document
</i>&gt;<i> using both Devanagari and English that looks great, with one small
</i>&gt;<i> exception, I can't get the j + n combination to work. Since I am used to the
</i>&gt;<i> Velthuis system of typing in Devanagari, I start with the Velthuis system
</i>&gt;<i> and use mapping of the text with velthuis.tec. It works great again with
</i>&gt;<i> this one exception. In the Velthuis system the j~na combo is turned into &#2332;&#2381;&#2334;
</i>&gt;<i> . But now the result is j with halanta, a space, and a dental n. I have
</i>&gt;<i> tried various fonts but always with the same result. Any suggestions?
</i>&gt;<i>
</i>&gt;<i> Here is my preamble:
</i>&gt;<i>
</i>&gt;<i> \documentclass[10pt]{article}
</i>&gt;<i>
</i>&gt;<i> \usepackage{bidi}
</i>&gt;<i>
</i>&gt;<i> \usepackage{polyglossia}
</i>&gt;<i>
</i>&gt;<i> \usepackage{fontspec,xltxtra,xunicode}
</i>&gt;<i>
</i>&gt;<i> \setmainfont[]{Gentium Basic}
</i>&gt;<i>
</i>&gt;<i> \setdefaultlanguage{english}
</i>&gt;<i>
</i>&gt;<i> \setotherlanguage{sanskrit}
</i>&gt;<i>
</i>&gt;<i> \newfontfamily{\dev}[Script=Devanagari,Mapping=velthuis-sanskrit]{Nakula}
</i>&gt;<i>
</i>&gt;<i>
</i>&gt;<i> And here is the input text:
</i>&gt;<i>
</i>&gt;<i>
</i>&gt;<i> {\dev \large
</i>&gt;<i>
</i>&gt;<i> \begin{verse}
</i>&gt;<i>
</i>&gt;<i> anyaabhilaa.sitaa"suunya.m j~naanakarmaadyanaav.rtam|\\
</i>&gt;<i>
</i>&gt;<i> aanukuulyena k.r.s.naanu"siilana.m bhaktiruttamaa||
</i>&gt;<i>
</i>&gt;<i> \end{verse}
</i>&gt;<i>
</i>&gt;<i> \noindent asyaartha.h---anyaabhilaa.saj~naanakarmaadirahitaa
</i>&gt;<i>
</i>&gt;<i> "sriik.r.s.namuddi"syaanukulyena kaaya\-vaa"n\-manobhiryaavatii kriyaa saa
</i>&gt;<i>
</i>&gt;<i> bhakti.h|| 1||
</i>&gt;<i>
</i>&gt;<i> }
</i>
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:
<a
 href="http://www.ctan.org/tex-archive/language/devanagari/velthuis/doc/generic/velthuis/">http://www.ctan.org/tex-archive/language/devanagari/velthuis/doc/generic/velthuis/</a>

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}

anyaabhilaa.sitaa"suunya.m j~naanakarmaadyanaav.rtam|\\

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

\end{verse}

\noindent asyaartha.h---anyaabhilaa.saj~naanakarmaadirahitaa

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

bhakti.h|| 1||

}

  </pre>
</blockquote>
<br>
Thanks.&nbsp; This resolved the problem.&nbsp; I now get that ligature.&nbsp; The
problem for me now is how to get the hyphenation working.&nbsp; I don't
recall whether it was working before making this change, but it
certainly is not now.<br>
<br>
Here is what I have in the preamble:<br>
<br>
\usepackage{polyglossia}
<p style="margin: 0px; text-indent: 0px;">\usepackage{fontspec,xltxtra,xunicode}</p>
<p style="margin: 0px; text-indent: 0px;">\setmainfont[]{Gentium Basic}</p>
<p style="margin: 0px; text-indent: 0px;">\setdefaultlanguage{english}</p>
<p style="margin: 0px; text-indent: 0px;">\setotherlanguage{sanskrit}</p>
<p style="margin: 0px; text-indent: 0px;">\newfontfamily\sanskritfont{Nakula}</p>
<p style="margin: 0px; text-indent: 0px;">\newcommand\dn{\catcode
`\~=12 </p>
<p style="margin: 0px; text-indent: 0px;">
\fontspec[Script=Devanagari,Mapping=velthuis-sanskrit]{Nakula}}</p>
<p style="margin: 0px; text-indent: 0px;"><br>
</p>
I am using TeXworks to generate the pdf.<br>
<br>
Using these settings I get the following error message:<br>
<br>
"("C:\Program Files\MiKTeX
2.8\tex\xelatex\polyglossia\gloss-sanskrit.ldf"
<p style="margin: 0px; text-indent: 0px;">Package polyglossia Warning:
No hyphenation patterns were loaded for `Sanskrit'</p>
<p style="margin: 0px; text-indent: 0px;">(polyglossia) I will use the
patterns loaded for \language=0</p>
<p style="margin: 0px; text-indent: 0px;">(polyglossia) instead on
input line 6."</p>
<p style="margin: 0px; text-indent: 0px;"><br>
</p>
Where am I going astray?<br>
<br>
<blockquote type="cite">
  <pre>The advantage of using xetex is that you can directly input devanagari
text into your document using your system fonts and map this
devanagari input to one of the unicode-compatible fonts such as Nakula
/ Sahadeva / Sanskrit 2003 that you'd like to see in your pdf.
  </pre>
</blockquote>
Any suggestions for a devanagari input method that might be better
(easier) than using the velthuis system?&nbsp; I am working in Vista and
with MiKTeX.&nbsp; <br>
<br>
Thanks.<br>
<br>
Neal<br>
</body>
</html>