This preprocesses Devanagari text for use with \dn
or \skt
.
Not very well tested, but seems to work.
It was originally written for this answer and meant to be used with the macros there.
It's inconvenient to use by itself, but if you only need Devanagari text for some one-off use case, you could use it if you wish.
Create a file, say myfile-dev-for-dn
containing (only) Devanagari input, for example the file may contain
धर्मक्षेत्रे कार्त्स्न्यम् विद्भिः
Then run
python get-dn.py dn test.tex
This will create a file called myfile-dev-for-dn.devnagout
containing:
{\dn Dm\0\322w\?/\? kA(-\306wy\0\qq{m} EvE\389w,
}
So you can put that into your .tex
file.
Similar, run the script with skt
instead of dn
etc.
When converting a long text
This error comes
UPDATE: I found out the issue. Velthuis system of transliteration does not have any provision for diacritics. So a commonly used symbol, nuqta, does not have any representation in this system. Hence words like ड़, ढ़, ख़ were creating problems. Unicode normalization also does not works for them (NFD works fine but NFC fails). Hence i just replaced those combination characters (ka + nuqta, \u0915+\u093c) with their unicode characters (ka with nuqta, \u0958). And it worked fine.
Here is the gist: https://gist.github.com/ritwikmishra/9f8d6de45aff8fbe959d4260269d9eeb