Monday, December 27, 2010

devanagari.sty / xelatex clash

devanagari.sty uses the LaTeX2e font conventions (of course).  Today I had an old document using devanagari.sty that I'm just converting to XeLaTeX and UTF8.  It was fine, except that the document's English parts were in the chosen polyglossia font, while the table of contents was in cmr.

That was because of a statement
\def\DNrmdefault{cmr}
used by \NormalFont in devanagari.sty

The answer was to define \englishfont
\newfontfamily\englishfont{IndUni-P}
and then redefine \NormalFont as follows:
\DeclareRobustCommand\NormalFont{\dn@penitshape\englishfont}
In the end, this is all transitional nonsense, of course, since I will get rid of devanagari.sty and use XeLaTeX's internal facilities for the Devanagari in a day or two.