[XeTeX] Devanagari Ligature Problem Resolved --- Now Hyphenation

Yves Codet ycodet at club-internet.fr
Thu Oct 1 10:06:50 CEST 2009


Hello.

Le 30 sept. 09 à 21:58, Neal Delmonico a écrit :

> It seems to work, not with MikTeX 2.8 but with TeX Live 2008 which I  
> have installed in the meantime.  How do I handle the ligature  
> problem (\catcode `\~=12) then?

Sorry, I had forgotten about it. You can put that command in your  
preamble so that your test file now looks like this:

%%%%%%%%%%
\documentclass[10pt]{article}
\usepackage{polyglossia}
\usepackage{xltxtra} % this is enough because xltxtra loads fontspec  
and xunicode
\setmainfont{Gentium Basic}
\setdefaultlanguage{english}
\setotherlanguage{sanskrit}
\newfontfamily\sanskritfont[Script=Devanagari,Mapping=velthuis- 
sanskrit]{Nakula}
\newcommand{\dev}[1]{{\begin{sanskrit}\large #1\end{sanskrit}}}
\catcode`\~=12

\begin{document}

\dev{

\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 kaayavaa"nmanobhiryaavatii kriyaa saa
bhakti.h|| 1||

}

\end{document}
%%%%%%%%%%


> Also what does the #1 do and why is there a [1] after the {\dev}.   
> Sorry to be a pest.  I am trying to understand how this works.

[1] means that the new command \dev has one argument, the text that  
you want to typeset in Devanagari. #1 refers to that argument in what  
follows, i.e. the definition of \dev.

Best wishes,

Yves







More information about the XeTeX mailing list