# How to make Sanskrit Title in Devanagari Package

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}

-
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

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}


-
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

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

\lfoot{ by आकु}
\cfoot{\thepage}
%\cfoot{संस्कृत प्रेमियो के लिये }
\rfoot{}