1
\usepackage{devanagari}

\begin{document}

{\dn  shree, gya,.r}

\end{document}
Mico
  • 506,678

3 Answers3

3

If you have some input method that can enter Devanagari into your source file, you should use Unicode. My own preference is babel in LuaLaTeX. (Here is one of several examples.) You can use either babel or polyglossia in either LuaLaTeX or XeLaTeX, and they will support any Devanagari font you could use in your word processor.

If you want to use Latin-script transliteration in your source file, you can use the xetex devanagari package to load an input mapping for that. There is also a devanagari package that you can fall back to, if some publisher is still forcing you to write South Asian languages with 8-bit font encodings in the 2020s. Here is an example.

Davislor
  • 44,045
2

You could download the Noto Serif Devanagari and Noto Sans Devanagari fonts (if you haven't already done so) from Google and compile the following test document under either LuaLaTeX or XeLaTeX. (Please note that I copied and pasted the string श्र ज्ञ ऋ ् ॆऽ straight from the title of the OP's posting.) Note that the option Script=Devanagari is needed by both XeLaTeX and LuaLaTeX; additionally, Renderer=Harfbuzz is needed by LuaLaTeX. (Many thanks, @davislor, for providing this suggestion!)

enter image description here

Of course, if you prefer, you may use any other OpenType font that provides the required glyphs.

\documentclass{article}
\usepackage{fontspec,iftex}

\ifxetex \setmainfont{Noto Serif Devanagari}[Script=Devanagari] \setsansfont{Noto Sans Devanagari}[Script=Devanagari] \else % LuaTeX \setmainfont{Noto Serif Devanagari}[Script=Devanagari,Renderer=Harfbuzz] \setsansfont{Noto Sans Devanagari}[Script=Devanagari,Renderer=Harfbuzz] \fi

\begin{document} श्र ज्ञ ऋ ् ॆऽ

\medskip \sffamily श्र ज्ञ ऋ ् ॆऽ \end{document}

Mico
  • 506,678
  • 1
    The output is actually wrong in the above screenshot, though adding [Script=Devanagari] after \setmainfont and \setsansfont should fix it I think. – ShreevatsaR Jul 27 '21 at 05:10
  • @ShreevatsaR - Many thanks for drawing attention to this problem. In the case at hand, adding the option [Script=Devanagari] doesn't help under LuaLaTeX, but it makes a huge difference under XeLaTeX. Again, many thanks for your comment and suggestion. – Mico Jul 27 '21 at 09:58
  • 1
    Using devanagari I able to write all the alphabet except श्र ऋ, ्, ए, ऐ, ञ, त्न द्द, द्ध. I believe that all devanagari letters are there. What are key to write these letters can any one tell me??? – Vyom Shastri Jul 27 '21 at 11:27
  • 1
    In LuaLaTeX, you want to load the Devanagari font with [Script=Devanagari, Renderer=HarfBuzz]. – Davislor Jul 27 '21 at 12:35
  • @Davislor - Many thanks for this suggestion; I've updated my answer accordingly. – Mico Jul 27 '21 at 13:00
  • I checked it's not working. Even I searched for the package devanagari but the transliteration specified there was not working in my system. – Vyom Shastri Jul 29 '21 at 04:56
  • @VyomShastri - Sorry, but where in my answer did I mention a package called devanagari? – Mico Jul 29 '21 at 06:47
0

{\dn \380w \3E2w \31Bw \35Ew \303w \35Fw }

P.S.

you can check out the table \30Xw ~ \3FFw like below... 30{\dn \300w \301w \302w \303w \304w \305w \306w \307w \308w \309w \30Aw \30Bw \30Cw \30Dw \30Ew \30Fw }\\