Typing in Hindi or Sanskrit using LaTeX has been made simple with Devanagari. If you are already familiar with LaTeX then including text in Hindi, Sanskrit or several other Indian languages is relatively easy. This article describes how to go about doing that.
Linux users would need to install the following packages to get you started with creating documents using LaTeX with support for Devanaragi script, Ubuntu 9.10 users would like to do:
sudo apt-get install texlive-latex-base texlive-lang-indic texlive-fonts-recommended
sudo apt-get install ttf-devanagari-fonts
Now you need to create a document with extension .dn using you favourite word processor. Using this approach you type in Roman and the output would be in Devanagari. Go ahead and create a file called sample.dn and paste the following sample text in to it.
% Using devanagari in latex
/documentclass[12pt]{article}
/usepackage{devanagari}
/begin{document} Lets display a {dn sloka} from Bhagwad Gita
/begin{center}
{/dn karma.nyevAdhikaaraste maa phale.su kadaacana|} //
{/dn maa karmaphalaheturbhurmaa te sa”ngo.astvakarma.ni||}
/end{center}
/end{document}
NOTE: Because of auto formatting by WordPress which removes backslashes, I have replaced all “backslashes” with “forward slashes”, after copying the text do replace the forward slash with back slash, else the code won’t work.
Now at command prompt compile the file you just generated using devnag command like this:
devnag sample.dn
Now this is going to spit out a sample.tex file which should be compiled using latex to generate sample.dvi file which can be viewed using xdvi:
latex sample.tex
xdvi sample.dvi &
Finally you can convert .dvi to .pdf by following either of the two approaches:
Approach 1: dvipdfm sample.dviApproach 2: dvips sample.dvi ps2pdf sample.ps
The resulting file would show something like this:
Some of the Roman characters for Hindi to English transliteration are not obvious and can be looked up for in the documentation for Devanagari attached below. Windows (Miktex) users can find a similar guide here.
|
|
download: Devanagari (199.12KB) added: 31/03/2010 clicks: 95 description: Short Documentation of Devanagari |
Possibly Related Posts (Generated Automatically)
- Solution to Strange Error Thrown By Latex on Ubuntu 10.04
- All About LaTeX
- Add, Extract, Delete or Rotate Pages in a PDF Using Free Tools
- How to Write Better Fortran Programs
- How to mount the LVM type partition/volume on linux
- Adblock for Opera (Blocking ads in Opera on Windows/Linux)
- Control Rhythmbox Using IR Remote (LIRC Support)
- Convert Any Document (Word) to PDF For Free (Windows 7)













The backslash problem was because of auto removal by WordPress. Thank you for pointing it out. I would try to write out a tutorial for your requirement soon.
Like or Dislike:
0
0
Like or Dislike:
0
0
The is missing in the beginning of each command in the given example.
Pl. also provide similar for writing Sanskrit document with accent.
Your reply will make things advanced for me.
Thanks again.
Like or Dislike:
0
0