Skip to content

Pravin Paratey

Natural Language Processing, Data mining and Information Extraction consultant based in London.

Dec 19 2007
Dec 19 2007

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

  1. Download and Install MikTeX.
  2. Start the Package Manager.

    Starting MikTeX Package Manager

    Next, locate and install the devanagari package.

    MikTeX Package Manager

  3. Get the Devnag Binary and copy it to C:\Program Files\MiKTeX 2.7\miktex\bin\.

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:

 1 % Using devanagari in latex
 2 % http://pravin.insanitybegins.com/articles/
 3 % Pravin Paratey [pravinp -at- gmail -dot- com]
 4 
 5 \documentclass[12pt]{article}
 6 \usepackage{devanagari}
 7 \begin{document}
 8 Lets write in devanagari
 9 
10 {\dn calo devanagarI me likhate hai}
11 \end{document}
  1. Save this file as sample.dn.
  2. Next, go to the command line and type devnag sample.dn to generate the corresponding sample.tex file.
  3. 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.

Latest Articles