TransWikia.com

How to type Hindi words in LaTeX

TeX - LaTeX Asked by madhavi on January 25, 2021

I am writing a thesis and have to write some Hindi words using LaTeX. When I use

usepackage{devanagari} 
 removed. For example: 
{dn school} 

the output generated is

output of the above code

I want output to be like this: स्कूल

4 Answers

You are probably not using the right Roman characters for the transliteration to work. As far as I have been able to figure out, in order to write "स्कूल" you would have to enter {dn-8{k}l} .

documentclass{article}
usepackage{devanagari}
begin{document}
{dn -8{k}l}
end{document}

outputs स्कूल. Make sure you get the capitalisation right.

This link might be of further help.

Answered by Vaibhav Garg on January 25, 2021

You might want to consider using unicode.

I use XeLaTeX with unicode source to produce multilingual documents with latex. It has the advantage of having the native characters in your source.

You'll need to change to using polyglossia, rather than babel, if you move in this direction.

Answered by Nigel on January 25, 2021

documentclass{article}
usepackage{devanagari}
begin{document}
{dn skuula}
end{document}

compile it using "devnag" compiler Results in following:

{dn -8{k}l}

and then run the generated ".tex" file in latex you will get the output required.

output:

स्कूल

Answered by Manjunath N on January 25, 2021

Improving on Manjunath's answer.

For example, I wanted to type disha.

  1. Create a temporary document named temp.dn with the following contents

    documentclass{article}
    usepackage{devanagari}
    begin{document}
    {dn di"saa}
    end{document}
    
  2. Depending on the word you want, try out some mapping from the document below. Save temp.dn https://drive.google.com/folderview?id=0B2SIfLcmTaRuX3lfWm5RZ2QyUzA&usp=sharing

  3. devnag temp.dn

  4. Above command produces temp.tex
  5. pdflatex temp.tex
  6. Above command generates a pdf.
  7. Check if the pdf has the hindi word that you wanted.
  8. Once you arrive at the word that you wanted, look at temp.tex file
  9. You will see {dn EdfA}
  10. Copy this piece of code to your original tex file.

Answered by pvairam on January 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP