TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to write some Hindi text along with English using LaTeX for eg: k=क, bollywood or (बॉलीवुड). I have used the below in the preamble but I'm getting the error command:

\G already defined.

\setmainfont{Times New Roman}
\newfontfamily\devtransl[Script=Roman,Mapping=DevRom]{Times New Roman}
share|improve this question
Hi Amit, welcome to TeX.sx. I've put your quote in a quote block, and the code in a code block. Click on edit to see how to do these using the keyboard, but also note in the editor that there is a code tool marked with {}, and a similar quote tool. – qubyte Feb 20 '12 at 14:59

\setmainfont{Times New Roman}
\newfontfamily\devanagarifont[Scale=MatchUppercase]{Devanagari MT}
\newfontfamily\devtransl[Mapping=DevRom]{Times New Roman}

bollywood or \foreignlanguage{sanskrit}{बॉलीवुड}

I've changed the Devanagari font to one that I have on my machine:

enter image description here

For longer parts in Sanskrit there's also the otherlanguage* environment. For entire paragraphs you can use the sanskrit environment, see the documentation of Polyglossia.

There's no need, in general, to load xltxtra.

share|improve this answer
thanks.its working. i tried it with my main document but due to package conflicts of amssymb and amsmth, it was giving errors. the sequence mentioned below solved all the problem. {\documentclass{report} \usepackage{amssymb} \usepackage{polyglossia} \usepackage{amsmath} \setdefaultlanguage{english} \setotherlanguage{sanskrit} \usepackage{fontspec} \setmainfont{Times New Roman} \newfontfamily\devanagarifont[Scale=MatchUppercase]{Mangal} \newfontfamily\devtransl[Mapping=DevRom]{Times New Roman}} – Amit Bhatt Feb 20 '12 at 20:07
If you're using Hindi you should set the main language to hindi not sanskrit, since (at least) the hyphenation patterns are different. (I don't know about other things.) – Alan Munn Apr 3 '13 at 12:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.