Typing Sanskrit in TeX

If I understand well what you are expecting, you want a document written in English, but with sanskrit quotes within. For this, you may use the package polyglossia and define your main language (English) and other sub languages for the document (for example sanskrit here). In your case, you will also need to declare the fonts for sanskrit, a possibility is devanagarifont.

This is a minimal working example that I expect to fit your needs:

\documentclass[12pt]{article}

\usepackage{fontspec}
\usepackage{polyglossia}

\setmainlanguage{english}
\setotherlanguages{sanskrit} %% or other languages

\newfontfamily\devanagarifont[Script=Devanagari]{Lohit Devanagari}

\begin{document}
The main text is in English, and you can add sanskrit quote...

\begin{sanskrit}
सर्वधर्मान् परित्यज्य मामेकं शरणं व्र्ज

अहं त्वां सर्वपापेभ्यो मोक्षयिष्यामि मा शुचः
\end{sanskrit}
\end{document}

The output is as below :

enter image description here

For information, this was compiled using Ubuntu 14.04 with a full install of Texlive-2015 (not the one in the official repos).

EDIT

Compiled with XeLaTeX (other not tested).


For the sake of completeness, here's how this can be done using the skt package.

Note that I do not recommend this. The skt package is anachronistic. It comes from a time before XeTeX and LuaTeX, from a time where free and easy use of Unicode fonts was not available and where ASCII-only input was the norm. There is every danger that this package will not play nicely with other packages that you need, things might break and it is probably more trouble than it is worth, now.

However, it was once a good package and I quite like the output. I also am rather partial to ASCII-only input, but the problem is skt requires preprocessing.

Anyway, here's how you do it.

You create a .skt file, not a .tex file. The .tex file will be produced by the preprocessor. The .skt file, though, will look just like a normal .tex file. You must load the skt package:

\documentclass[12pt]{article}
\pagestyle{plain}
\usepackage[margin=1.8cm]{geometry}
\geometry{a4paper}
\usepackage[parfill]{parskip}
\usepackage{amsmath}
\usepackage{skt}

\begin{document}

\textit{Bhagavad-G\={\i}t\={a}} 18:66:

{\skt sarvadharmaan parityajya maameka.m "sara.na.m vraja | \\
  aha.m tvaa.m sarvapaapebhyo mok.sayi.syaami maa "suca.h || 66 ||}

\begin{enumerate}\itshape

  \setcounter{enumi}{65}

  \item
  Sarvadharm\={a}n parityajya m\={a}m eka\d{m} \'{s}ara\d{n}a\d{m} vraja; \\
  Aha\d{m} tv\={a}\d{m} sarvap\={a}pebhyo mok\d{s}ayi\d{s}y\={a}mi m\={a}     
  \'{s}uca\d{h}.

\end{enumerate}

\end{document}

This is my answer.skt file. You can see that it's just a normal .tex file in form and function.

So you would need to rename your document file to foo.skt and delete foo.tex.

Then I ran

skt answer.skt

You will probably need to run this command from a terminal, as I doubt any IDEs will support this and you should be aware that .skt files are unlikely to have appropriate syntax highlighting, etc.

This produces the answer.tex file, which looks like this:

\documentclass[12pt]{article}
\pagestyle{plain}
\usepackage[margin=1.8cm]{geometry}
\geometry{a4paper}
\usepackage[parfill]{parskip}
\usepackage{amsmath}
\usepackage{skt}

\begin{document}

\textit{Bhagavad-G\={\i}t\={a}} 18:66:

{\skt .sa;vRa;Da;ma;Ra;n,a :pa;i8a:=+tya:j1ya ma;a;mea;k\ZH{-12}{M} Za:=+NMa
v.ra:ja \ZS{12}@A \\
 A;h\ZH{-6}{M} tva;Ma .sa;vRa;pa;a;pea;Bya;ea ma;ea;[a;Y4a;ya;Sya;a;Y6a;ma
ma;a Zua;.caH\ZS{4} \ZS{12}@A\ZS{6}@A 66 \ZS{12}@A\ZS{6}@A}

\begin{enumerate}\itshape

  \setcounter{enumi}{65}

  \item
  Sarvadharm\={a}n parityajya m\={a}m eka\d{m} \'{s}ara\d{n}a\d{m} vraja; \\
  Aha\d{m} tv\={a}\d{m} sarvap\={a}pebhyo mok\d{s}ayi\d{s}y\={a}mi m\={a}     
  \'{s}uca\d{h}.

\end{enumerate}

\end{document}

So you can see the preprocessor has done nothing more or less but translate the user-friendly skt syntax that a human could read and write, into something that LaTeX can actually read (as long as the skt package is loaded, obviously).

Then and only then did I run

pdflatex ./answer.tex

Which produces:

enter image description here

P.S.: There's a mistake in your original Sanskrit. व्र्ज vrja should be व्रज vraja.


 \documentclass[12pt]{article}
 \usepackage{fontspec}
 \usepackage[english]{babel} 
 \newfontfamily\sanskrit[Script=Devanagari]{Lohit Devanagari}
 \begin{document}
 The main text is in English, and you can add sanskrit quote...

 \begin{quotation}\sanskrit
        सर्वधर्मान् परित्यज्य मामेकं शरणं व्र्ज

        अहं त्वां सर्वपापेभ्यो मोक्षयिष्यामि मा शुचः
 \end{quotation}
 \end{document}

enter image description here