I am typesetting a book in XeLaTeX with both Samskrita in Devanagari script and English.

I am trying to include line numbers for proofreading purposes. I want to use the lineno package which works on my system for the following MWE -


I tried using the package in a document with both Devanagari and English as follows

\setmainfont[Script=Devanagari]{Arial Unicode MS}
\newfontfamily\devanagarifont[Script=Devanagari]{Arial Unicode MS}
\newfontfamily{\englishfont}{Times New Roman}
   \devanagaridigits{\number\csname c@#1\endcsname}}
%The following line causes xetex to fail
\section[प्रथमः पादः]{प्रथमः पादः}
वेदो वै विगलित\-विभेदो विखात\-खेदो विच्छिन्न\-दोषच्छेदो 

When I run XeLaTex for the above, I get the following error

! Package polyglossia Error: 
The current roman font does not contain the Devanagari script!
Please define \devanagarifont with \newfontfamily.

Any pointers? How can I use lineno with Devanagari books?

EDIT: The comment by cfr below helped. I added the following line in the preamble and now it works -


Please consider this solved.

  • 4
    By default, the lineno package sets the font for numbers with \normalfont\tiny\sffamily. You can redefine the font using (e.g. from the documentation) \renewcommand\linenumberfont{\normalfont\bfseries\small}. So you probably just need to use this with a suitable font command which will work with all of the scripts you are using, I'd guess. (I don't have that font, I'm sure, so I can't test with your MWE.) – cfr Jan 9 '14 at 2:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.