I want to type text that may contain both Devanagari or Roman script, and I don't want to change language mid sentence every time. Is it possible to merge two fonts, one which supports Devanagari glyphs, and one which supports Roman glyphs into one language?

Currently, I am doing


And since NotoSansDevangari-Regular does not have glyphs for roman characters, it renders the line

The ending हल् letter of an उपदेश is called 'इत्'.


��� ������ हल् ������ �� �� उपदेश �� ������ 'इत्'.

Is it possible to somehow add NotoSans-Regular alongwith NotoSansDevanagari-Regular in the language so that it can render both scripts properly without having to explicitly do \begin{english}\end{english} ?

2 Answers 2


It is possible to do this with babel. This new preamble should work with your document, so long as you used \textenglish and \begin{sanskrit} instead of \devanagarifont. It requires luahbtex (lualatex in TeX Live 2020 works), but has a bug with xetex (as of July 2020).

\usepackage{iftex} % For \ifluahbtex, \ifxetex, etc.
\usepackage[paperwidth=10cm]{geometry} % Format the MWR for TeX.SX

  \defaultfontfeatures{ Renderer=HarfBuzz,
                        Ligatures=TeX }
  % The only other engine that works, as of 2020, is XeTeX.
  \defaultfontfeatures{ Scale=MatchLowercase,
                        Ligatures=TeX }

\babelprovide[onchar=ids fonts]{sanskrit-devanagari}

          [Ligatures=Common, Scale=1.0,Language=Default]{Noto Serif}
          [Ligatures=Common,Language=Default]{Noto Sans}
          {Noto Serif Devanagari}
          [Language=Default]{Noto Sans Devanagari}
          [Language=Default]{Noto Sans Devanagari UI}

\babeltags{sanskrit=sanskrit-devanagari} % Add \textsanskrit, \begin{sanskrit}
\babeltags{english=english} % Add \textenglish, \begin{englisn}

The ending हल्  letter of  an उपदेश is called `इत्'.

Noto Sans font sample

Recall that quotes in TeX are

`foo ``bar" baz' or ‘foo “bar” baz’
  • I cannot get this to work. Some of the errors from the log file are: ************************************************* * fontspec warning: "script-not-exist" * * Font 'Noto Sans Devanagari UI' does not contain script 'Latin'. ************************************************* and Could not resolve font "Noto Sans Devanagari UI/I" (it probably doesn't . exist). This one now renders only the English words and boxes for Devanagari script.
    – Hrishikesh
    Jul 26, 2020 at 9:52
  • 1
    @Hrishikesh You need to download the Noto fonts. You can ignore the warning about Noto Sans Devanagari UI or even comment those lines our.
    – Davislor
    Jul 26, 2020 at 10:52
  • I have noto fonts installed. They are located in /usr/share/fonts/truetype/notoIt contains these files NotoSansDevanagari-Bold.ttf, NotoSansDevanagari-Regular.ttf, NotoSansDevanagariUI-Bold.ttf, NotoSansDevanagariUI-Regular.ttf as well as similar for many other languages
    – Hrishikesh
    Jul 26, 2020 at 12:02
  • 1
    Can luaotfload-tool find them? If not, rebuilding your cache might help. You can also comment out the pair of lines declaring the rm and tt fonts in this MWE. It works for me with lualatex in TeX Live 2020, but any previous version would require luahbtex.
    – Davislor
    Jul 26, 2020 at 21:54

Seems like you are using XeLaTeX. If so, as @kongo09 mentions in this question, a package called ucharclasses works. Here is the MWE:

\newfontfamily{\defaultfont}{Times New Roman}
\newfontfamily{\latinfont}{Times New Roman}

\usepackage[Latin, Devanagari]{ucharclasses}


The ending हल् letter of an उपदेश is called 'इत्'.

  • I’ve found the package to be buggy in TeX Live 2020.
    – Davislor
    Jul 26, 2020 at 5:11
  • It also does not work in LuaHBTeX.
    – Davislor
    Jul 26, 2020 at 9:08
  • I have tested with my XeLaTeX 2017 and it worked. @Davisor Thank you very much for your information that it is buggy in TeX Live 2020, I did not know that! :)
    – domperor
    Jul 28, 2020 at 6:34
  • 2
    Another more serious bug in this solution is that it always switches back to \defaultfont, and not the font you had selected before. You can fix this by opening with a \begingroup\devanagarifont and closing with an \endgroup.
    – Davislor
    Jul 28, 2020 at 8:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .