1

Having some trouble with combined (ligature) glyphs in LaTeX. Not a hindi speaker (native or otherwise) but have been tasked with transferring translated documents in hindi into TeX format.

When I copy-paste the text from the original document into TeX, a few things happen. First, it separates out some of the glyphs. When I try to compile the document in XeLaTeX some glyphs combine correctly ( ् for example correctly removes inherent vowels), but not others. In LuaTeX, different glyphs combine correctly ( ि, for example) at the expense of the ones that had been correct.

I've included an MWE of three words which highlight the problem.

First XeLaTeX

% !TeX program = xelatex
\documentclass[border=5pt]{standalone}
\usepackage{standalone}
\usepackage{fontspec}
    \setmainfont[Script=Devanagari]{Mangal}
\begin{document}
    स्वपन्मय शांित पदाथर् 
\end{document}

Which Results in the following: XeLateX Then with LuaLaTeX

% !TeX program = lualatex
\documentclass[border=5pt]{standalone}
\usepackage{standalone}
\usepackage{fontspec}
    \setmainfont[Script=Devanagari]{Mangal}
\begin{document}    
    स्वपन्मय शांित पदाथर् 
\end{document}

which again results in:luaLateX

In XeLaTeX, the first word is correct. In LuaLaTeX, the second is correct. The third word is not correct in either.

I can't post an additional image, but the final glyph should look like "पदाथ" with a little squiggle above "थ" to denote that the "र" sound comes before.

Really any guidance would be useful!

closed as off-topic by TeXnician, Stefan Pinnow, Bobyandbob, Troy, siracusa Sep 24 '18 at 23:08

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    The unicode input you have given स्वपन्मय शांित पदाथर् is wrong, I don't know how you produced it, but it should be स्वपन्मय शांति पदार्थ. XeTeX produces the correct result from what you gave, in other words, XeTeX is working correctly, it produced exactly what it should have done from स्वपन्मय शांित पदाथर्. If you try it with स्वपन्मय शांति पदार्थ you should get what you want – Au101 Apr 1 '16 at 22:16
  • Hi thanks @Au101 for your response! So I guess this isn't a TeX question but rather a unicode/copy-paste concern... I guess what I'm looking for is a way to automate the correction in TeX. As someone with 0 experience with the language/script I don't really want to be hand editing thousands of lines of script! Thanks for your help! – S.Bej Apr 4 '16 at 12:54
  • I don't know much about TeX programming, but that doesn't sound like a job best done in TeX. there are probably better ways of fixing this issue, but I don't really know what they are. It may be an encoding issue, although I doubt it. If you're copying from a pdf, then it might have been badly produced. In any case, there's nothing wrong with what you've done XeTeX wise, it's perfect. If you give it the correct input you'll get the output you want and it's giving you exactly the right output from the input you've given it. – Au101 Apr 4 '16 at 23:01
  • @Au101 Thanks again, I think you're right. I've gone back to our translation firm and asked for the documents in a number of different formats. Here's hoping that does the trick. Thanks for your help! – S.Bej Apr 7 '16 at 13:38
  • 4
    I'm voting to close this question as the basic problem is copying and pasting (wrong input). – TeXnician Sep 24 '18 at 12:20

Browse other questions tagged or ask your own question.