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.

I generally type sanskrit using the "devnag" preprocessor. But when making a sanskrit title it is showing an error. Can you please help me in rectifying this.

My input vivekachoodamani.dn file is given below:

\documentclass[10pt]{article}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{devanagari}
\usepackage{fontspec,bera}
\usepackage[width=4.5in, height=7.0in, top=1.0in, papersize={5.5in,8.5in}]{geometry}

\begin{document}
\title{{\dn vivekachoodama.ni}}
\author{Sri Sankaracharya}

\maketitle

\begin{flushleft}


{\dn sarvavedaantasiddhaantagocara.m tamagocara.m | \\ govinda.m paramaananda.m {sad}guru.m pra.nato.asmyaham ||  1}

{\small I prostrate myself before Govinda, the perfect teacher, who is absorbed always in the highest state of bliss. His true nature cannot be known by the senses or the mind. It is revealed only through knowledge of the scriptures.}

\end{document}
share|improve this question
    
I don't have any experience with Sanskrit or the devnag perprocessor, but it is probably advantageous to give the error message you're receiving. –  Psirus Jan 12 '12 at 10:43
add comment

2 Answers 2

up vote 1 down vote accepted

The end of the flushleft environment is missing. I changed the input encoding from ansinew to utf8, since my editor uses it and it better matches XeLaTeX. Further I got a geometry error, so I removed the package. After I fixed those things, this example could be compiled with XeLaTeX:

\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{devanagari}
\usepackage{fontspec,bera}
\begin{document}
\title{{\dn vivekachoodama.ni}}
\author{Sri Sankaracharya}
\maketitle
\begin{flushleft}
{\dn sarvavedaantasiddhaantagocara.m tamagocara.m | \\ govinda.m paramaananda.m {sad}guru.m pra.nato.asmyaham ||  1}

{\small I prostrate myself before Govinda, the perfect teacher, who is absorbed always in the highest state of bliss. His true nature cannot be known by the senses or the mind. It is revealed only through knowledge of the scriptures.}

\end{flushleft}
\end{document}

enter image description here

share|improve this answer
    
Ok, perhaps I copied the upper half and pasted here. But i have added the \end{flushleft} command. –  chandrasekhar Jan 12 '12 at 10:54
    
right i got it now. –  chandrasekhar Jan 12 '12 at 12:26
    
There seems to be a problem with your example code (the order of devanagari and fontspec); see this question: tex.stackexchange.com/q/74141/3954 . –  Gonzalo Medina Sep 26 '12 at 3:52
add comment

Here is one way of doing it, there could be many way but I find this, the easiest.

\documentclass[a4paper,12pt]{article}
\usepackage[left=0.15in,right=0.15in,top=0.75in,bottom=0.75in]{geometry}
\usepackage{fontspec}
\usepackage{fancyhdr}
\usepackage{verse}
\usepackage{varwidth}
\pagestyle{fancy}
\newenvironment{Verse}
  {\center\varwidth{\linewidth}}
  {\endvarwidth\endcenter}

%\setmainfont[Script=Devanagari]{Nakula}
\setmainfont[Script=Devanagari]{Sanskrit 2003}

\begin{document} 
\title{रामायणम्}
\author{वाल्मीकि}

\maketitle

\lhead{रामायणम्}
\chead{बाल काण्ड}
%\rhead{\bfseries प्रथमः सर्ग}
\lfoot{ by आकु}
\cfoot{\thepage}
%\cfoot{संस्कृत प्रेमियो के लिये }
\rfoot{}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}

\begin{verse}
प्रजापति समः श्रीमान् धता रिपु निषूदनः | \\
रक्षिता जीवलोकस्य धर्मस्य परि रक्षिता||
\end{verse}
\end{document} 
share|improve this answer
add comment

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.