I am trying type Devanagari Script in LaTeX using Overleaf. But I am getting some formatting error. The "matras" are not reflecting in the output Devanagari text.
\usepackage{devanagari}
{\dn karma}
Output is as follows:

but it should be

I am trying type Devanagari Script in LaTeX using Overleaf. But I am getting some formatting error. The "matras" are not reflecting in the output Devanagari text.
\usepackage{devanagari}
{\dn karma}
Output is as follows:

but it should be

On
You have to make your own .dn file and then input the file in LaTeX. This should solve the matra problem as in making the .dn file, it will add matras phonetically.
On
If you want to write Devanagari (Hindi) in pdflatex then go through this GitHub link.
Input: मै तुमसे बहुत प्यार करता हूँ।
Output: {\dn m\4 \7{t}ms? b\7{h}t =yAr krtA \8{h}\1. }
You need to pre-process your input data. If you have a file
karma.dnand call
you get
karma.texlike this:Result:
The
devnagprogram comes with the LaTeX package. It might be easier to use a Unicode capable LaTeX engine like XeLaTeX or LuaLaTeX together with suitable fonts.