Hello, I am an Engineering Manager at Facebook with 13+ years in Ad Technology, Natural Language Processing and Data mining. (Learn More)
by Pravin Paratey

Using Devanagari in Latex

Ever wanted to write latex documents in Hindi, Marathi or Sanskrit? This article shows you how to do just that. At the end of this article, you’ll learn to go from here:

Latex Source Screenshot

to here:

Latex Devanagari Output Screenshot

Setting up your system

On Windows

That’s it. We’re all set to write latex documents in Devanagari!

On Linux

If you’re running a debian based system, get the following packages: texlive-latex-base, texlive-lang-indic, texlive-fonts-recommended

Writing in devanagari

Now fire up your editor and add the following code:

% Using devanagari in latex
% http://pravin.paratey.com/posts/
% Pravin Paratey [pravinp -at- gmail -dot- com]

\documentclass[12pt]{article}
\usepackage{devanagari}
\begin{document}
Lets write in devanagari

{\dn calo devanagarI me likhate hai}
\end{document}
  • Save this file as sample.dn.
  • Next, go to the command line and type devnag sample.dn to generate the corresponding sample.tex file.
  • Run latex sample.tex to generate sample.dvi

Figuring out what to type

Figuring out what string of English characters give a Devanagari word isn’t always apparent. This document should be somewhat useful.