Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How do I produce the vedic, anudatta and udatta via XeTeX. The one in this links gives

http://mirrors.ctan.org/language/devanagari/velthuis/doc/generic/velthuis/xetex-examples.tex

The normal Sanskrit compilation works but the vedic accents if compiled with similar commands doesn't work.

  • Does anyone how we can work with XeTeX for typesetting Vedic Mantras or Texts.
\documentclass[12pt]{article}
\usepackage{ifxetex}
\RequireXeTeX
\usepackage{fontspec}
\newcommand\dn{\catcode`\~=12
           \fontspec[Script=Devanagari,Mapping=velthuis-sanskrit]{Nakula}}

\let\origlabelitemi\labelitemi
\renewcommand\labelitemi{{\normalfont\origlabelitemi}}

\parindent=0pt

\begin{document}

\section{Examples}

{\dn
\begin{center}
\setlength{\fboxrule}{2pt}
\framebox[3.2cm][s]{.o ga.ne"saaya nama.h}
\end{center}
}
\end{document}

The above command works perfectly for non-vedic sanskrit, but once I start using udatta and anudatta it doesn't work at all.

Commands like this:

  • \dn\dnveda _{a} which work well in devanagari doesn't seem to work here.
share|improve this question
    
Can you post a small example document of what works and what doesn't work for you. See I've just been told I have to write a minimal example, what is that?. –  Alan Munn May 20 '12 at 17:00
    
@AlanMunn: See the one which I gave in the example has no vedic Macros, so it works for me as well. But the moment i switch to typeset Vedic Macros it doesn't work. –  S.C. May 21 '12 at 5:21
1  
With XeLaTeX you're allowed to type directly in the Devanagari script. –  egreg May 23 '12 at 15:50
    
@egreg: Sorry i dont understand what exactly you mean –  S.C. May 23 '12 at 15:54
    
@egreg: with XeLaTex i have to first save a file as test.dn and then do xelatex test.dn to get a output as test.tex and then compile test.tex. The thing is i want to change the devanagari font. –  S.C. May 23 '12 at 15:55

2 Answers 2

I don't know anything of Devanagari and Sanskrit; but here's an example that I obtained first by compiling without the second line, then copying from the PDF and pasting.

% Requires font Nakula by John Smith,
% see http://bombay.indology.info/software/fonts/devanagari/index.html
\documentclass[12pt]{article}
\usepackage{ifxetex}
\RequireXeTeX
\usepackage{fontspec}
\newfontfamily{\sanskritfont}[Script=Devanagari,Mapping=velthuis-sanskrit]{Nakula}
\newcommand\dn{\catcode`\~=12 \sanskritfont}

\newfontfamily{\directsanskrit}[Script=Devanagari]{Nakula}

\begin{document}

{\dn .o ga.ne"saaya nama.h}

{\directsanskrit ॐ गणेशाय नमः}

\end{document}

enter image description here

As far as I can see, the two lines are identical.

The lines

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

have the same effect as your

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

but use XeTeX more efficiently.

share|improve this answer
    
I told u this is working. type the vedic accents and see. –  S.C. May 23 '12 at 16:20
    
just see if this commands are working. {\dn\dnveda tat \|{sa}_{vi}tur-vare.nya.m |}. For me these dont work –  S.C. May 23 '12 at 16:21
    
@Chandrasekhar This kind of input is not for use with XeLaTeX. As I said, I don't know anything about vedic accents. –  egreg May 23 '12 at 16:26
    
egreg - I am attaching an image to explain the Vedic accents I hope this would help to address the issue. i.stack.imgur.com/jqZKm.jpg –  Aku May 24 '12 at 15:03
    
@Aku If I input this स॒व॑ितुर (using the Devanagari MT font) I get the two accents. I don't know if this means anything (I hope nothing bad, at least). –  egreg May 24 '12 at 15:14

Note: I don’t know Hindi nor can I read this.

If I input the text as plain Unicode, I always get the vedic accent marks. The following code gives me something which has the accents, as far as I can see.

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass[12pt]{article}

\usepackage{fontspec,xltxtra,xunicode}
\setmainfont[Script=Devanagari,Mapping=velthuis-sanskrit]{Nakula}

\begin{document}

दि॒पदे॑ । शं चतु॑षपदे

\end{document}

Vedic intonation marks with Unicode input

If you want to change the Devanagari font, just exchange the Nakula option. Arial Unicode MS and Code2000 had seemnigly correct outputs (although with Code2000 the accents overlapped the vowel marks). Devanagari MT, however, did not work correctly for me.

You can find the vedic accents under:

  • U+0951 DEVANAGARI STRESS SIGN UDATTA = Vedic tone svarita
  • U+0952 DEVANAGARI STRESS SIGN ANUDATTA = Vedic tone anudatta

Although I don’t know what you meant by “Deergha Swarita” in your posted image, I suspect it might be U+1CDA (VEDIC TONE DOUBLE SVARITA), which I did not have available in any of my fonts.

Also confer the Unicode blocks Devanagari, Vedic Extensions and Devanagari Extended.

share|improve this answer
    
This you are giving input itself in unicode right. What about input in Roman and output in unicode –  S.C. May 25 '12 at 12:07
    
OK, now I understand your question, sorry. You want to typeset the Vedic intonation marks with ASCII macros (\_, \=, \|, etc.) as in Chapter 10 “Vedic Macros” of the velthuis manual. I will see to it as soon as I get back to my TeX system. –  brian-ammon Jun 3 '12 at 14:32
    
Yes. Thanks brain. Please reply as soon as possible. I am desperate :( –  S.C. Jun 3 '12 at 15:16
    
Actually, I think that the question has already been answered by egreg: „This kind of input is not for use with XeLaTeX. […]“ Accordingly, I have only found that the examples in section 10.2 work with LaTeX only and not with XeLaTeX. Why would you like to have the ASCII input in XeLaTeX when you can have the normal Unicode input? It seems to me that you have to use the normal LaTeX typesetting program if you want to input the Vedic intonation marks in ASCII. If there are any specific reasons why you need to use the ASCII input in XeLaTeX, you may need to post a follow-up question. –  brian-ammon Jun 5 '12 at 10:50
    
Then how can I input vedic accents? –  S.C. Feb 13 '13 at 9:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.